… | |
… | |
91 | |
91 | |
92 | #define netname conf.ifname |
92 | #define netname conf.ifname |
93 | |
93 | |
94 | #if IF_linux |
94 | #if IF_linux |
95 | # include "tincd/linux/device.c" |
95 | # include "tincd/linux/device.c" |
|
|
96 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME hw ether $MAC mtu $MTU up"; } |
96 | |
97 | |
97 | #elif IF_freebsd |
98 | #elif IF_freebsd |
98 | # include "tincd/freebsd/device.c" |
99 | # include "tincd/freebsd/device.c" |
|
|
100 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU up"; } |
99 | |
101 | |
100 | #elif IF_netbsd |
102 | #elif IF_netbsd |
101 | # define IF_istun 1 |
103 | # define IF_istun 1 |
102 | # include "tincd/netbsd/device.c" |
104 | # include "tincd/netbsd/device.c" |
|
|
105 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU up"; } |
103 | |
106 | |
104 | #elif IF_openbsd |
107 | #elif IF_openbsd |
105 | # define IF_istun 1 |
108 | # define IF_istun 1 |
106 | # include "tincd/openbsd/device.c" |
109 | # include "tincd/openbsd/device.c" |
|
|
110 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME mtu $MTU up"; } |
107 | |
111 | |
108 | #elif IF_solaris |
112 | #elif IF_solaris |
109 | # define IF_istun 1 |
113 | # define IF_istun 1 |
110 | # include "tincd/solaris/device.c" |
114 | # include "tincd/solaris/device.c" |
|
|
115 | const char * tap_device::if_up () { return ""; } |
111 | |
116 | |
112 | #elif IF_cygwin |
117 | #elif IF_cygwin |
113 | # include "tincd/cygwin/device.c" |
118 | # include "tincd/cygwin/device.c" |
|
|
119 | const char * tap_device::if_up () { return ""; } |
114 | |
120 | |
115 | #elif IF_mingw |
121 | #elif IF_mingw |
116 | # include "tincd/mingw/device.c" |
122 | # include "tincd/mingw/device.c" |
|
|
123 | const char * tap_device::if_up () { return ""; } |
117 | |
124 | |
118 | #elif IF_darwin |
125 | #elif IF_darwin |
119 | # define IF_istun 1 |
126 | # define IF_istun 1 |
120 | # include "tincd/darwin/device.c" |
127 | # include "tincd/darwin/device.c" |
|
|
128 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU up"; } |
121 | |
129 | |
122 | #elif IF_raw_socket |
130 | #elif IF_raw_socket |
123 | # define IF_istun 1 |
|
|
124 | # include "tincd/raw_socket/device.c" |
131 | # include "tincd/raw_socket/device.c" |
|
|
132 | const char * tap_device::if_up () { return "/sbin/ifconfig $IFNAME ether $MAC mtu $MTU up"; } |
125 | |
133 | |
126 | #elif IF_uml_socket |
134 | #elif IF_uml_socket |
127 | # include "tincd/uml_socket/device.c" |
135 | # include "tincd/uml_socket/device.c" |
|
|
136 | const char * tap_device::if_up () { return 0; } |
128 | |
137 | |
129 | #else |
138 | #else |
130 | # error No interface implementation for your IFTYPE/IFSUBTYPE combination. |
139 | # error No interface implementation for your IFTYPE/IFSUBTYPE combination. |
131 | #endif |
140 | #endif |
132 | |
141 | |