OpenVPN
tun.h
Go to the documentation of this file.
1 /*
2  * OpenVPN -- An application to securely tunnel IP networks
3  * over a single TCP/UDP port, with support for SSL/TLS-based
4  * session authentication and key exchange,
5  * packet encryption, packet authentication, and
6  * packet compression.
7  *
8  * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2
12  * as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef TUN_H
25 #define TUN_H
26 
27 #ifdef _WIN32
28 #include <winioctl.h>
29 #include <tap-windows.h>
30 #endif
31 
32 #include "buffer.h"
33 #include "error.h"
34 #include "mtu.h"
35 #include "win32.h"
36 #include "event.h"
37 #include "proto.h"
38 #include "misc.h"
39 
40 #if defined(_WIN32) || defined(TARGET_ANDROID)
41 
42 #define TUN_ADAPTER_INDEX_INVALID ((DWORD)-1)
43 
44 /* time constants for --ip-win32 adaptive */
45 #define IPW32_SET_ADAPTIVE_DELAY_WINDOW 300
46 #define IPW32_SET_ADAPTIVE_TRY_NETSH 20
47 
49  /* --ip-win32 options */
51 
52 #define IPW32_SET_MANUAL 0 /* "--ip-win32 manual" */
53 #define IPW32_SET_NETSH 1 /* "--ip-win32 netsh" */
54 #define IPW32_SET_IPAPI 2 /* "--ip-win32 ipapi" */
55 #define IPW32_SET_DHCP_MASQ 3 /* "--ip-win32 dynamic" */
56 #define IPW32_SET_ADAPTIVE 4 /* "--ip-win32 adaptive" */
57 #define IPW32_SET_N 5
59 
60 #ifdef _WIN32
61  HANDLE msg_channel;
62 #endif
63 
64  /* --ip-win32 dynamic options */
68 
69  /* --tap-sleep option */
70  int tap_sleep;
71 
72  /* --dhcp-option options */
73 
75 
76  const char *domain; /* DOMAIN (15) */
77 
78  const char *netbios_scope; /* NBS (47) */
79 
80  int netbios_node_type; /* NBT 1,2,4,8 (46) */
81 
82 #define N_DHCP_ADDR 4 /* Max # of addresses allowed for
83  * DNS, WINS, etc. */
84 
85  /* DNS (6) */
87  int dns_len;
88 
89  /* WINS (44) */
91  int wins_len;
92 
93  /* NTP (42) */
95  int ntp_len;
96 
97  /* NBDD (45) */
99  int nbdd_len;
100 
101  /* DISABLE_NBT (43, Vendor option 001) */
103 
106 
108 
109  struct in6_addr dns6[N_DHCP_ADDR];
110  int dns6_len;
111 };
112 
113 #elif TARGET_LINUX
114 
115 struct tuntap_options {
116  int txqueuelen;
117 };
118 
119 #else /* if defined(_WIN32) || defined(TARGET_ANDROID) */
120 
121 struct tuntap_options {
122  int dummy; /* not used */
123 };
124 
125 #endif /* if defined(_WIN32) || defined(TARGET_ANDROID) */
126 
127 /*
128  * Define a TUN/TAP dev.
129  */
130 
131 struct tuntap
132 {
133 #define TUNNEL_TYPE(tt) ((tt) ? ((tt)->type) : DEV_TYPE_UNDEF)
134  int type; /* DEV_TYPE_x as defined in proto.h */
135 
136 #define TUNNEL_TOPOLOGY(tt) ((tt) ? ((tt)->topology) : TOP_UNDEF)
137  int topology; /* one of the TOP_x values */
138 
141 
142  bool persistent_if; /* if existed before, keep on program end */
143 
144  struct tuntap_options options; /* options set on command line */
145 
146  char *actual_name; /* actual name of TUN/TAP dev, usually including unit number */
147 
148  /* number of TX buffers */
150 
151  /* ifconfig parameters */
155 
156  struct in6_addr local_ipv6;
157  struct in6_addr remote_ipv6;
159 
160 #ifdef _WIN32
161  HANDLE hand;
162  struct overlapped_io reads;
163  struct overlapped_io writes;
165 
166  /* used for setting interface address via IP Helper API
167  * or DHCP masquerade */
172 
173  /* Windows adapter index for TAP-Windows adapter,
174  * ~0 if undefined */
176 
178 #else /* ifdef _WIN32 */
179  int fd; /* file descriptor for TUN/TAP dev */
180 #endif
181 
182 #ifdef TARGET_SOLARIS
183  int ip_fd;
184 #endif
185 
186 #ifdef HAVE_NET_IF_UTUN_H
187  bool is_utun;
188 #endif
189  /* used for printing status info only */
190  unsigned int rwflags_debug;
191 
192  /* Some TUN/TAP drivers like to be ioctled for mtu
193  * after open */
195 };
196 
197 static inline bool
198 tuntap_defined(const struct tuntap *tt)
199 {
200 #ifdef _WIN32
201  return tt && tt->hand != NULL;
202 #else
203  return tt && tt->fd >= 0;
204 #endif
205 }
206 
207 /*
208  * Function prototypes
209  */
210 
211 void open_tun(const char *dev, const char *dev_type, const char *dev_node,
212  struct tuntap *tt);
213 
214 void close_tun(struct tuntap *tt);
215 
216 int write_tun(struct tuntap *tt, uint8_t *buf, int len);
217 
218 int read_tun(struct tuntap *tt, uint8_t *buf, int len);
219 
220 void tuncfg(const char *dev, const char *dev_type, const char *dev_node,
221  int persist_mode, const char *username,
222  const char *groupname, const struct tuntap_options *options);
223 
224 const char *guess_tuntap_dev(const char *dev,
225  const char *dev_type,
226  const char *dev_node,
227  struct gc_arena *gc);
228 
229 struct tuntap *init_tun(const char *dev, /* --dev option */
230  const char *dev_type, /* --dev-type option */
231  int topology, /* one of the TOP_x values */
232  const char *ifconfig_local_parm, /* --ifconfig parm 1 */
233  const char *ifconfig_remote_netmask_parm, /* --ifconfig parm 2 */
234  const char *ifconfig_ipv6_local_parm, /* --ifconfig parm 1 / IPv6 */
235  int ifconfig_ipv6_netbits_parm, /* --ifconfig parm 1 / bits */
236  const char *ifconfig_ipv6_remote_parm, /* --ifconfig parm 2 / IPv6 */
237  struct addrinfo *local_public,
238  struct addrinfo *remote_public,
239  const bool strict_warn,
240  struct env_set *es);
241 
242 void init_tun_post(struct tuntap *tt,
243  const struct frame *frame,
244  const struct tuntap_options *options);
245 
246 void do_ifconfig_setenv(const struct tuntap *tt,
247  struct env_set *es);
248 
257 void do_ifconfig(struct tuntap *tt, const char *ifname, int tun_mtu,
258  const struct env_set *es);
259 
260 bool is_dev_type(const char *dev, const char *dev_type, const char *match_type);
261 
262 int dev_type_enum(const char *dev, const char *dev_type);
263 
264 const char *dev_type_string(const char *dev, const char *dev_type);
265 
266 const char *ifconfig_options_string(const struct tuntap *tt, bool remote, bool disable, struct gc_arena *gc);
267 
268 bool is_tun_p2p(const struct tuntap *tt);
269 
270 void check_subnet_conflict(const in_addr_t ip,
271  const in_addr_t netmask,
272  const char *prefix);
273 
275 
276 /*
277  * Inline functions
278  */
279 
280 static inline void
281 tun_adjust_frame_parameters(struct frame *frame, int size)
282 {
283  frame_add_to_extra_tun(frame, size);
284 }
285 
286 /*
287  * Should ifconfig be called before or after
288  * tun dev open?
289  */
290 
291 #define IFCONFIG_BEFORE_TUN_OPEN 0
292 #define IFCONFIG_AFTER_TUN_OPEN 1
293 
294 #define IFCONFIG_DEFAULT IFCONFIG_AFTER_TUN_OPEN
295 
296 static inline int
298 {
299 #if defined(TARGET_LINUX)
301 #elif defined(TARGET_SOLARIS)
303 #elif defined(TARGET_OPENBSD)
305 #elif defined(TARGET_DARWIN)
307 #elif defined(TARGET_NETBSD)
309 #elif defined(_WIN32)
311 #elif defined(TARGET_ANDROID)
313 #else /* if defined(TARGET_LINUX) */
314  return IFCONFIG_DEFAULT;
315 #endif
316 }
317 
318 #define ROUTE_BEFORE_TUN 0
319 #define ROUTE_AFTER_TUN 1
320 #define ROUTE_ORDER_DEFAULT ROUTE_AFTER_TUN
321 
322 static inline int
324 {
325 #if defined(TARGET_ANDROID)
326  return ROUTE_BEFORE_TUN;
327 #else
328  return ROUTE_ORDER_DEFAULT;
329 #endif
330 }
331 
332 
333 #ifdef _WIN32
334 
335 #define TUN_PASS_BUFFER
336 
337 struct tap_reg
338 {
339  const char *guid;
340  struct tap_reg *next;
341 };
342 
343 struct panel_reg
344 {
345  const char *name;
346  const char *guid;
347  struct panel_reg *next;
348 };
349 
350 int ascii2ipset(const char *name);
351 
352 const char *ipset2ascii(int index);
353 
354 const char *ipset2ascii_all(struct gc_arena *gc);
355 
356 void verify_255_255_255_252(in_addr_t local, in_addr_t remote);
357 
358 const IP_ADAPTER_INFO *get_adapter_info_list(struct gc_arena *gc);
359 
360 const IP_ADAPTER_INFO *get_tun_adapter(const struct tuntap *tt, const IP_ADAPTER_INFO *list);
361 
362 const IP_ADAPTER_INFO *get_adapter_info(DWORD index, struct gc_arena *gc);
363 
364 const IP_PER_ADAPTER_INFO *get_per_adapter_info(const DWORD index, struct gc_arena *gc);
365 
366 const IP_ADAPTER_INFO *get_adapter(const IP_ADAPTER_INFO *ai, DWORD index);
367 
368 bool is_adapter_up(const struct tuntap *tt, const IP_ADAPTER_INFO *list);
369 
370 bool is_ip_in_adapter_subnet(const IP_ADAPTER_INFO *ai, const in_addr_t ip, in_addr_t *highest_netmask);
371 
372 DWORD adapter_index_of_ip(const IP_ADAPTER_INFO *list,
373  const in_addr_t ip,
374  int *count,
375  in_addr_t *netmask);
376 
377 void show_tap_win_adapters(int msglev, int warnlev);
378 
379 void show_adapters(int msglev);
380 
381 void tap_allow_nonadmin_access(const char *dev_node);
382 
384 
385 const char *tap_win_getinfo(const struct tuntap *tt, struct gc_arena *gc);
386 
387 void tun_show_debug(struct tuntap *tt);
388 
389 bool dhcp_release_by_adapter_index(const DWORD adapter_index);
390 
391 bool dhcp_renew_by_adapter_index(const DWORD adapter_index);
392 
393 void fork_register_dns_action(struct tuntap *tt);
394 
395 void ipconfig_register_dns(const struct env_set *es);
396 
397 void tun_standby_init(struct tuntap *tt);
398 
399 bool tun_standby(struct tuntap *tt);
400 
401 int tun_read_queue(struct tuntap *tt, int maxsize);
402 
403 int tun_write_queue(struct tuntap *tt, struct buffer *buf);
404 
405 int tun_finalize(HANDLE h, struct overlapped_io *io, struct buffer *buf);
406 
407 static inline bool
409 {
410  /*
411  * This corresponds to the STATUS_NO_SUCH_DEVICE
412  * error in tapdrvr.c.
413  */
414  if (status < 0)
415  {
416  return openvpn_errno() == ERROR_FILE_NOT_FOUND;
417  }
418  return false;
419 }
420 
421 static inline bool
423 {
424  /*
425  * Typically generated when driver is halted.
426  */
427  if (status < 0)
428  {
429  return openvpn_errno() == ERROR_OPERATION_ABORTED;
430  }
431  return false;
432 }
433 
434 static inline int
435 tun_write_win32(struct tuntap *tt, struct buffer *buf)
436 {
437  int err = 0;
438  int status = 0;
439  if (overlapped_io_active(&tt->writes))
440  {
441  status = tun_finalize(tt->hand, &tt->writes, NULL);
442  if (status < 0)
443  {
444  err = GetLastError();
445  }
446  }
447  tun_write_queue(tt, buf);
448  if (status < 0)
449  {
450  SetLastError(err);
451  return status;
452  }
453  else
454  {
455  return BLEN(buf);
456  }
457 }
458 
459 static inline int
460 read_tun_buffered(struct tuntap *tt, struct buffer *buf, int maxsize)
461 {
462  return tun_finalize(tt->hand, &tt->reads, buf);
463 }
464 
465 static inline int
466 write_tun_buffered(struct tuntap *tt, struct buffer *buf)
467 {
468  return tun_write_win32(tt, buf);
469 }
470 
471 #else /* ifdef _WIN32 */
472 
473 static inline bool
474 tuntap_stop(int status)
475 {
476  return false;
477 }
478 
479 static inline bool
480 tuntap_abort(int status)
481 {
482  return false;
483 }
484 
485 static inline void
486 tun_standby_init(struct tuntap *tt)
487 {
488 }
489 
490 static inline bool
491 tun_standby(struct tuntap *tt)
492 {
493  return true;
494 }
495 
496 #endif /* ifdef _WIN32 */
497 
498 /*
499  * TUN/TAP I/O wait functions
500  */
501 
502 static inline event_t
503 tun_event_handle(const struct tuntap *tt)
504 {
505 #ifdef _WIN32
506  return &tt->rw_handle;
507 #else
508  return tt->fd;
509 #endif
510 }
511 
512 static inline unsigned int
513 tun_set(struct tuntap *tt,
514  struct event_set *es,
515  unsigned int rwflags,
516  void *arg,
517  unsigned int *persistent)
518 {
519  if (tuntap_defined(tt))
520  {
521  /* if persistent is defined, call event_ctl only if rwflags has changed since last call */
522  if (!persistent || *persistent != rwflags)
523  {
524  event_ctl(es, tun_event_handle(tt), rwflags, arg);
525  if (persistent)
526  {
527  *persistent = rwflags;
528  }
529  }
530 #ifdef _WIN32
531  if (rwflags & EVENT_READ)
532  {
533  tun_read_queue(tt, 0);
534  }
535 #endif
536  tt->rwflags_debug = rwflags;
537  }
538  return rwflags;
539 }
540 
541 const char *tun_stat(const struct tuntap *tt, unsigned int rwflags, struct gc_arena *gc);
542 
543 #endif /* TUN_H */
struct tuntap * init_tun(const char *dev, const char *dev_type, int topology, const char *ifconfig_local_parm, const char *ifconfig_remote_netmask_parm, const char *ifconfig_ipv6_local_parm, int ifconfig_ipv6_netbits_parm, const char *ifconfig_ipv6_remote_parm, struct addrinfo *local_public, struct addrinfo *remote_public, const bool strict_warn, struct env_set *es)
Definition: tun.c:631
bool register_dns
Definition: tun.h:107
void tun_show_debug(struct tuntap *tt)
Definition: tun.c:6019
int netbits_ipv6
Definition: tun.h:158
int dev_type_enum(const char *dev, const char *dev_type)
Definition: tun.c:247
Definition: tun.h:131
static bool tuntap_abort(int status)
Definition: tun.h:422
in_addr_t ntp[N_DHCP_ADDR]
Definition: tun.h:94
void open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
Definition: tun.c:5498
struct overlapped_io writes
Definition: tun.h:163
int netbios_node_type
Definition: tun.h:80
#define ROUTE_ORDER_DEFAULT
Definition: tun.h:320
void check_subnet_conflict(const in_addr_t ip, const in_addr_t netmask, const char *prefix)
Definition: tun.c:432
Packet geometry parameters.
Definition: mtu.h:93
ULONG ipapi_context
Definition: tun.h:169
int ntp_len
Definition: tun.h:95
const char * netbios_scope
Definition: tun.h:78
#define IFCONFIG_BEFORE_TUN_OPEN
Definition: tun.h:291
in_addr_t nbdd[N_DHCP_ADDR]
Definition: tun.h:98
void tun_standby_init(struct tuntap *tt)
Definition: tun.c:5251
int tap_sleep
Definition: tun.h:70
#define IFCONFIG_DEFAULT
Definition: tun.h:294
bool dhcp_masq_custom_offset
Definition: tun.h:65
in_addr_t remote_netmask
Definition: tun.h:153
int read_tun(struct tuntap *tt, uint8_t *buf, int len)
bool dhcp_renew
Definition: tun.h:104
void do_ifconfig_setenv(const struct tuntap *tt, struct env_set *es)
Definition: tun.c:585
static bool overlapped_io_active(struct overlapped_io *o)
Definition: win32.h:221
HANDLE hand
Definition: tun.h:161
void show_adapters(int msglev)
Definition: tun.c:4621
#define in_addr_t
Definition: config-msvc.h:103
int txqueuelen
Definition: tun.h:149
static void dummy(void)
Definition: comp-lz4.c:319
void fork_register_dns_action(struct tuntap *tt)
Definition: tun.c:5450
static int ifconfig_order(void)
Definition: tun.h:297
const char * guid
Definition: tun.h:339
const char * tun_stat(const struct tuntap *tt, unsigned int rwflags, struct gc_arena *gc)
Definition: tun.c:524
bool ip_win32_defined
Definition: tun.h:50
static bool tuntap_defined(const struct tuntap *tt)
Definition: tun.h:198
static unsigned int tun_set(struct tuntap *tt, struct event_set *es, unsigned int rwflags, void *arg, unsigned int *persistent)
Definition: tun.h:513
void ipconfig_register_dns(const struct env_set *es)
Definition: tun.c:4875
#define openvpn_errno()
Definition: error.h:74
int write_tun(struct tuntap *tt, uint8_t *buf, int len)
bool is_ip_in_adapter_subnet(const IP_ADAPTER_INFO *ai, const in_addr_t ip, in_addr_t *highest_netmask)
Definition: tun.c:4291
static void frame_add_to_extra_tun(struct frame *frame, const int increment)
Definition: mtu.h:280
const IP_ADAPTER_INFO * get_tun_adapter(const struct tuntap *tt, const IP_ADAPTER_INFO *list)
Definition: tun.c:4233
const IP_ADAPTER_INFO * get_adapter_info_list(struct gc_arena *gc)
Definition: tun.c:4015
int standby_iter
Definition: tun.h:177
int tun_read_queue(struct tuntap *tt, int maxsize)
Definition: tun.c:3229
bool dhcp_renew_by_adapter_index(const DWORD adapter_index)
Definition: tun.c:4811
bool is_dev_type(const char *dev, const char *dev_type, const char *match_type)
Definition: tun.c:229
in_addr_t local
Definition: tun.h:152
struct panel_reg * next
Definition: tun.h:347
#define IFCONFIG_AFTER_TUN_OPEN
Definition: tun.h:292
bool did_ifconfig_setup
Definition: tun.h:139
int type
Definition: tun.h:134
static int write_tun_buffered(struct tuntap *tt, struct buffer *buf)
Definition: tun.h:466
static event_t tun_event_handle(const struct tuntap *tt)
Definition: tun.h:503
#define ROUTE_BEFORE_TUN
Definition: tun.h:318
const char * name
Definition: tun.h:345
void init_tun_post(struct tuntap *tt, const struct frame *frame, const struct tuntap_options *options)
Definition: tun.c:793
void tuncfg(const char *dev, const char *dev_type, const char *dev_node, int persist_mode, const char *username, const char *groupname, const struct tuntap_options *options)
in_addr_t broadcast
Definition: tun.h:154
const IP_ADAPTER_INFO * get_adapter_info(DWORD index, struct gc_arena *gc)
Definition: tun.c:4148
int dns6_len
Definition: tun.h:110
static SERVICE_STATUS status
Definition: automatic.c:47
const IP_PER_ADAPTER_INFO * get_per_adapter_info(const DWORD index, struct gc_arena *gc)
Definition: tun.c:4042
const IP_ADAPTER_INFO * get_adapter(const IP_ADAPTER_INFO *ai, DWORD index)
Definition: tun.c:4129
static void event_ctl(struct event_set *es, event_t event, unsigned int rwflags, void *arg)
Definition: event.h:119
int wins_len
Definition: tun.h:91
int ip_win32_type
Definition: tun.h:58
struct rw_handle rw_handle
Definition: tun.h:164
bool is_adapter_up(const struct tuntap *tt, const IP_ADAPTER_INFO *list)
Definition: tun.c:4246
void tap_allow_nonadmin_access(const char *dev_node)
Definition: tun.c:4670
in_addr_t wins[N_DHCP_ADDR]
Definition: tun.h:90
static int route_order(void)
Definition: tun.h:323
bool persistent_if
Definition: tun.h:142
static int read_tun_buffered(struct tuntap *tt, struct buffer *buf, int maxsize)
Definition: tun.h:460
DWORD adapter_index
Definition: tun.h:175
const char * tap_win_getinfo(const struct tuntap *tt, struct gc_arena *gc)
Definition: tun.c:6001
const char * domain
Definition: tun.h:76
struct overlapped_io reads
Definition: tun.h:162
void verify_255_255_255_252(in_addr_t local, in_addr_t remote)
Definition: tun.c:3683
int tun_finalize(HANDLE h, struct overlapped_io *io, struct buffer *buf)
Definition: tun.c:3356
#define EVENT_READ
Definition: event.h:36
#define BLEN(buf)
Definition: buffer.h:127
ULONG ipapi_instance
Definition: tun.h:170
HANDLE msg_channel
Definition: tun.h:61
bool did_ifconfig_ipv6_setup
Definition: tun.h:140
struct tap_reg * next
Definition: tun.h:340
unsigned __int8 uint8_t
Definition: config-msvc.h:122
int post_open_mtu
Definition: tun.h:194
DWORD adapter_index_of_ip(const IP_ADAPTER_INFO *list, const in_addr_t ip, int *count, in_addr_t *netmask)
Definition: tun.c:4324
Definition: tun.h:343
const char * ipset2ascii_all(struct gc_arena *gc)
Definition: tun.c:6186
const char * ipset2ascii(int index)
Definition: tun.c:6172
const char * ifconfig_options_string(const struct tuntap *tt, bool remote, bool disable, struct gc_arena *gc)
Definition: tun.c:486
struct in6_addr dns6[N_DHCP_ADDR]
Definition: tun.h:109
int dhcp_masq_offset
Definition: tun.h:66
int nbdd_len
Definition: tun.h:99
int topology
Definition: tun.h:137
static void tun_adjust_frame_parameters(struct frame *frame, int size)
Definition: tun.h:281
static int tun_write_win32(struct tuntap *tt, struct buffer *buf)
Definition: tun.h:435
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
int dns_len
Definition: tun.h:87
bool disable_nbt
Definition: tun.h:102
void do_ifconfig(struct tuntap *tt, const char *ifname, int tun_mtu, const struct env_set *es)
do_ifconfig - configure the tunnel interface
Definition: tun.c:1416
#define N_DHCP_ADDR
Definition: tun.h:82
const char * guid
Definition: tun.h:346
int tun_write_queue(struct tuntap *tt, struct buffer *buf)
Definition: tun.c:3293
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
void show_tap_win_adapters(int msglev, int warnlev)
Definition: tun.c:3753
void close_tun(struct tuntap *tt)
Definition: tun.c:6037
void show_valid_win32_tun_subnets(void)
Definition: tun.c:3720
bool tun_standby(struct tuntap *tt)
Definition: tun.c:5257
bool dhcp_pre_release
Definition: tun.h:105
in_addr_t adapter_netmask
Definition: tun.h:171
bool dhcp_release_by_adapter_index(const DWORD adapter_index)
Definition: tun.c:4771
char * actual_name
Definition: tun.h:146
void warn_on_use_of_common_subnets(void)
Definition: tun.c:463
const char * guess_tuntap_dev(const char *dev, const char *dev_type, const char *dev_node, struct gc_arena *gc)
Definition: tun.c:291
static bool tuntap_stop(int status)
Definition: tun.h:408
const char * dev_type_string(const char *dev, const char *dev_type)
Definition: tun.c:268
bool ipapi_context_defined
Definition: tun.h:168
Definition: tun.h:337
bool is_tun_p2p(const struct tuntap *tt)
Definition: tun.c:559
unsigned int rwflags_debug
Definition: tun.h:190
int ascii2ipset(const char *name)
Definition: tun.c:6157
in_addr_t dns[N_DHCP_ADDR]
Definition: tun.h:86
int dhcp_lease_time
Definition: tun.h:67
bool dhcp_options
Definition: tun.h:74