1 /**********************************************************
2 SixXS - Automatic IPv6 Connectivity Configuration Utility
3 ***********************************************************
4 Copyright 2003-2005 SixXS - http://www.sixxs.net
5 ***********************************************************
6 common/aiccu_freebsd4.c - FreeBSD 3.x/4.x
7 ***********************************************************
9 $Id: aiccu_freebsd4.c,v 1.11 2007-01-07 17:05:23 jeroen Exp $
10 $Date: 2007-01-07 17:05:23 $
11 **********************************************************/
15 bool aiccu_os_install(void)
20 bool aiccu_os_setup(struct TIC_Tunnel
*hTunnel
)
22 if (hTunnel
->uses_tundev
== 0)
24 /* Create the tunnel device */
26 "/sbin/ifconfig %s create",
27 g_aiccu
->ipv6_interface
);
29 /* Configure the endpoint */
31 "/sbin/ifconfig %s tunnel %s %s",
32 g_aiccu
->ipv6_interface
,
33 strcmp(hTunnel
->sIPv4_Local
, "heartbeat") == 0 ? "0.0.0.0" : hTunnel
->sIPv4_Local
,
37 /* Mark the interface up */
40 g_aiccu
->ipv6_interface
);
42 /* Configure the MTU */
45 g_aiccu
->ipv6_interface
,
48 if (hTunnel
->uses_tundev
== 1)
50 /* Give it a link local address */
52 "ifconfig %s inet6 %s prefixlen 64 alias",
53 g_aiccu
->ipv6_interface
,
54 hTunnel
->sIPv6_LinkLocal
);
57 /* Local side of the tunnel */
59 "ifconfig %s inet6 %s prefixlen 128 alias",
60 g_aiccu
->ipv6_interface
,
61 hTunnel
->sIPv6_Local
);
63 /* Route to the remote side of the tunnel */
65 "route add -inet6 %s -prefixlen 128 %s",
67 hTunnel
->sIPv6_Local
);
69 if (g_aiccu
->defaultroute
)
71 /* Add a default route */
73 "route add -inet6 %s %s",
81 void aiccu_os_reconfig(struct TIC_Tunnel
*hTunnel
)
83 if (hTunnel
->uses_tundev
== 0)
85 /* Change the endpoints of the tunnel */
87 "/sbin/ifconfig %s tunnel %s %s",
88 g_aiccu
->ipv6_interface
,
94 void aiccu_os_delete(struct TIC_Tunnel
*hTunnel
)
98 /* Mark the interface down */
101 g_aiccu
->ipv6_interface
);
103 if (hTunnel
->uses_tundev
== 0)
105 /* Destroy the tunnel */
107 "ifconfig %s destroy",
108 g_aiccu
->ipv6_interface
);