40 |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
41 |
|
|
42 |
#include "options.h" |
#include "options.h" |
43 |
|
#include "log.h" |
44 |
#include "tun/tun.h" |
#include "tun/tun.h" |
45 |
|
|
46 |
extern int tun_fd; |
extern int tun_fd; |
69 |
} |
} |
70 |
} |
} |
71 |
} |
} |
72 |
return tun_ready (); |
|
73 |
|
if(!tun_ready ()) |
74 |
|
{ |
75 |
|
if (PARAM_INTERFACE_NAME) |
76 |
|
{ |
77 |
|
log(LOG_ERR, "Unable to open tun device /dev/%s: %s(%d).\n", |
78 |
|
PARAM_INTERFACE_NAME, strerror(errno), errno); |
79 |
|
} |
80 |
|
else |
81 |
|
{ |
82 |
|
log(LOG_ERR, "Unable to open a valid tun device.\n"); |
83 |
|
} |
84 |
|
return 0; |
85 |
|
} |
86 |
|
|
87 |
|
return 1; |
88 |
} |
} |
89 |
|
|
90 |
int |
int |