29#ifdef ENABLE_MANAGEMENT
53#define MANAGEMENT_ECHO_PULL_INFO 0
55#if MANAGEMENT_ECHO_PULL_INFO
56#define MANAGEMENT_ECHO_FLAGS LOG_PRINT_INTVAL
58#define MANAGEMENT_ECHO_FLAGS 0
76 msg(
M_CLIENT,
"auth-retry t : Auth failure retry mode (none,interact,nointeract).");
77 msg(
M_CLIENT,
"bytecount n : Show bytes in/out, update every n secs (0=off).");
78 msg(
M_CLIENT,
"echo [on|off] [N|all] : Like log, but only show messages in echo buffer.");
80 "cr-response response : Send a challenge response answer via CR_RESPONSE to server");
81 msg(
M_CLIENT,
"exit|quit : Close management session.");
82 msg(
M_CLIENT,
"forget-passwords : Forget passwords entered so far.");
84 msg(
M_CLIENT,
"hold [on|off|release] : Set/show hold flag to on/off state, or");
85 msg(
M_CLIENT,
" release current hold and start tunnel.");
86 msg(
M_CLIENT,
"kill cn : Kill the client instance(s) having common name cn.");
87 msg(
M_CLIENT,
"kill IP:port : Kill the client instance connecting from IP:port.");
88 msg(
M_CLIENT,
"load-stats : Show global server load stats.");
89 msg(
M_CLIENT,
"log [on|off] [N|all] : Turn on/off realtime log display");
90 msg(
M_CLIENT,
" + show last N lines or 'all' for entire history.");
92 "mute [n] : Set log mute level to n, or show level if n is absent.");
93 msg(
M_CLIENT,
"needok type action : Enter confirmation for NEED-OK request of 'type',");
95 msg(
M_CLIENT,
"needstr type action : Enter confirmation for NEED-STR request of 'type',");
97 msg(
M_CLIENT,
"net : (Windows only) Show network info and routing table.");
98 msg(
M_CLIENT,
"password type p : Enter password p for a queried OpenVPN password.");
99 msg(
M_CLIENT,
"remote type [host port] : Override remote directive, type=ACCEPT|MOD|SKIP.");
100 msg(
M_CLIENT,
"remote-entry-count : Get number of available remote entries.");
101 msg(
M_CLIENT,
"remote-entry-get i|all [j]: Get remote entry at index = i to to j-1 or all.");
102 msg(
M_CLIENT,
"proxy type [host port flags] : Enter dynamic proxy server info.");
103 msg(
M_CLIENT,
"pid : Show process ID of the current OpenVPN process.");
105 msg(
M_CLIENT,
"pkcs11-id-count : Get number of available PKCS#11 identities.");
106 msg(
M_CLIENT,
"pkcs11-id-get index : Get PKCS#11 identity at index.");
108 msg(
M_CLIENT,
"client-auth CID KID : Authenticate client-id/key-id CID/KID (MULTILINE)");
109 msg(
M_CLIENT,
"client-auth-nt CID KID : Authenticate client-id/key-id CID/KID");
111 "client-deny CID KID R [CR] : Deny auth client-id/key-id CID/KID with log reason");
112 msg(
M_CLIENT,
" text R and optional client reason text CR");
114 "client-pending-auth CID KID MSG timeout : Instruct OpenVPN to send AUTH_PENDING and INFO_PRE msg");
116 " to the client and wait for a final client-auth/client-deny");
117 msg(
M_CLIENT,
"client-kill CID [M] : Kill client instance CID with message M (def=RESTART)");
118 msg(
M_CLIENT,
"env-filter [level] : Set env-var filter level");
119 msg(
M_CLIENT,
"rsa-sig : Enter a signature in response to >RSA_SIGN challenge");
121 " Enter signature base64 on subsequent lines followed by END");
122 msg(
M_CLIENT,
"pk-sig : Enter a signature in response to >PK_SIGN challenge");
124 " Enter signature base64 on subsequent lines followed by END");
126 "certificate : Enter a client certificate in response to >NEED-CERT challenge");
128 " Enter certificate base64 on subsequent lines followed by END");
129 msg(
M_CLIENT,
"signal s : Send signal s to daemon,");
130 msg(
M_CLIENT,
" s = SIGHUP|SIGTERM|SIGUSR1|SIGUSR2.");
131 msg(
M_CLIENT,
"state [on|off] [N|all] : Like log, but show state history.");
132 msg(
M_CLIENT,
"status [n] : Show current daemon status info using format #n.");
133 msg(
M_CLIENT,
"test n : Produce n lines of output for testing/debugging.");
134 msg(
M_CLIENT,
"username type u : Enter username u for a queried OpenVPN username.");
135 msg(
M_CLIENT,
"verb [n] : Set log verbosity level to n, or show if n is absent.");
136 msg(
M_CLIENT,
"version [n] : Set client's version to n or show current version of daemon.");
137 msg(
M_CLIENT,
"push-update-broad options : Broadcast a message to update the specified options.");
138 msg(
M_CLIENT,
" Ex. push-update-broad \"route something, -dns\"");
139 msg(
M_CLIENT,
"push-update-cid CID options : Send an update message to the client identified by CID.");
173 return "RECONNECTING";
182 return "TCP_CONNECT";
185 return "AUTH_PENDING";
195 msg(
M_CLIENT,
">INFO:OpenVPN Management Interface Version %d -- type 'help' for more info",
209#if defined(__GNUC__) || defined(__clang__)
210#pragma GCC diagnostic push
211#pragma GCC diagnostic ignored "-Wconversion"
236 msg(
M_WARN,
"MAN: client connection rejected after %d failed password attempts",
244#if defined(__GNUC__) || defined(__clang__)
245#pragma GCC diagnostic pop
272 volatile int signal_received = 0;
319 msg(
M_CLIENT,
"SUCCESS: %s command succeeded", command);
323 msg(
M_CLIENT,
"ERROR: %s command failed", command);
333 socket_delete_unix(&man->
settings.local_unix);
358 static int recursive_level = 0;
360#define AF_DID_PUSH (1 << 0)
361#define AF_DID_RESET (1 << 1)
362 if (recursive_level < 5)
366 const char *out = NULL;
367 unsigned int action_flags = 0;
432 printf(
"virtual_output: message to management interface "
433 "dropped due to recursion: <%s>\n",
460 if (s == SIGHUP || s == SIGUSR1)
482 msg(
M_CLIENT,
"ERROR: signal '%s' is currently ignored", name);
491 msg(
M_CLIENT,
"ERROR: signal '%s' is not a known signal type", name);
498 msg(
M_CLIENT,
"ERROR: The '%s' command is not supported by the current daemon mode",
525 if (update_seconds > 0)
557 msg(
M_CLIENT,
"SUCCESS: bytecount interval changed");
610 const int port =
atoi(
p3);
615 if ((port > 0 && port < 65536) && (proto !=
PROTO_NONE))
617 n_killed = (*
man->persist.callback.kill_by_addr)(
man->persist.callback.arg,
627 msg(
M_CLIENT,
"ERROR: client at address %s:%s:%d not found",
634 msg(
M_CLIENT,
"ERROR: port number or protocol out of range: %s %s",
p3,
p1);
645 n_killed = (*
man->persist.callback.kill_by_cn)(
man->persist.callback.arg,
p1);
679 if (
streq(parm,
"on"))
682 msg(
M_CLIENT,
"SUCCESS: real-time %s notification set to ON", type);
684 else if (
streq(parm,
"off"))
687 msg(
M_CLIENT,
"SUCCESS: real-time %s notification set to OFF", type);
689 else if (
streq(parm,
"all") || (n = atoi(parm)) > 0)
692 const int start = (n ? n : size) - 1;
695 for (
i = start;
i >= 0; --
i)
708 msg(
M_CLIENT,
"ERROR: %s parameter must be 'on' or 'off' or some number n or 'all'", type);
767 const char *prompt,
char *dest,
int len)
776 msg(
M_CLIENT,
"SUCCESS: '%s' %s entered, but not yet verified", type, prompt);
780 msg(
M_CLIENT,
"ERROR: %s of type '%s' entered, but we need one of type '%s'", prompt,
786 msg(
M_CLIENT,
"ERROR: no %s is currently needed at this time", prompt);
836 msg(
M_CLIENT,
"SUCCESS: Passwords were forgotten");
858 message, parameters);
878 msg(
M_CLIENT,
">PKCS11ID-COUNT:%d", pkcs11_management_id_count());
882man_pkcs11_id_get(
struct management *man,
const int index)
887 if (pkcs11_management_id_get(index, &
id, &base64))
889 msg(
M_CLIENT,
">PKCS11ID-ENTRY:'%d', ID:'%s', BLOB:'%s'", index,
id, base64);
927 unsigned int from = (
unsigned int)atoi(p1);
928 unsigned int to = p2 ? (
unsigned int)atoi(p2) : from + 1;
930 if (!strcmp(p1,
"all"))
936 for (
unsigned int i = from;
i <
min_uint(to, count);
i++)
960 if (
streq(cmd,
"on"))
965 else if (
streq(cmd,
"off"))
970 else if (
streq(cmd,
"release"))
977 msg(
M_CLIENT,
"ERROR: bad hold command parameter");
1052 if (sscanf(str,
"%lu", cid) == 1)
1066 if (sscanf(str,
"%u", uint) == 1)
1090 const char *extra,
const char *timeout_str)
1092 unsigned long cid = 0;
1093 unsigned int kid = 0;
1094 unsigned int timeout = 0;
1096 &&
parse_uint(timeout_str,
"TIMEOUT", &timeout))
1101 kid, extra, timeout);
1105 msg(
M_CLIENT,
"SUCCESS: client-pending-auth command succeeded");
1109 msg(
M_CLIENT,
"ERROR: client-pending-auth command failed."
1110 " Extra parameter might be too long");
1139 const char *reason,
const char *client_reason)
1141 unsigned long cid = 0;
1142 unsigned int kid = 0;
1151 msg(
M_CLIENT,
"SUCCESS: client-deny command succeeded");
1155 msg(
M_CLIENT,
"ERROR: client-deny command failed");
1168 unsigned long cid = 0;
1177 msg(
M_CLIENT,
"SUCCESS: client-kill command succeeded");
1181 msg(
M_CLIENT,
"ERROR: client-kill command failed");
1209 msg(
M_CLIENT,
"SUCCESS: env_filter_level=%d", level);
1225 msg(
M_CLIENT,
"ERROR: The %s command is not currently available", cmd_name);
1241 msg(
M_CLIENT,
"ERROR: The certificate command is not currently available");
1260#define MN_AT_LEAST (1 << 0)
1276 for (
i = 1;
i <= n; ++
i)
1280 msg(
M_CLIENT,
"ERROR: the '%s' command requires %s%d parameter%s", p[0],
1281 (flags &
MN_AT_LEAST) ?
"at least " :
"", n, n > 1 ?
"s" :
"");
1316#ifdef TARGET_ANDROID
1318man_network_change(
struct management *man,
bool samenetwork)
1329 msg(
M_CLIENT,
"PROTECTFD: fd '%d' sent to be protected", fd);
1370 unsigned long cid = 0;
1374 msg(
M_CLIENT,
"ERROR: push-update-cid fail during cid parsing");
1383 msg(
M_CLIENT,
"SUCCESS: push-update command succeeded");
1386 msg(
M_CLIENT,
"ERROR: push-update command failed");
1396 if (
streq(p[0],
"exit") ||
streq(p[0],
"quit"))
1401 else if (
streq(p[0],
"help"))
1405 else if (
streq(p[0],
"version") && p[1])
1409 else if (
streq(p[0],
"version"))
1415 else if (
streq(p[0],
"pid"))
1419 else if (
streq(p[0],
"nclients"))
1423 else if (
streq(p[0],
"env-filter"))
1432 else if (
streq(p[0],
"signal"))
1439#ifdef TARGET_ANDROID
1440 else if (
streq(p[0],
"network-change"))
1442 bool samenetwork =
false;
1443 if (p[1] &&
streq(p[1],
"samenetwork"))
1448 man_network_change(man, samenetwork);
1451 else if (
streq(p[0],
"load-stats"))
1455 else if (
streq(p[0],
"status"))
1460 version = atoi(p[1]);
1464 else if (
streq(p[0],
"kill"))
1471 else if (
streq(p[0],
"verb"))
1475 const int level = atoi(p[1]);
1482 msg(
M_CLIENT,
"ERROR: verb level is out of range");
1490 else if (
streq(p[0],
"mute"))
1494 const int level = atoi(p[1]);
1501 msg(
M_CLIENT,
"ERROR: mute level is out of range");
1509 else if (
streq(p[0],
"auth-retry"))
1515 msg(
M_CLIENT,
"SUCCESS: auth-retry parameter changed");
1527 else if (
streq(p[0],
"state"))
1545 else if (
streq(p[0],
"log"))
1559 else if (
streq(p[0],
"echo"))
1573 else if (
streq(p[0],
"username"))
1580 else if (
streq(p[0],
"password"))
1587 else if (
streq(p[0],
"forget-passwords"))
1591 else if (
streq(p[0],
"needok"))
1598 else if (
streq(p[0],
"needstr"))
1605 else if (
streq(p[0],
"cr-response"))
1612 else if (
streq(p[0],
"net"))
1616 else if (
streq(p[0],
"hold"))
1620 else if (
streq(p[0],
"bytecount"))
1627 else if (
streq(p[0],
"client-kill"))
1634 else if (
streq(p[0],
"client-deny"))
1641 else if (
streq(p[0],
"client-auth-nt"))
1648 else if (
streq(p[0],
"client-auth"))
1655 else if (
streq(p[0],
"client-pending-auth"))
1662 else if (
streq(p[0],
"rsa-sig"))
1666 else if (
streq(p[0],
"pk-sig"))
1670 else if (
streq(p[0],
"certificate"))
1675 else if (
streq(p[0],
"pkcs11-id-count"))
1677 man_pkcs11_id_count(man);
1679 else if (
streq(p[0],
"pkcs11-id-get"))
1683 man_pkcs11_id_get(man, atoi(p[1]));
1687 else if (
streq(p[0],
"remote-entry-count"))
1691 else if (
streq(p[0],
"remote-entry-get"))
1698 else if (
streq(p[0],
"proxy"))
1705 else if (
streq(p[0],
"remote"))
1712 else if (
streq(p[0],
"push-update-broad"))
1719 else if (
streq(p[0],
"push-update-cid"))
1727 else if (
streq(p[0],
"test"))
1732 const int n = atoi(p[1]);
1733 for (
i = 0;
i < n; ++
i)
1736 "[%d] The purpose of this command is to generate large amounts of output.",
i);
1743 msg(
M_CLIENT,
"ERROR: unknown command [%s], enter 'help' for more options", p[0]);
1806#if UNIX_SOCK_SUPPORT
1810 sockaddr_unix_name(&man->
settings.local_unix,
"NULL"));
1821 struct sockaddr_storage addr;
1822 socklen_t addrlen =
sizeof(addr);
1823 if (!getpeername(man->
connection.
sd_cli, (
struct sockaddr *)&addr, &addrlen))
1846#if UNIX_SOCK_SUPPORT
1852 static const char err_prefix[] =
1853 "MANAGEMENT: unix domain socket client connection rejected --";
1860 "%s UID of socket peer (%d) doesn't match required value (%d) as given by --management-client-user",
1867 "%s GID of socket peer (%d) doesn't match required value (%d) as given by --management-client-group",
1874 msg(
D_MANAGEMENT,
"%s cannot get UID/GID of socket peer", err_prefix);
1891#if UNIX_SOCK_SUPPORT
1894 struct sockaddr_un remote;
1938#if UNIX_SOCK_SUPPORT
1950 "MANAGEMENT",
false);
1958 msg(
M_ERR,
"MANAGEMENT: listen() failed");
1966#if UNIX_SOCK_SUPPORT
1970 sockaddr_unix_name(&man->
settings.local_unix,
"NULL"));
1975 const struct sockaddr *man_addr = man->
settings.
local->ai_addr;
1976 struct sockaddr_storage addr;
1977 socklen_t addrlen =
sizeof(addr);
1978 if (!getsockname(man->
connection.
sd_top, (
struct sockaddr *)&addr, &addrlen))
1980 man_addr = (
struct sockaddr *)&addr;
2003 int signal_received = 0;
2011#if UNIX_SOCK_SUPPORT
2034 if (signal_received)
2042#if UNIX_SOCK_SUPPORT
2046 sockaddr_unix_name(&man->
settings.local_unix,
"NULL"));
2130 if (parms[0] &&
streq(parms[0],
"password"))
2134 else if (!
streq(line,
"load-stats"))
2143 for (
i = 0;
i < nparms; ++
i)
2164 bool crt_error =
false;
2170 msg(
D_MANAGEMENT,
"MANAGEMENT: TCP %s error: %s", prefix, strerror(err));
2180#ifdef TARGET_ANDROID
2182man_send_with_fd(
int fd,
void *ptr,
size_t nbytes,
int flags,
int sendfd)
2184 struct msghdr
msg = { 0 };
2185 struct iovec iov[1];
2190 char control[CMSG_SPACE(
sizeof(
int))];
2192 struct cmsghdr *cmptr;
2194 msg.msg_control = control_un.control;
2195 msg.msg_controllen =
sizeof(control_un.control);
2197 cmptr = CMSG_FIRSTHDR(&
msg);
2198 cmptr->cmsg_len = CMSG_LEN(
sizeof(
int));
2199 cmptr->cmsg_level = SOL_SOCKET;
2200 cmptr->cmsg_type = SCM_RIGHTS;
2201 *((
int *)CMSG_DATA(cmptr)) = sendfd;
2203 msg.msg_name = NULL;
2204 msg.msg_namelen = 0;
2206 iov[0].iov_base = ptr;
2207 iov[0].iov_len = nbytes;
2211 return (sendmsg(fd, &
msg, flags));
2215man_recv_with_fd(
int fd,
void *ptr,
size_t nbytes,
int flags,
int *recvfd)
2217 struct msghdr msghdr = { 0 };
2218 struct iovec iov[1];
2224 char control[CMSG_SPACE(
sizeof(
int))];
2226 struct cmsghdr *cmptr;
2228 msghdr.msg_control = control_un.control;
2229 msghdr.msg_controllen =
sizeof(control_un.control);
2231 msghdr.msg_name = NULL;
2232 msghdr.msg_namelen = 0;
2234 iov[0].iov_base = ptr;
2235 iov[0].iov_len = nbytes;
2236 msghdr.msg_iov = iov;
2237 msghdr.msg_iovlen = 1;
2239 if ((n = recvmsg(fd, &msghdr, flags)) <= 0)
2244 if ((cmptr = CMSG_FIRSTHDR(&msghdr)) != NULL && cmptr->cmsg_len == CMSG_LEN(
sizeof(
int)))
2246 if (cmptr->cmsg_level != SOL_SOCKET)
2248 msg(
M_ERR,
"control level != SOL_SOCKET");
2250 if (cmptr->cmsg_type != SCM_RIGHTS)
2252 msg(
M_ERR,
"control type != SCM_RIGHTS");
2254 *recvfd = *((
int *)CMSG_DATA(cmptr));
2268management_android_control(
struct management *man,
const char *command,
const char *
msg)
2272 msg(
M_FATAL,
"Required management interface not available.");
2276 strncpy(up.username,
msg,
sizeof(up.username) - 1);
2279 return strcmp(
"ok", up.password) == 0;
2289managment_android_persisttun_action(
struct management *man)
2293 strcpy(up.username,
"tunmethod");
2296 if (!strcmp(
"NOACTION", up.password))
2298 return ANDROID_KEEP_OLD_TUN;
2300 else if (!strcmp(
"OPEN_BEFORE_CLOSE", up.password))
2302 return ANDROID_OPEN_BEFORE_CLOSE;
2306 msg(
M_ERR,
"Got unrecognised '%s' from management for PERSIST_TUN_ACTION query",
2311 return ANDROID_OPEN_BEFORE_CLOSE;
2317#if defined(__GNUC__) || defined(__clang__)
2318#pragma GCC diagnostic push
2319#pragma GCC diagnostic ignored "-Wconversion"
2328 unsigned char buf[256];
2331#ifdef TARGET_ANDROID
2348 bool processed_command =
false;
2350 ASSERT(len <= (
int)
sizeof(buf));
2367 if (!strcmp(line,
"END"))
2385 processed_command =
true;
2399 if (processed_command)
2419 const int size_hint = 1024;
2421 const struct buffer *buf;
2425 if (buf &&
BLEN(buf))
2428#ifdef TARGET_ANDROID
2429 if (
man->connection.fdtosend > 0)
2432 man->connection.fdtosend);
2433 man->connection.fdtosend = -1;
2459#if defined(__GNUC__) || defined(__clang__)
2460#pragma GCC diagnostic pop
2478 const int state_buffer_size)
2536 const char *pass_file,
const char *client_user,
const char *client_group,
2537 const int log_history_cache,
const int echo_buffer_size,
2538 const int state_buffer_size,
const int remap_sigusr1,
const unsigned int flags)
2576#if UNIX_SOCK_SUPPORT
2579 sockaddr_unix_init(&ms->local_unix, addr);
2618 if (remap_sigusr1 == SIGHUP)
2622 else if (remap_sigusr1 == SIGTERM)
2636 freeaddrinfo(ms->
local);
2732 const char *client_user,
const char *client_group,
const int log_history_cache,
2733 const int echo_buffer_size,
const int state_buffer_size,
const int remap_sigusr1,
2734 const unsigned int flags)
2743 log_history_cache, echo_buffer_size, state_buffer_size, remap_sigusr1, flags);
2797 const in_addr_t *tun_local_ip,
const struct in6_addr *tun_local_ip6,
2805 const char *out = NULL;
2852 static const char *env_names[] = {
"username=",
2858 "ifconfig_netmask=",
2859 "daemon_start_time=",
2862 "ifconfig_pool_remote_ip=",
2863 "ifconfig_pool_netmask=",
2870 if (env_filter_level == 0)
2874 else if (env_filter_level <= 1 && !strncmp(env_str,
"X509_", 5))
2878 else if (env_filter_level <= 2)
2881 for (
i = 0;
i <
SIZE(env_names); ++
i)
2883 const char *en = env_names[
i];
2884 const size_t len = strlen(en);
2885 if (!strncmp(env_str, en, len))
2943 msg(
M_CLIENT,
">NOTIFY:%s,%s,%s", severity, type, text);
2958 const char *peer_info =
2973 msg(
D_MANAGEMENT,
"validation failed on peer_info line received from client");
2986 const char *mode =
"CONNECT";
3004 const struct env_set *
es,
const char *response)
3011 msg(
M_CLIENT,
">CLIENT:CR_RESPONSE,%lu,%u,%s", mdac->
cid, mda_key_id, response);
3046 const struct mroute_addr *addr,
const bool primary)
3064 const char *out = NULL;
3103 char buf[INET_ADDRSTRLEN];
3105 ia.s_addr = htonl(tun_local_ip);
3106 inet_ntop(AF_INET, &ia, buf,
sizeof(buf));
3128 msg(
M_CLIENT,
">PASSWORD:Verification Failed: '%s' ['%s']", type, reason);
3132 msg(
M_CLIENT,
">PASSWORD:Verification Failed: '%s'", type);
3147 if (*persistent == (
unsigned int)n)
3160 unsigned int *persistent)
3205 if (net_events & FD_CLOSE)
3213 if (net_events & FD_ACCEPT)
3222 if (net_events & FD_READ)
3230 if (net_events & FD_WRITE)
3234 if (
status < 0 && WSAGetLastError() == WSAEWOULDBLOCK)
3248 unsigned int *persistent)
3317 if (signal_received)
3320 if (*signal_received)
3368 else if (expire &&
now >= expire)
3372 if (signal_received)
3374 *signal_received = SIGINT;
3402 if (signal_received && *signal_received)
3415 const time_t expire)
3429#define MWCC_PASSWORD_WAIT (1 << 0)
3430#define MWCC_HOLD_WAIT (1 << 1)
3431#define MWCC_OTHER_WAIT (1 << 2)
3438 const time_t expire,
unsigned int flags)
3445 msg(
D_MANAGEMENT,
"Need password(s) from management interface, waiting...");
3449 msg(
D_MANAGEMENT,
"Need hold release from management interface, waiting...");
3453 msg(
D_MANAGEMENT,
"Need information from management interface, waiting...");
3458 if (signal_received && *signal_received)
3474 volatile int signal_received = 0;
3490 if (signal_received)
3499 if (!signal_received)
3503 if (signal_received)
3508 }
while (expire && expire >
now);
3524 const unsigned int flags,
const char *static_challenge)
3531 volatile int signal_received = 0;
3535 const char *prefix =
NULL;
3536 unsigned int up_query_mode = 0;
3540 man->persist.standalone_disabled =
false;
3541 man->persist.special_state_msg =
NULL;
3554 prefix =
"NEED-STR";
3560 prefix =
"PASSWORD";
3566 prefix =
"PASSWORD";
3589 if (signal_received)
3600 man->connection.up_query_mode = up_query_mode;
3601 man->connection.up_query_type = type;
3607 if (!signal_received)
3611 if (signal_received)
3616 }
while (!
man->connection.up_query.defined);
3621 man->connection.up_query_type =
NULL;
3623 man->persist.special_state_msg =
NULL;
3628 CLEAR(
man->connection.up_query.password);
3638 man->connection.up_query.nocache = up->
nocache;
3639 *up =
man->connection.up_query;
3654 volatile int signal_received = 0;
3669 alert_msg =
alloc_buf_gc(strlen(b64_data) + strlen(prompt) + 3, &
gc);
3670 buf_printf(&alert_msg,
">%s:%s", prompt, b64_data);
3680 if (signal_received)
3692 if (!signal_received)
3696 if (signal_received)
3708 msg(
M_CLIENT,
"SUCCESS: %s command succeeded", cmd);
3728 const char *prompt,
const char *cmd,
int *
state,
3732 char *result = NULL;
3740 if (buf &&
BLEN(buf) > 0)
3769 if (buf &&
BLEN(buf) > 0)
3788 const char *prompt =
"PK_SIGN";
3789 const char *
desc =
"pk-sign";
3792 if (
man->connection.client_version <= 1)
3794 prompt =
"RSA_SIGN";
3799 if (
man->connection.client_version > 2)
3805 &
man->connection.ext_key_state,
3806 &
man->connection.ext_key_input);
3814 const char prompt_1[] =
"NEED-CERTIFICATE:";
3845 volatile int signal_received = 0;
3856 if (!signal_received)
3860 man->persist.special_state_msg =
BSTR(&out);
3867 if (!signal_received)
3871 if (signal_received)
3875 }
while (!
man->persist.hold_release);
3880 man->persist.special_state_msg =
NULL;
3926 for (
size_t i = 0;
i < len; ++
i)
3941 const char *ret = NULL;
3987 buf_printf(&out,
"%u,", (
unsigned int)
e->timestamp);
4041 free((
char *)
e->string);
4136 if (index >= 0 && index < h->size)
4201 struct timeval null;
bool buffer_list_defined(const struct buffer_list *ol)
Checks if the list is valid and non-empty.
void buffer_list_advance(struct buffer_list *ol, int n)
void free_buf(struct buffer *buf)
void buffer_list_aggregate_separator(struct buffer_list *bl, const size_t max_len, const char *sep)
Aggregates as many buffers as possible from bl in a new buffer of maximum length max_len .
void buf_clear(struct buffer *buf)
void buffer_list_reset(struct buffer_list *ol)
Empty the list ol and frees all the contained buffers.
void buffer_list_aggregate(struct buffer_list *bl, const size_t max)
Aggregates as many buffers as possible from bl in a new buffer of maximum length max_len .
bool buf_printf(struct buffer *buf, const char *format,...)
struct buffer_list * buffer_list_new(void)
Allocate an empty buffer list of capacity max_size.
struct buffer * buffer_list_peek(struct buffer_list *ol)
Retrieve the head buffer.
void buffer_list_free(struct buffer_list *ol)
Frees a buffer list and all the buffers in it.
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
struct buffer alloc_buf(size_t size)
bool buf_parse(struct buffer *buf, const int delim, char *line, const int size)
char * string_alloc(const char *str, struct gc_arena *gc)
void buffer_list_push(struct buffer_list *ol, const char *str)
Allocates and appends a new buffer containing str as data to ol.
void buf_chomp(struct buffer *buf)
bool char_class(const unsigned char c, const unsigned int flags)
int buf_substring_len(const struct buffer *buf, int delim)
static uint8_t * buf_bptr(const struct buffer *buf)
#define ALLOC_OBJ(dptr, type)
static struct buffer clear_buf(void)
Return an empty struct buffer.
static bool buf_copy(struct buffer *dest, const struct buffer *src)
#define ALLOC_ARRAY_CLEAR(dptr, type, n)
static bool buf_copy_excess(struct buffer *dest, struct buffer *src, int len)
#define CC_NEWLINE
newline
static int buf_len(const struct buffer *buf)
static void buf_set_read(struct buffer *buf, const uint8_t *data, size_t size)
static void secure_memzero(void *data, size_t len)
Securely zeroise memory.
static bool buf_write(struct buffer *dest, const void *src, size_t size)
static bool buf_write_u8(struct buffer *dest, uint8_t data)
static void strncpynt(char *dest, const char *src, size_t maxlen)
static void check_malloc_return(void *p)
static void gc_free(struct gc_arena *a)
#define CC_PRINT
printable (>= 32, != 127)
#define ALLOC_OBJ_CLEAR(dptr, type)
static struct gc_arena gc_new(void)
int memcmp_constant_time(const void *a, const void *b, size_t size)
As memcmp(), but constant-time.
static int dco_get_peer_stats_multi(dco_context_t *dco, const bool raise_sigusr1_on_err)
static int dco_get_peer_stats(struct context *c, const bool raise_sigusr1_on_err)
void setenv_int(struct env_set *es, const char *name, int value)
struct env_set * env_set_create(struct gc_arena *gc)
#define D_MANAGEMENT_DEBUG
struct event_set * event_set_init(int *maxevents, unsigned int flags)
#define EVENT_METHOD_FAST
static void event_free(struct event_set *es)
static int event_wait(struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
static void event_reset(struct event_set *es)
static void event_ctl(struct event_set *es, event_t event, unsigned int rwflags, void *arg)
void set_nonblock(socket_descriptor_t fd)
counter_type link_write_bytes_global
counter_type link_read_bytes_global
void reset_coarse_timers(struct context *c)
static unsigned int min_uint(unsigned int x, unsigned int y)
static int min_int(int x, int y)
static int modulo_add(int x, int y, int mod)
static SERVICE_STATUS status
bool event_timeout_trigger(struct event_timeout *et, struct timeval *tv, const int et_const_retry)
This is the principal function for testing and triggering recurring timers.
static void event_timeout_init(struct event_timeout *et, interval_t n, const time_t last)
Initialises a timer struct.
static void event_timeout_clear(struct event_timeout *et)
Clears the timeout and reset all values to 0.
void hash_iterator_free(struct hash_iterator *hi)
struct hash_element * hash_iterator_next(struct hash_iterator *hi)
void hash_iterator_init(struct hash *hash, struct hash_iterator *hi)
void management_pre_tunnel_close(struct management *man)
void management_auth_failure(struct management *man, const char *type, const char *reason)
void log_history_close(struct log_history *h)
struct management * management
static void man_status(struct management *man, const int version, struct status_output *so)
static void man_up_finalize(struct management *man)
static bool man_io_error(struct management *man, const char *prefix)
static void man_log(struct management *man, const char *parm)
static void man_reset_client_socket(struct management *man, const bool exiting)
static void man_bytecount(struct management *man, const int update_seconds)
void management_notify_client_close(struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
static void man_connect(struct management *man)
static int man_write(struct management *man)
void management_check_bytecount_server(struct multi_context *multi)
static bool man_check_for_signals(volatile int *signal_received)
static void man_bytecount_output_server(const counter_type bytes_in_total, const counter_type bytes_out_total, struct man_def_auth_context *mdac)
static void man_output_list_push(struct management *man, const char *str)
void management_socket_set(struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
void command_line_free(struct command_line *cl)
static int man_block(struct management *man, volatile int *signal_received, const time_t expire)
static void man_certificate(struct management *man)
void command_line_next(struct command_line *cl)
static void man_net(struct management *man)
void management_clear_callback(struct management *man)
static void man_persist_init(struct management *man, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size)
char * management_query_cert(struct management *man, const char *cert_name)
struct command_line * command_line_new(const size_t buf_len)
static bool man_standalone_ok(const struct management *man)
bool management_hold(struct management *man, int holdtime)
static void man_settings_init(struct man_settings *ms, const char *addr, const char *port, const char *pass_file, const char *client_user, const char *client_group, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size, const int remap_sigusr1, const unsigned int flags)
static int log_index(const struct log_history *h, int i)
static void man_connection_clear(struct man_connection *mc)
static void man_start_ne32(struct management *man)
static void man_connection_settings_reset(struct management *man)
static void man_help(void)
static void man_update_io_state(struct management *man)
static void man_bytecount_stop(struct management *man)
static void man_check_password(struct management *man, const char *line)
static bool man_persist_state(unsigned int *persistent, const int n)
static bool man_need(struct management *man, const char **p, const int n, unsigned int flags)
Checks if the correct number of arguments to a management command are present and otherwise prints an...
static void man_connection_init(struct management *man)
static bool env_filter_match(const char *env_str, const int env_filter_level)
static void man_client_pending_auth(struct management *man, const char *cid_str, const char *kid_str, const char *extra, const char *timeout_str)
Will send a notification to the client that succesful authentication will require an additional step ...
static void man_connection_close(struct management *man)
static void man_query_password(struct management *man, const char *type, const char *string)
static void man_client_kill(struct management *man, const char *cid_str, const char *kill_msg)
struct log_history * log_history_init(const int capacity)
static void man_listen(struct management *man)
static void man_stop_ne32(struct management *man)
static void man_query_username(struct management *man, const char *type, const char *string)
static void man_push_update(struct management *man, const char **p, const push_update_type type)
#define MWCC_PASSWORD_WAIT
static void man_dispatch_command(struct management *man, struct status_output *so, const char **p, const int nparms)
static void virtual_output_callback_func(void *arg, const unsigned int flags, const char *str)
static void man_signal(struct management *man, const char *name)
static void man_prompt(struct management *man)
static void man_state(struct management *man, const char *parm)
static void man_client_deny(struct management *man, const char *cid_str, const char *kid_str, const char *reason, const char *client_reason)
static void man_echo(struct management *man, const char *parm)
void management_learn_addr(struct management *management, struct man_def_auth_context *mdac, const struct mroute_addr *addr, const bool primary)
static char * management_query_multiline_flatten(struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
static void man_proxy(struct management *man, const char **p)
struct management * management_init(void)
static void in_extra_reset(struct man_connection *mc, const int mode)
void command_line_reset(struct command_line *cl)
static void man_query_need_str(struct management *man, const char *type, const char *action)
bool management_would_hold(struct management *man)
static int man_read(struct management *man)
static void man_history(struct management *man, const char *parm, const char *type, struct log_history *log, bool *realtime, const unsigned int lep_flags)
bool management_query_user_pass(struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
static void man_bytecount_output_client(counter_type bytes_in_total, counter_type bytes_out_total)
void log_history_add(struct log_history *h, const struct log_entry *le)
static void log_entry_free_contents(struct log_entry *e)
static int man_mod_signal(const struct management *man, const int signum)
void management_event_loop_n_seconds(struct management *man, int sec)
static void man_persist_close(struct man_persist *mp)
static void man_kill(struct management *man, const char *victim)
void management_close(struct management *man)
static void man_pk_sig(struct management *man, const char *cmd_name)
void management_set_state(struct management *man, const int state, const char *detail, const in_addr_t *tun_local_ip, const struct in6_addr *tun_local_ip6, const struct openvpn_sockaddr *local, const struct openvpn_sockaddr *remote)
static void man_output_list_push_finalize(struct management *man)
static void man_load_stats(struct management *man)
static bool man_password_needed(struct management *man)
static void set_client_version(struct management *man, const char *version)
const char * log_entry_print(const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
void management_auth_token(struct management *man, const char *token)
static void man_accept(struct management *man)
static void man_client_auth(struct management *man, const char *cid_str, const char *kid_str, const bool extra)
static bool parse_cid(const char *str, unsigned long *cid)
static void man_send_cc_message(struct management *man, const char *message, const char *parameters)
static void man_delete_unix_socket(struct management *man)
void management_io(struct management *man)
static void man_wait_for_client_connection(struct management *man, volatile int *signal_received, const time_t expire, unsigned int flags)
static void man_output_peer_info_env(struct management *man, const struct man_def_auth_context *mdac)
bool management_open(struct management *man, const char *addr, const char *port, const char *pass_file, const char *client_user, const char *client_group, const int log_history_cache, const int echo_buffer_size, const int state_buffer_size, const int remap_sigusr1, const unsigned int flags)
static void man_welcome(struct management *man)
void management_notify_generic(struct management *man, const char *str)
void management_connection_established(struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
static void man_query_need_ok(struct management *man, const char *type, const char *action)
static char * management_query_multiline_flatten_newline(struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
static void man_output_extra_env(struct management *man, const char *prefix)
void man_persist_client_stats(struct management *man, struct context *c)
static void man_new_connection_post(struct management *man, const char *description)
static void log_history_obj_init(struct log_history *h, int capacity)
static void report_command_status(const bool status, const char *command)
Small function to report the success or failure of a command to the management interface.
static void man_close_socket(struct management *man, const socket_descriptor_t sd)
static bool parse_uint(const char *str, const char *what, unsigned int *uint)
void management_set_callback(struct management *man, const struct management_callback *cb)
void management_notify_client_needing_auth(struct management *management, const unsigned int mda_key_id, struct man_def_auth_context *mdac, const struct env_set *es)
static void man_client_n_clients(struct management *man)
static void man_output_standalone(struct management *man, volatile int *signal_received)
void management_notify_client_cr_response(unsigned mda_key_id, const struct man_def_auth_context *mdac, const struct env_set *es, const char *response)
void management_echo(struct management *man, const char *string, const bool pull)
static const char blank_up[]
static void man_remote_entry_get(struct management *man, const char *p1, const char *p2)
const struct log_entry * log_history_ref(const struct log_history *h, const int index)
static void man_remote_entry_count(struct management *man)
static void man_settings_close(struct man_settings *ms)
void management_check_bytecount_client(struct context *c, struct management *man, struct timeval *timeval)
static void man_env_filter(struct management *man, const int level)
#define MANAGEMENT_ECHO_FLAGS
static void man_output_list_push_str(struct management *man, const char *str)
void management_up_down(struct management *man, const char *updown, const struct env_set *es)
char * management_query_pk_sig(struct management *man, const char *b64_data, const char *algorithm)
static void man_remote(struct management *man, const char **p)
static void man_forget_passwords(struct management *man)
void command_line_add(struct command_line *cl, const unsigned char *buf, const size_t len)
static int man_standalone_event_loop(struct management *man, volatile int *signal_received, const time_t expire)
static void man_process_command(struct management *man, const char *line)
static int management_query_multiline(struct management *man, const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
static void man_output_env(const struct env_set *es, const bool tail, const int env_filter_level, const char *prefix)
const char * command_line_get(struct command_line *cl)
static void log_history_free_contents(struct log_history *h)
void management_sleep(const int n)
A sleep function that services the management layer for n seconds rather than doing nothing.
static const char * man_state_name(const int state)
void log_history_resize(struct log_history *h, const int capacity)
static void in_extra_dispatch(struct management *man)
static void man_command_unsupported(const char *command_name)
void management_notify(struct management *man, const char *severity, const char *type, const char *text)
void management_post_tunnel_open(struct management *man, const in_addr_t tun_local_ip)
static void man_query_user_pass(struct management *man, const char *type, const char *string, const bool needed, const char *prompt, char *dest, int len)
static void man_hold(struct management *man, const char *cmd)
#define MANSIG_MAP_USR1_TO_TERM
#define OPENVPN_STATE_ADD_ROUTES
#define UP_QUERY_USER_PASS
#define OPENVPN_STATE_INITIAL
#define MF_FORGET_DISCONNECT
#define UP_QUERY_DISABLED
#define MANAGEMENT_STATE_BUFFER_SIZE
#define MANAGEMENT_VERSION
#define OPENVPN_STATE_CONNECTING
#define LOG_PRINT_REMOTE_IP
#define LOG_PRINT_STATE_PREFIX
#define OPENVPN_STATE_RECONNECTING
#define LOG_PRINT_INT_DATE
#define MANSIG_MAP_USR1_TO_HUP
#define LOG_PRINT_ECHO_PREFIX
#define LOG_PRINT_LOCAL_IP
#define MANAGEMENT_ECHO_BUFFER_SIZE
#define DAF_CONNECTION_CLOSED
#define OPENVPN_STATE_CLIENT_BASE
#define OPENVPN_STATE_CONNECTED
#define OPENVPN_STATE_RESOLVE
#define UP_QUERY_NEED_STR
#define OPENVPN_STATE_EXITING
static bool management_connected(const struct management *man)
#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE
#define OPENVPN_STATE_AUTH_PENDING
static int log_history_size(const struct log_history *h)
#define MANSIG_IGNORE_USR1_HUP
#define OPENVPN_STATE_AUTH
#define LOG_PRINT_LOG_PREFIX
#define OPENVPN_STATE_WAIT
#define DAF_CONNECTION_ESTABLISHED
#define OPENVPN_STATE_ASSIGN_IP
#define MANAGEMENT_N_PASSWORD_RETRIES
#define OPENVPN_STATE_GET_CONFIG
#define MF_CONNECT_AS_CLIENT
#define OPENVPN_STATE_TCP_CONNECT
#define LOG_PRINT_MSG_FLAGS
bool validate_peer_info_line(char *line)
#define GET_USER_PASS_STATIC_CHALLENGE_CONCAT
indicates password and response should be concatenated
#define GET_USER_PASS_PASSWORD_ONLY
#define GET_USER_PASS_STATIC_CHALLENGE_ECHO
SCRV1 protocol – echo response.
#define GET_USER_PASS_NEED_OK
static bool get_user_pass(struct user_pass *up, const char *auth_file, const char *prefix, const unsigned int flags)
Retrieves the user credentials from various sources depending on the flags.
#define GET_USER_PASS_NEED_STR
const char * mroute_addr_print_ex(const struct mroute_addr *ma, const unsigned int flags, struct gc_arena *gc)
Header file for server-mode related structures and functions.
msglvl_t get_debug_level(void)
bool set_mute_cutoff(const int cutoff)
int get_mute_cutoff(void)
bool set_debug_level(const int level, const unsigned int flags)
const char * msg_flags_string(const msglvl_t flags, struct gc_arena *gc)
static void msg_set_virtual_output(const struct virtual_output *vo)
static bool ignore_sys_error(const int err, bool crt_error)
static int openvpn_errno_maybe_crt(bool *crt_error)
int parse_line(const char *line, char *p[], const int n, const char *file, const int line_num, msglvl_t msglevel, struct gc_arena *gc)
const char * auth_retry_print(void)
const char title_string[]
bool auth_retry_set(const msglvl_t msglevel, const char *option)
static bool dco_enabled(const struct options *o)
Returns whether the current configuration has dco enabled.
static void update_time(void)
void throw_signal_soft(const int signum, const char *signal_text)
Throw a soft global signal.
const char * signal_name(const int sig, const bool upper)
void throw_signal(const int signum)
Throw a hard signal.
int parse_signal(const char *signame)
static void get_signal(volatile int *sig)
Copy the global signal_received (if non-zero) to the passed-in argument sig.
void sd_close(socket_descriptor_t *sd)
socket_descriptor_t socket_do_accept(socket_descriptor_t sd, struct link_socket_actual *act, const bool nowait)
int openvpn_connect(socket_descriptor_t sd, const struct sockaddr *remote, int connect_timeout, volatile int *signal_received)
void socket_bind(socket_descriptor_t sd, struct addrinfo *local, int ai_family, const char *prefix, bool ipv6only)
socket_descriptor_t create_socket_tcp(struct addrinfo *addrinfo)
in_addr_t getaddr(unsigned int flags, const char *hostname, int resolve_retry_seconds, bool *succeeded, struct signal_info *sig_info)
Translate an IPv4 addr or hostname from string form to in_addr_t.
#define openvpn_close_socket(s)
const char * proto2ascii(int proto, sa_family_t af, bool display_form)
int openvpn_getaddrinfo(unsigned int flags, const char *hostname, const char *servname, int resolve_retry_seconds, struct signal_info *sig_info, int ai_family, struct addrinfo **res)
const char * print_sockaddr_ex(const struct sockaddr *sa, const char *separator, const unsigned int flags, struct gc_arena *gc)
const char * print_in6_addr(struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
const char * print_in_addr_t(in_addr_t addr, unsigned int flags, struct gc_arena *gc)
#define IA_EMPTY_IF_UNDEF
static const char * print_sockaddr(const struct sockaddr *addr, struct gc_arena *gc)
#define GETADDR_MSG_VIRT_OUT
#define GETADDR_HOST_ORDER
static bool addr_defined(const struct openvpn_sockaddr *addr)
#define PS_DONT_SHOW_FAMILY
#define GETADDR_WARN_ON_SIGNAL
void ssl_purge_auth(const bool auth_user_pass_only)
bool ssl_clean_auth_token(void)
Control Channel SSL/Data channel negotiation module.
struct status_output * status_open(const char *filename, const int refresh_freq, const int msglevel, const struct virtual_output *vout, const unsigned int flags)
bool status_close(struct status_output *so)
Wrapper structure for dynamically allocated memory.
int capacity
Size in bytes of memory allocated by malloc().
uint8_t * data
Pointer to the allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
struct tuntap * tuntap
Tun/tap virtual network interface.
Level 2 context containing state that is reset on both SIGHUP and SIGUSR1 restarts.
counter_type link_read_bytes
counter_type link_write_bytes
counter_type dco_read_bytes
struct man_def_auth_context mda_context
counter_type dco_write_bytes
Contains all state information for one tunnel.
struct context_2 c2
Level 2 context.
struct options options
Options loaded from command line or configuration file.
struct context_1 c1
Level 1 context.
Garbage collection arena used to keep track of dynamically allocated memory.
struct openvpn_sockaddr dest
struct in6_addr local_ip6
struct openvpn_sockaddr local_sock
struct openvpn_sockaddr remote_sock
unsigned long in_extra_cid
const char * up_query_type
struct user_pass up_query
socket_descriptor_t sd_top
struct buffer_list * ext_cert_input
unsigned int in_extra_kid
struct openvpn_sockaddr remote
socket_descriptor_t sd_cli
struct buffer_list * ext_key_input
int bytecount_update_seconds
struct buffer_list * in_extra
struct event_timeout bytecount_update_interval
struct net_event_win32 ne32
struct log_history * state
struct management_callback callback
struct virtual_output vout
struct log_history * echo
const char * special_state_msg
bool management_over_tunnel
char *(* get_peer_info)(void *arg, const unsigned long cid)
bool(* client_auth)(void *arg, const unsigned long cid, const unsigned int mda_key_id, const bool auth, const char *reason, const char *client_reason, struct buffer_list *cc_config)
void(* delete_event)(void *arg, event_t event)
bool(* push_update_broadcast)(void *arg, const char *options)
bool(* push_update_by_cid)(void *arg, unsigned long cid, const char *options)
int(* kill_by_addr)(void *arg, const in_addr_t addr, const int port, const int proto)
bool(* client_pending_auth)(void *arg, const unsigned long cid, const unsigned int kid, const char *extra, unsigned int timeout)
int(* n_clients)(void *arg)
void(* status)(void *arg, const int version, struct status_output *so)
bool(* remote_entry_get)(void *arg, unsigned int index, char **remote)
unsigned int(* remote_entry_count)(void *arg)
bool(* send_cc_message)(void *arg, const char *message, const char *parameter)
bool(* proxy_cmd)(void *arg, const char **p)
void(* show_net)(void *arg, const msglvl_t msglevel)
bool(* remote_cmd)(void *arg, const char **p)
int(* kill_by_cn)(void *arg, const char *common_name)
bool(* kill_by_cid)(void *arg, const unsigned long cid, const char *kill_msg)
struct man_persist persist
struct man_connection connection
struct man_settings settings
Main OpenVPN server state structure.
struct hash * hash
VPN tunnel instances indexed by real address of the remote peer.
struct context top
Storage structure for process-wide configuration.
Server-mode state structure for one single VPN tunnel.
struct context context
The context structure storing state for this VPN tunnel.
char password[USER_PASS_LEN]
char username[USER_PASS_LEN]
unsigned int flags_default
void(* func)(void *arg, const unsigned int flags, const char *str)
SOCKET socket_descriptor_t
static int socket_defined(const socket_descriptor_t sd)
void net_event_win32_init(struct net_event_win32 *ne)
void net_event_win32_close(struct net_event_win32 *ne)
void net_event_win32_reset_write(struct net_event_win32 *ne)
void net_event_win32_start(struct net_event_win32 *ne, long network_events, socket_descriptor_t sd)
void win32_sleep(const int n)
void net_event_win32_reset(struct net_event_win32 *ne)
void net_event_win32_stop(struct net_event_win32 *ne)
static long net_event_win32_get_event_mask(const struct net_event_win32 *ne)
static void net_event_win32_clear_selected_events(struct net_event_win32 *ne, long selected_events)
static struct rw_handle * net_event_win32_get_event(struct net_event_win32 *ne)