+++ /dev/null
-From 0268def7364007f78ad0d0411d57e277fd1d1a84 Mon Sep 17 00:00:00 2001
-From: Stefan Schantl <stefan.schantl@ipfire.org>
-Date: Wed, 26 Aug 2015 18:58:56 +0000
-Subject: [PATCH 10/10] Add setup script functionality to Linux client
-
-Environment variables are set to pass information about
-the tunnel to the called script.
-
-Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
-Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
----
- common/aiccu_linux.c | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
-
-diff --git a/common/aiccu_linux.c b/common/aiccu_linux.c
-index b86ad67..f8257bd 100755
---- a/common/aiccu_linux.c
-+++ b/common/aiccu_linux.c
-@@ -41,6 +41,8 @@ bool aiccu_os_install(void)
-
- bool aiccu_os_setup(struct TIC_Tunnel *hTunnel)
- {
-+ char buffer[1024];
-+
- if (hTunnel->uses_tundev == 0)
- {
- aiccu_exec(
-@@ -91,6 +93,24 @@ bool aiccu_os_setup(struct TIC_Tunnel *hTunnel)
- g_aiccu->ipv6_interface);
- }
-
-+ if (g_aiccu->setupscript)
-+ {
-+ setenv("ACTION", "up", 1);
-+ setenv("TUNNEL_TYPE", hTunnel->sType, 1);
-+ setenv("INTERFACE", g_aiccu->ipv6_interface, 1);
-+ setenv("REMOTE_ADDRESS", hTunnel->sIPv6_POP, 1);
-+
-+ snprintf(buffer, sizeof(buffer), "%s/%u",
-+ hTunnel->sIPv6_Local, hTunnel->nIPv6_PrefixLength);
-+ setenv("LOCAL_ADDRESS", buffer, 1);
-+ setenv("LINK_LOCAL_ADDRESS", hTunnel->sIPv6_LinkLocal, 1);
-+
-+ snprintf(buffer, sizeof(buffer), "%u", hTunnel->nMTU);
-+ setenv("MTU", buffer, 1);
-+
-+ aiccu_exec("%s", g_aiccu->setupscript);
-+ }
-+
- return true;
- }
-
-@@ -118,5 +138,12 @@ void aiccu_os_delete(struct TIC_Tunnel *hTunnel)
- "ip tunnel del %s",
- g_aiccu->ipv6_interface);
- }
-+
-+ {
-+ setenv("ACTION", "down", 1);
-+ setenv("INTERFACE", g_aiccu->ipv6_interface, 1);
-+
-+ aiccu_exec("%s", g_aiccu->setupscript);
-+ }
- }
-
---
-1.8.1
-