36 |
#include <netinet/in_systm.h> |
#include <netinet/in_systm.h> |
37 |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
38 |
|
|
39 |
|
#include "gettext.h" |
40 |
|
#include "log.h" |
41 |
#include "tun/tun.h" |
#include "tun/tun.h" |
42 |
#include "options.h" |
#include "options.h" |
43 |
|
|
78 |
ioctl (tun_fd, TUNSIFHEAD, &i); |
ioctl (tun_fd, TUNSIFHEAD, &i); |
79 |
} |
} |
80 |
|
|
81 |
if(!tun_ready ()) |
if (!tun_ready ()) |
82 |
{ |
{ |
83 |
if (PARAM_INTERFACE_NAME) |
if (PARAM_INTERFACE_NAME) |
84 |
{ |
{ |
85 |
log(LOG_ERR, "Unable to open tun device /dev/%s: %s(%d).\n", |
log (LOG_ERR, gettext ("Unable to open tun device /dev/%s: %s(%d).\n"), |
86 |
PARAM_INTERFACE_NAME, strerror(errno), errno); |
PARAM_INTERFACE_NAME, strerror (errno), errno); |
87 |
} |
} |
88 |
else |
else |
89 |
{ |
{ |
90 |
log(LOG_ERR, "Unable to open a valid tun device.\n"); |
log (LOG_ERR, gettext ("Unable to open a valid tun device.\n")); |
91 |
} |
} |
92 |
return 0; |
return 0; |
93 |
} |
} |
94 |
|
|
95 |
return 1; |
return 1; |
96 |
} |
} |
97 |
|
|