]>
Commit | Line | Data |
---|---|---|
d98f6a46 SS |
1 | /********************************************************** |
2 | SixXS - Automatic IPv6 Connectivity Configuration Utility | |
3 | *********************************************************** | |
4 | Copyright 2003-2005 SixXS - http://www.sixxs.net | |
5 | *********************************************************** | |
6 | common/aiccu_sunos.c - Sun Solaris / SunOS | |
7 | ||
8 | ipv6_interface has to be eg ip.tun0 | |
9 | *********************************************************** | |
10 | $Author: jeroen $ | |
11 | $Id: aiccu_sunos.c,v 1.3 2006-07-23 14:13:57 jeroen Exp $ | |
12 | $Date: 2006-07-23 14:13:57 $ | |
13 | **********************************************************/ | |
14 | ||
15 | #include "aiccu.h" | |
16 | ||
17 | bool aiccu_os_install(void) | |
18 | { | |
19 | return true; | |
20 | } | |
21 | ||
22 | bool aiccu_os_setup(struct TIC_Tunnel *hTunnel) | |
23 | { | |
24 | if (hTunnel->uses_tundev == 0) | |
25 | { | |
26 | aiccu_exec( | |
27 | "/sbin/ifconfig %s inet6 plumb tsrc %s tdst %s up", | |
28 | g_aiccu->ipv6_interface, | |
29 | strcmp(hTunnel->sIPv4_Local, "heartbeat") == 0 ? "0.0.0.0" : hTunnel->sIPv4_Local, | |
30 | hTunnel->sIPv4_POP); | |
31 | ||
32 | aiccu_exec( | |
33 | "ifconfig %s inet6 addif %s %s up", | |
34 | g_aiccu->ipv6_interface, | |
35 | hTunnel->sIPv6_Local, | |
36 | hTunnel->sIPv6_POP); | |
37 | } | |
38 | else | |
39 | { | |
40 | dolog(LOG_DEBUG, "There is no Solaris support for tun-devices yet"); | |
41 | exit(-1); | |
42 | } | |
43 | ||
44 | if (g_aiccu->defaultroute) | |
45 | { | |
46 | aiccu_exec( | |
47 | "route add -inet6 %s %s", | |
48 | "default", | |
49 | hTunnel->sIPv6_POP); | |
50 | } | |
51 | ||
52 | return true; | |
53 | } | |
54 | ||
55 | void aiccu_os_reconfig(struct TIC_Tunnel *hTunnel) | |
56 | { | |
57 | if (hTunnel->uses_tundev == 0) | |
58 | { | |
59 | aiccu_exec( | |
60 | "/sbin/ifconfig %s inet6 plumb tsrc %s tdst %s up", | |
61 | g_aiccu->ipv6_interface, | |
62 | strcmp(hTunnel->sIPv4_Local, "heartbeat") == 0 ? "0.0.0.0" : hTunnel->sIPv4_Local, | |
63 | hTunnel->sIPv4_POP); | |
64 | } | |
65 | } | |
66 | ||
67 | void aiccu_os_delete(struct TIC_Tunnel *hTunnel) | |
68 | { | |
69 | hTunnel = hTunnel; | |
70 | aiccu_exec( | |
71 | "ifconfig %s down", | |
72 | g_aiccu->ipv6_interface); | |
73 | } | |
74 |