]> git.ipfire.org Git - people/stevee/aiccu.git/blame - common/aiccu_openbsd2.c
spelling error
[people/stevee/aiccu.git] / common / aiccu_openbsd2.c
CommitLineData
d98f6a46
SS
1/**********************************************************
2 SixXS - Automatic IPv6 Connectivity Configuration Utility
3***********************************************************
4 Copyright 2003-2005 SixXS - http://www.sixxs.net
5***********************************************************
6 common/aiccu_openbsd2.c - OpenBSD 2.7-2.9
7***********************************************************
8 $Author: jeroen $
9 $Id: aiccu_openbsd2.c,v 1.7 2007-01-07 16:37:50 jeroen Exp $
10 $Date: 2007-01-07 16:37:50 $
11
12 Original version provided by Wouter Van Hemel
13**********************************************************/
14
15#include "aiccu.h"
16
17bool aiccu_os_install(void)
18{
19 return true;
20}
21
22bool aiccu_os_setup(struct TIC_Tunnel *hTunnel)
23{
24 if (hTunnel->uses_tundev == 0)
25 {
26 aiccu_exec(
27 "/sbin/ifconfig %s giftunnel %s %s",
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
33 aiccu_exec(
34 "ifconfig %s up",
35 g_aiccu->ipv6_interface);
36
37 aiccu_exec(
38 "ifconfig %s mtu %u",
39 g_aiccu->ipv6_interface,
40 hTunnel->nMTU);
41
42 if (hTunnel->uses_tundev == 1)
43 {
44 aiccu_exec(
45 "ifconfig %s inet6 %s prefixlen 64 alias",
46 g_aiccu->ipv6_interface,
47 hTunnel->sIPv6_LinkLocal);
48 }
49
50 aiccu_exec(
51 "ifconfig %s inet6 %s %s prefixlen 128 alias",
52 g_aiccu->ipv6_interface,
53 hTunnel->sIPv6_Local,
54 hTunnel->sIPv6_POP);
55
56 if (g_aiccu->defaultroute)
57 {
58 aiccu_exec(
59 "route add -inet6 %s %s",
60 "default",
61 hTunnel->sIPv6_POP);
62 }
63
64 return true;
65}
66
67void aiccu_os_reconfig(struct TIC_Tunnel *hTunnel)
68{
69 aiccu_exec(
70 "/sbin/ifconfig %s giftunnel %s %s",
71 g_aiccu->ipv6_interface,
72 hTunnel->sIPv4_Local,
73 hTunnel->sIPv4_POP);
74}
75
76void aiccu_os_delete(struct TIC_Tunnel *hTunnel)
77{
78 hTunnel = hTunnel;
79 aiccu_exec(
80 "ifconfig %s down",
81 g_aiccu->ipv6_interface);
82
83 aiccu_exec(
84 "ifconfig %s inet6 %s %s prefixlen 128 -alias",
85 g_aiccu->ipv6_interface,
86 hTunnel->sIPv6_Local,
87 hTunnel->sIPv6_POP);
88
89}
90