… | |
… | |
67 | // will be casted to data_packet, due to structural similarity |
67 | // will be casted to data_packet, due to structural similarity |
68 | struct vpn_packet_t : net_packet { |
68 | struct vpn_packet_t : net_packet { |
69 | u8 data[MAXSIZE]; |
69 | u8 data[MAXSIZE]; |
70 | }; |
70 | }; |
71 | |
71 | |
72 | static tap_device *self; |
|
|
73 | |
|
|
74 | static bool overwrite_mac; |
72 | static bool overwrite_mac; |
75 | |
73 | |
76 | static bool |
74 | static bool |
77 | get_config_string(const char *key, char **res) |
75 | get_config_string(const char *key, char **res) |
78 | { |
76 | { |
… | |
… | |
136 | return _("tincd compatibility layer"); |
134 | return _("tincd compatibility layer"); |
137 | } |
135 | } |
138 | |
136 | |
139 | tap_device::tap_device () |
137 | tap_device::tap_device () |
140 | { |
138 | { |
141 | self = this; |
|
|
142 | |
|
|
143 | if (setup_device ()) |
139 | if (setup_device ()) |
144 | { |
140 | { |
145 | //slog (L_DEBUG, _("%s is a %s"), device, info ()); |
141 | slog (L_DEBUG, _("interface %s initialized"), info ()); |
146 | fd = device_fd; |
142 | fd = device_fd; |
147 | strcpy (ifrname, iface); |
143 | strcpy (ifrname, iface); |
148 | } |
144 | } |
149 | else |
145 | else |
150 | { |
146 | { |
151 | slog (L_ERR, _("error while configuring tincd device (%s/%s)"), device, info ()); |
147 | slog (L_ERR, _("error while configuring tincd device (%s)"), info ()); |
152 | exit (1); |
148 | exit (1); |
153 | } |
149 | } |
154 | } |
150 | } |
155 | |
151 | |
156 | tap_device::~tap_device () |
152 | tap_device::~tap_device () |