OpenVPN
mudp.c
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-2026 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, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include "syshead.h"
28
29#include "multi.h"
30#include <inttypes.h>
31#include "forward.h"
32#include "multi_io.h"
33
34#include "memdbg.h"
35#include "ssl_pkt.h"
36#include "sid_hash.h"
37
38#ifdef HAVE_SYS_INOTIFY_H
39#include <sys/inotify.h>
40#endif
41
57static void
58send_standalone_reply(struct multi_context *m, const struct buffer *buf,
59 const char *prefix, const char *detail,
60 struct link_socket *sock)
61{
62 struct context *c = &m->top;
63
64 /* dco-win server requires prepend with sockaddr, so preserve offset */
66 buf_copy(&c->c2.buffers->aux_buf, buf);
67
68 msg_set_prefix(prefix);
69 c->c2.to_link = c->c2.buffers->aux_buf;
70 c->c2.to_link_addr = &c->c2.from;
71 msg(D_MULTI_DEBUG, "%s", detail);
72 process_outgoing_link(c, sock);
73 c->c2.to_link.len = 0;
74 c->c2.to_link_addr = NULL;
75 msg_set_prefix(NULL);
76}
77
78static void
80 const struct tls_auth_standalone *tas, const struct session_id *sid,
81 bool request_resend_wkc, struct link_socket *sock)
82{
85 uint8_t header = 0 | (P_CONTROL_HARD_RESET_SERVER_V2 << P_OPCODE_SHIFT);
86 struct buffer buf = tls_reset_standalone(&state->tls_wrap_tmp, tas, sid,
87 &state->peer_session_id, header, request_resend_wkc);
88
89 send_standalone_reply(m, &buf, "Connection Attempt",
90 "Reset packet from client, sending HMAC based reset challenge", sock);
91}
92
112
114static enum pre_decrypt_verdict
116 struct mroute_addr addr, struct link_socket *sock)
117{
118 ASSERT(m->top.c2.tls_auth_standalone);
119
121
122 const struct tls_auth_standalone *tas = m->top.c2.tls_auth_standalone;
123
124 verdict = tls_pre_decrypt_lite(tas, state, &m->top.c2.from, &m->top.c2.buf);
125
126 const uint8_t *hmac_key = m->top.c2.session_id_key;
127 const struct openvpn_sockaddr *from = &m->top.c2.from.dest;
128 int handwindow = m->top.options.handshake_window;
129
130 if (verdict == VERDICT_VALID_RESET_V3 || verdict == VERDICT_VALID_RESET_V2)
131 {
132 /* Check if we are still below our limit for sending out
133 * responses */
135 {
137 }
138 }
139
140 if (verdict == VERDICT_VALID_RESET_V3)
141 {
142 /* Extract the packet id to check if it has the special format that
143 * indicates early negotiation support */
144 struct packet_id_net pin;
145 struct buffer tmp = m->top.c2.buf;
147 ASSERT(packet_id_read(&pin, &tmp, true));
148
149 /* The most significant byte is 0x0f if early negotiation is supported */
151
152 /* All clients that support early negotiation and tls-crypt are assumed
153 * to also support resending the WKc in the 2nd packet */
155 {
156 /* Calculate the session ID HMAC for our reply and create reset packet */
157 struct session_id sid =
158 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
159 send_hmac_reset_packet(m, state, tas, &sid, true, sock);
160
162 }
163 else
164 {
165 /* For tls-crypt-v2 we need to keep the state of the first packet
166 * to store the unwrapped key if the client doesn't support resending
167 * the wrapped key. Unless the user specifically disallowed
168 * compatibility with such clients to avoid state exhaustion */
170 {
171 struct gc_arena gc = gc_new();
172 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
174 "tls-crypt-v2 force-cookie is enabled, "
175 "ignoring connection attempt from old client (%s)",
176 peer);
177 gc_free(&gc);
179 }
180 else
181 {
183 }
184 }
185 }
186 else if (verdict == VERDICT_VALID_RESET_V2)
187 {
188 /* Calculate the session ID HMAC for our reply and create reset packet */
189 struct session_id sid =
190 calculate_session_id_hmac(state->peer_session_id, from, hmac_key, handwindow, 0);
191
192 send_hmac_reset_packet(m, state, tas, &sid, false, sock);
193
194 /* We have a reply do not create a new session */
196 }
197 else if (verdict == VERDICT_VALID_CONTROL_V1 || verdict == VERDICT_VALID_ACK_V1
198 || verdict == VERDICT_VALID_WKC_V1)
199 {
200 /* ACK_V1 contains the peer id (our id) while CONTROL_V1 can but does not
201 * need to contain the peer id */
202 struct gc_arena gc = gc_new();
203
204 bool pkt_is_ack = (verdict == VERDICT_VALID_ACK_V1);
205 bool ret = check_session_hmac_and_pkt_id(state, from, hmac_key, handwindow, pkt_is_ack);
207
208 const char *peer = print_link_socket_actual(&m->top.c2.from, &gc);
209 uint8_t pkt_firstbyte = *BPTR(&m->top.c2.buf);
210 int op = pkt_firstbyte >> P_OPCODE_SHIFT;
211
212 if (!ret)
213 {
214 msg(D_MULTI_MEDIUM, "Packet (%s) with invalid or missing SID from"
215 " %s or wrong packet id",
216 packet_opcode_name(op), peer);
217 }
218 else
219 {
221 "Valid packet (%s) with HMAC challenge from peer (%s), "
222 "accepting new connection.",
223 packet_opcode_name(op), peer);
225 }
226 gc_free(&gc);
227
228 return action;
229 }
230
231 /* VERDICT_INVALID */
233}
234
242static struct multi_instance *
244 struct link_socket *sock,
245 const struct mroute_addr *real)
246{
247 struct gc_arena gc = gc_new();
248
250 {
252 "MULTI: Connection attempt from %s ignored while server is "
253 "shutting down",
254 mroute_addr_print(real, &gc));
255 gc_free(&gc);
256 return NULL;
257 }
258
259 struct tls_pre_decrypt_state state = { 0 };
260 struct multi_instance *mi = NULL;
261
262 enum pre_decrypt_verdict verdict = do_pre_decrypt_check(m, &state, *real, sock);
263
264 if (verdict != PRE_DECRYPT_NO_ACTION)
265 {
266 /* This is an unknown session but with valid tls-auth/tls-crypt
267 * (or no auth at all). If this is the initial packet of a
268 * session, we just send a reply with a HMAC session id and
269 * do not generate a session slot */
270
272 {
273 /* a successful three-way handshake only counts against
274 * connect-freq but not against connect-freq-initial */
276
277 mi = multi_create_instance(m, real, sock);
278 if (mi)
279 {
281
282 struct tls_session *session =
284
285 if (verdict == PRE_DECRYPT_CREATE_SESSION_SKIP)
286 {
290 }
291 multi_hash_sid_add(m, &state.peer_session_id, mi);
292 }
293 }
294 else
295 {
297 "MULTI: Connection from %s would exceed new connection frequency limit as controlled by --connect-freq",
298 mroute_addr_print(real, &gc));
299 }
300 }
302 gc_free(&gc);
303 return mi;
304}
305
312static struct multi_instance *
314{
315 struct hash *hash = m->hash;
316 const uint64_t hv = hash_value(hash, real);
317 struct hash_bucket *bucket = hash_bucket(hash, hv);
318 const struct hash_element *he = hash_lookup_fast(hash, bucket, real, hv);
319 if (he)
320 {
321 return he->value;
322 }
323 return NULL;
324}
325
326
327static struct multi_instance *
329{
330 /* Copy buffer, to a tmp buffer, so that reading the session does not
331 * modify the internal pointers */
332 struct buffer tmp = m->top.c2.buf;
333
334 ASSERT(buf_len(&tmp) >= (int)(1 + SID_SIZE));
335
336 /* op code */
337 buf_advance(&tmp, 1);
338
339 struct session_id sid = { 0 };
340 session_id_read(&sid, &tmp);
341
342 const struct hash_element *he_sid = multi_hash_sid_lookup(m, &sid);
343
344 if (he_sid)
345 {
346 return he_sid->value;
347 }
348
349 return NULL;
350}
351
357struct multi_instance *
359 const struct mroute_addr *real,
360 const struct link_socket *sock)
361{
362 struct multi_instance *mi = NULL;
363
364 const uint8_t *ptr = BPTR(&m->top.c2.buf);
365 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
366 bool v2 = (op == P_DATA_V2) && (m->top.c2.buf.len >= (1 + 3));
367 bool peer_id_disabled = false;
368
369 /* make sure buffer has enough length to read opcode (1 byte) and peer-id (3 bytes) */
370 if (v2)
371 {
372 uint32_t peer_id = ((uint32_t)ptr[1] << 16) | ((uint32_t)ptr[2] << 8) | ((uint32_t)ptr[3]);
373 peer_id_disabled = (peer_id == MAX_PEER_ID);
374
375 if (!peer_id_disabled && (peer_id < m->max_clients) && (m->instances[peer_id]))
376 {
377 /* Floating on TCP will never be possible, so ensure we only process
378 * UDP clients */
379 if (m->instances[peer_id]->context.c2.link_sockets[0]->info.proto
380 == sock->info.proto)
381 {
382 mi = m->instances[peer_id];
383 *floated = !link_socket_actual_match(&mi->context.c2.from, &m->top.c2.from);
384
385 if (*floated)
386 {
387 /* reset prefix, since here we are not sure peer is the one it claims to be
388 */
390 struct gc_arena gc = gc_new();
391 msg(D_MULTI_MEDIUM, "Float requested for peer %" PRIu32 " to %s", peer_id,
392 mroute_addr_print(real, &gc));
393 gc_free(&gc);
394 }
395 return mi;
396 }
397 }
398 }
399 if (!v2 || peer_id_disabled)
400 {
401 return multi_get_instance_udp_real(m, real);
402 }
403 return NULL;
404}
405
406struct multi_instance *
407multi_get_create_instance_udp(struct multi_context *m, bool *floated, struct link_socket *sock)
408{
409 /* If the buffer is empty, the packet has no op code and can be neither
410 * a (valid) data nor control packet */
411 if (m->top.c2.buf.len <= 0)
412 {
413 return NULL;
414 }
415
416 const uint8_t *ptr = BPTR(&m->top.c2.buf);
417 uint8_t op = ptr[0] >> P_OPCODE_SHIFT;
418
419 struct mroute_addr real = { 0 };
420 real.proto = sock->info.proto;
421
422 if (!mroute_extract_openvpn_sockaddr(&real, &m->top.c2.from.dest, true))
423 {
424 return NULL;
425 }
426
427 struct multi_instance *mi = NULL;
428 if (op == P_DATA_V1 || op == P_DATA_V2)
429 {
430 mi = multi_get_instance_udp_data(m, floated, &real, sock);
431 }
432 else
433 {
434 if (m->top.c2.buf.len < (int)SID_SIZE + 1)
435 {
436 /* control packets must be at least the opcode byte + session id
437 * (8 byte) long, otherwise they are not valid packets */
438 return NULL;
439 }
440
442
443 /* we have no existing multi instance for this connection, control
444 * packets can create a session. Data packets cannot */
445 if (!mi)
446 {
447 mi = handle_connection_attempt(m, sock, &real);
448 }
449 }
450
451#ifndef ENABLE_SMALL
453 {
454 struct gc_arena gc = gc_new();
455 const char *status = mi ? "[ok]" : "[failed]";
456
457 dmsg(D_MULTI_DEBUG, "GET INST BY REAL/SID: %s %s", mroute_addr_print(&real, &gc), status);
458 gc_free(&gc);
459 }
460#endif
461
462 ASSERT(!(mi && mi->halt));
463 return mi;
464}
465
466/*
467 * Send a packet to UDP socket.
468 */
469static inline void
470multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
471{
472 if (m->pending)
473 {
474 multi_io_send_link(m, m->pending, mpp_flags);
475 }
476}
477
478/*
479 * Process a UDP socket event.
480 */
481void
482multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
483{
484 const unsigned int mpp_flags = (MPP_PRE_SELECT | MPP_CLOSE_ON_SIGNAL);
485
486 /* UDP port ready to accept write */
487 if (rwflags & SOCKET_WRITE)
488 {
489 multi_process_outgoing_link(m, mpp_flags);
490 }
491 /* Incoming data on UDP port */
492 else if (rwflags & SOCKET_READ)
493 {
494 read_incoming_link(&m->top, sock);
495 if (!IS_SIG(&m->top))
496 {
497 multi_process_incoming_link(m, NULL, mpp_flags, sock);
498 }
499 }
500}
static bool buf_copy(struct buffer *dest, const struct buffer *src)
Copy the content of one buffer to the end of another.
Definition buffer.h:1342
#define BPTR(buf)
Return a pointer to the start of the buffer content.
Definition buffer.h:139
static int buf_len(const struct buffer *buf)
Return the length of the buffer content.
Definition buffer.h:462
static bool buf_advance(struct buffer *buf, ssize_t size)
Advance the content start of a buffer, consuming bytes from the front.
Definition buffer.h:1165
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
Definition buffer.h:1965
#define buf_init(buf, offset)
Definition buffer.h:364
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
Definition buffer.h:1949
#define CO_FORCE_TLSCRYPTV2_COOKIE
Bit-flag indicating that we do not allow clients that do not support resending the wrapped client key...
Definition crypto.h:367
#define D_MULTI_ERRORS
Definition errlevel.h:64
#define D_MULTI_MEDIUM
Definition errlevel.h:101
#define D_MULTI_DEBUG
Definition errlevel.h:126
#define SOCKET_READ
Definition event.h:60
#define SOCKET_WRITE
Definition event.h:61
Interface functions to the internal and external multiplexers.
#define TM_INITIAL
As yet un-trusted tls_session \ being negotiated.
Definition ssl_common.h:553
enum first_packet_verdict tls_pre_decrypt_lite(const struct tls_auth_standalone *tas, struct tls_pre_decrypt_state *state, const struct link_socket_actual *from, const struct buffer *buf)
Inspect an incoming packet for which no VPN tunnel is active, and determine whether a new VPN tunnel ...
Definition ssl_pkt.c:296
bool multi_process_incoming_link(struct multi_context *m, struct multi_instance *instance, const unsigned int mpp_flags, struct link_socket *sock)
Demultiplex and process a packet received over the external network interface.
Definition multi.c:3564
void process_outgoing_link(struct context *c, struct link_socket *sock)
Write a packet to the external network interface.
Definition forward.c:1774
void read_incoming_link(struct context *c, struct link_socket *sock)
Read a packet from the external network interface.
Definition forward.c:954
struct multi_instance * multi_get_create_instance_udp(struct multi_context *m, bool *floated, struct link_socket *sock)
Get, and if necessary create, the multi_instance associated with a packet's source address.
Definition mudp.c:407
static SERVICE_STATUS status
Definition interactive.c:52
struct hash_element * hash_lookup_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv)
Definition list.c:81
static uint64_t hash_value(const struct hash *hash, const void *key)
Definition list.h:107
bool mroute_extract_openvpn_sockaddr(struct mroute_addr *addr, const struct openvpn_sockaddr *osaddr, bool use_port)
Definition mroute.c:255
const char * mroute_addr_print(const struct mroute_addr *ma, struct gc_arena *gc)
Definition mroute.c:372
static enum pre_decrypt_verdict do_pre_decrypt_check(struct multi_context *m, struct tls_pre_decrypt_state *state, struct mroute_addr addr, struct link_socket *sock)
Returns a verdict if this packet should create a new session.
Definition mudp.c:115
static void send_hmac_reset_packet(struct multi_context *m, struct tls_pre_decrypt_state *state, const struct tls_auth_standalone *tas, const struct session_id *sid, bool request_resend_wkc, struct link_socket *sock)
Definition mudp.c:79
static void send_standalone_reply(struct multi_context *m, const struct buffer *buf, const char *prefix, const char *detail, struct link_socket *sock)
Send an already-built standalone control packet back to the peer that just contacted us (c2....
Definition mudp.c:58
struct multi_instance * multi_get_instance_udp_data(struct multi_context *m, bool *floated, const struct mroute_addr *real, const struct link_socket *sock)
Get a client instance based on real address.
Definition mudp.c:358
static struct multi_instance * handle_connection_attempt(struct multi_context *m, struct link_socket *sock, const struct mroute_addr *real)
Handles a packet if no existing session exists for this incoming packet.
Definition mudp.c:243
static struct multi_instance * multi_get_instance_udp_real(struct multi_context *m, const struct mroute_addr *real)
Looks up an multi instance by its real address (IP and port)
Definition mudp.c:313
pre_decrypt_verdict
Verdict if this packet should create a new session.
Definition mudp.c:99
@ PRE_DECRYPT_CREATE_SESSION_SKIP
Creates a new session.
Definition mudp.c:110
@ PRE_DECRYPT_CREATE_SESSION
This packet creates a new session on the first packet on the session.
Definition mudp.c:106
@ PRE_DECRYPT_NO_ACTION
This packet should not create a new session.
Definition mudp.c:101
static void multi_process_outgoing_link(struct multi_context *m, const unsigned int mpp_flags)
Definition mudp.c:470
void multi_process_io_udp(struct multi_context *m, struct link_socket *sock, unsigned int rwflags)
Definition mudp.c:482
static struct multi_instance * multi_get_instance_udp_control(struct multi_context *m)
Definition mudp.c:328
struct multi_instance * multi_create_instance(struct multi_context *m, const struct mroute_addr *real, struct link_socket *sock)
Definition multi.c:726
void ungenerate_prefix(struct multi_instance *mi)
Definition multi.c:476
void multi_assign_peer_id(struct multi_context *m, struct multi_instance *mi)
Assigns a peer-id to a a client and adds the instance to the the instances array of the multi_context...
Definition multi.c:4256
Header file for server-mode related structures and functions.
#define MPP_CLOSE_ON_SIGNAL
Definition multi.h:287
#define MPP_PRE_SELECT
Definition multi.h:286
bool multi_io_send_link(struct multi_context *m, struct multi_instance *mi, const unsigned int mpp_flags)
Definition multi_io.c:349
static bool check_debug_level(msglvl_t level)
Definition error.h:253
static void msg_set_prefix(const char *prefix)
Definition error.h:334
#define dmsg(flags,...)
Definition error.h:164
#define msg(flags,...)
Definition error.h:152
#define ASSERT(x)
Definition error.h:221
#define MAX_PEER_ID
Definition openvpn.h:552
bool frequency_limit_event_allowed(struct frequency_limit *f)
Definition otime.c:158
bool packet_id_read(struct packet_id_net *pin, struct buffer *buf, bool long_form)
Definition packet_id.c:310
static void reset_packet_id_send(struct packet_id_send *p)
Reset the current send packet id to its initial state.
Definition packet_id.h:306
void reflect_filter_rate_limit_decrease(struct initial_packet_rate_limit *irl)
decreases the counter of initial packets seen, so connections that successfully completed the three-w...
bool reflect_filter_rate_limit_check(struct initial_packet_rate_limit *irl)
checks if the connection is still allowed to connect under the rate limit.
static bool session_id_defined(const struct session_id *sid1)
Definition session_id.h:53
static bool session_id_read(struct session_id *sid, struct buffer *buf)
Definition session_id.h:59
#define SID_SIZE
Definition session_id.h:44
static void multi_hash_sid_add(struct multi_context *m, const struct session_id *sid, struct multi_instance *mi)
Definition sid_hash.h:34
static struct hash_element * multi_hash_sid_lookup(struct multi_context *m, const struct session_id *sid)
Definition sid_hash.h:50
#define IS_SIG(c)
Definition sig.h:47
const char * print_link_socket_actual(const struct link_socket_actual *act, struct gc_arena *gc)
static bool link_socket_actual_match(const struct link_socket_actual *a1, const struct link_socket_actual *a2)
bool session_skip_to_pre_start(struct tls_session *session, const struct tls_pre_decrypt_state *state, const struct link_socket_actual *from)
Definition ssl.c:2617
bool check_session_hmac_and_pkt_id(struct tls_pre_decrypt_state *state, const struct openvpn_sockaddr *from, const uint8_t *key, int handwindow, bool pkt_is_ack)
Checks if a control packet has a correct HMAC server session id.
Definition ssl_pkt.c:491
struct buffer tls_reset_standalone(struct tls_wrap_ctx *ctx, const struct tls_auth_standalone *tas, const struct session_id *own_sid, const struct session_id *remote_sid, uint8_t header, bool request_resend_wkc)
This function creates a reset packet using the information from the tls pre decrypt state.
Definition ssl_pkt.c:406
void free_tls_pre_decrypt_state(struct tls_pre_decrypt_state *state)
Definition ssl_pkt.c:274
struct session_id calculate_session_id_hmac(struct session_id client_sid, const struct openvpn_sockaddr *from, const uint8_t *key, int handwindow, int offset)
Calculates the HMAC based server session id based on a client session id and socket addr.
Definition ssl_pkt.c:448
SSL control channel wrap/unwrap and decode functions.
#define P_DATA_V1
Definition ssl_pkt.h:47
#define P_DATA_V2
Definition ssl_pkt.h:48
#define P_OPCODE_SHIFT
Definition ssl_pkt.h:39
static const char * packet_opcode_name(int op)
Definition ssl_pkt.h:232
#define EARLY_NEG_MASK
Definition ssl_pkt.h:305
#define P_CONTROL_HARD_RESET_SERVER_V2
Definition ssl_pkt.h:52
first_packet_verdict
Definition ssl_pkt.h:85
@ VERDICT_VALID_ACK_V1
This packet is a valid ACK control packet from the peer, i.e.
Definition ssl_pkt.h:94
@ VERDICT_VALID_WKC_V1
The packet is a valid control packet with appended wrapped client key.
Definition ssl_pkt.h:96
@ VERDICT_VALID_RESET_V2
This packet is a valid reset packet from the peer (all but tls-crypt-v2)
Definition ssl_pkt.h:87
@ VERDICT_VALID_RESET_V3
This is a valid v3 reset (tls-crypt-v2)
Definition ssl_pkt.h:89
@ VERDICT_VALID_CONTROL_V1
This packet is a valid control packet from the peer.
Definition ssl_pkt.h:91
#define EARLY_NEG_START
Definition ssl_pkt.h:306
Wrapper structure for dynamically allocated memory.
Definition buffer.h:71
int len
Length in bytes of the actual content within the allocated memory.
Definition buffer.h:76
int offset
Offset in bytes of the actual content within the allocated memory.
Definition buffer.h:74
struct tls_auth_standalone * tls_auth_standalone
TLS state structure required for the initial authentication of a client's connection attempt.
Definition openvpn.h:327
struct tls_multi * tls_multi
TLS state structure for this VPN tunnel.
Definition openvpn.h:324
struct link_socket_actual from
Definition openvpn.h:246
struct buffer to_link
Definition openvpn.h:377
struct link_socket ** link_sockets
Definition openvpn.h:238
uint8_t session_id_key[SIPHASH_KEY_SIZE]
the siphash secret we use to generate and verify our syn cookie like session ids from the server.
Definition openvpn.h:339
struct link_socket_actual * to_link_addr
Definition openvpn.h:245
struct buffer buf
Definition openvpn.h:375
struct context_buffers * buffers
Definition openvpn.h:367
struct buffer aux_buf
Definition openvpn.h:98
Contains all state information for one tunnel.
Definition openvpn.h:471
struct context_2 c2
Level 2 context.
Definition openvpn.h:516
struct options options
Options loaded from command line or configuration file.
Definition openvpn.h:472
unsigned int flags
Bit-flags determining behavior of security operation functions.
Definition crypto.h:386
struct packet_id packet_id
Current packet ID state for both sending and receiving directions.
Definition crypto.h:333
int signal_received
Definition multi.h:62
Garbage collection arena used to keep track of dynamically allocated memory.
Definition buffer.h:127
void * value
Definition list.h:41
Definition list.h:56
uint8_t proto
Definition mroute.h:84
uint8_t len
Definition mroute.h:83
Main OpenVPN server state structure.
Definition multi.h:170
struct initial_packet_rate_limit * initial_rate_limiter
Definition multi.h:196
struct deferred_signal_schedule_entry deferred_shutdown_signal
Definition multi.h:230
struct hash * hash
VPN tunnel instances indexed by real address of the remote peer.
Definition multi.h:179
struct frequency_limit * new_connection_limiter
Definition multi.h:195
struct context top
Storage structure for process-wide configuration.
Definition multi.h:217
struct multi_instance * pending
Definition multi.h:211
struct multi_instance ** instances
Array of multi_instances with the size of max_clients.
Definition multi.h:171
Server-mode state structure for one single VPN tunnel.
Definition multi.h:102
struct mroute_addr real
External network address of the remote peer.
Definition multi.h:121
struct context context
The context structure storing state for this VPN tunnel.
Definition multi.h:150
int handshake_window
Definition options.h:655
Data structure for describing the packet id that is received/send to the network.
Definition packet_id.h:191
struct packet_id_send send
Definition packet_id.h:200
struct packet_id_rec rec
Definition packet_id.h:201
struct tls_wrap_ctx tls_wrap
Definition ssl_pkt.h:79
struct tls_session session[TM_SIZE]
Array of tls_session objects representing control channel sessions with the remote peer.
Definition ssl_common.h:721
int n_sessions
Number of sessions negotiated thus far.
Definition ssl_common.h:638
struct that stores the temporary data for the tls lite decrypt functions
Definition ssl_pkt.h:106
struct session_id peer_session_id
Definition ssl_pkt.h:109
struct tls_wrap_ctx tls_wrap_tmp
Definition ssl_pkt.h:107
Security parameter state of a single session within a VPN tunnel.
Definition ssl_common.h:497
struct crypto_options opt
Crypto state.
Definition ssl_common.h:283
struct gc_arena gc
Definition test_ssl.c:138