OpenVPN
Data Structures | Macros | Functions
openvpn.h File Reference
#include "buffer.h"
#include "options.h"
#include "socket.h"
#include "crypto.h"
#include "ssl.h"
#include "packet_id.h"
#include "comp.h"
#include "tun.h"
#include "interval.h"
#include "status.h"
#include "fragment.h"
#include "shaper.h"
#include "route.h"
#include "proxy.h"
#include "socks.h"
#include "sig.h"
#include "misc.h"
#include "mbuf.h"
#include "pool.h"
#include "plugin.h"
#include "manage.h"
Include dependency graph for openvpn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  key_schedule
 
struct  packet_id_persist
 
struct  context_buffers
 
struct  context_persist
 
struct  context_0
 Level 0 context containing information related to the OpenVPN process. More...
 
struct  context_1
 Level 1 context containing state that persists across SIGUSR1 restarts. More...
 
struct  context_2
 Level 2 context containing state that is reset on both SIGHUP and SIGUSR1 restarts. More...
 
struct  context
 Contains all state information for one tunnel. More...
 

Macros

#define CM_P2P   0 /* standalone point-to-point session or client */
 
#define CM_TOP   1 /* top level of a multi-client or point-to-multipoint server */
 
#define CM_TOP_CLONE   2 /* clone of a CM_TOP context for one thread */
 
#define CM_CHILD_UDP   3 /* child context of a CM_TOP or CM_THREAD */
 
#define CM_CHILD_TCP   4 /* child context of a CM_TOP or CM_THREAD */
 
#define EVENT_LOOP_CHECK_SIGNAL(c, func, arg)
 
#define TLS_MODE(c)   ((c)->c2.tls_multi != NULL)
 
#define PROTO_DUMP_FLAGS   (check_debug_level(D_LINK_RW_VERBOSE) ? (PD_SHOW_DATA|PD_VERBOSE) : 0)
 
#define PROTO_DUMP(buf, gc)
 
#define MAX_PEER_ID   0xFFFFFF
 

Functions

static void packet_id_persist_init (struct packet_id_persist *p)
 
static bool is_cas_pending (enum multi_status cas)
 

Macro Definition Documentation

◆ CM_CHILD_TCP

#define CM_CHILD_TCP   4 /* child context of a CM_TOP or CM_THREAD */

Definition at line 489 of file openvpn.h.

◆ CM_CHILD_UDP

#define CM_CHILD_UDP   3 /* child context of a CM_TOP or CM_THREAD */

Definition at line 488 of file openvpn.h.

◆ CM_P2P

#define CM_P2P   0 /* standalone point-to-point session or client */

Definition at line 485 of file openvpn.h.

◆ CM_TOP

#define CM_TOP   1 /* top level of a multi-client or point-to-multipoint server */

Definition at line 486 of file openvpn.h.

◆ CM_TOP_CLONE

#define CM_TOP_CLONE   2 /* clone of a CM_TOP context for one thread */

Definition at line 487 of file openvpn.h.

◆ EVENT_LOOP_CHECK_SIGNAL

#define EVENT_LOOP_CHECK_SIGNAL (   c,
  func,
  arg 
)
Value:
if (IS_SIG(c)) \
{ \
const int brk = func(arg); \
perf_pop(); \
if (brk) { \
break;} \
else { \
continue;} \
}

Definition at line 523 of file openvpn.h.

◆ MAX_PEER_ID

#define MAX_PEER_ID   0xFFFFFF

Definition at line 549 of file openvpn.h.

◆ PROTO_DUMP

#define PROTO_DUMP (   buf,
  gc 
)
Value:
protocol_dump((buf), \
|(c->c2.tls_multi ? PD_TLS : 0) \
|(c->options.tls_auth_file ? md_kt_size(c->c1.ks.key_type.digest) : 0) \
|(c->options.tls_crypt_file || c->options.tls_crypt_v2_file ? PD_TLS_CRYPT : 0), \
gc)

Definition at line 541 of file openvpn.h.

◆ PROTO_DUMP_FLAGS

#define PROTO_DUMP_FLAGS   (check_debug_level(D_LINK_RW_VERBOSE) ? (PD_SHOW_DATA|PD_VERBOSE) : 0)

Definition at line 540 of file openvpn.h.

◆ TLS_MODE

#define TLS_MODE (   c)    ((c)->c2.tls_multi != NULL)

Definition at line 539 of file openvpn.h.

Function Documentation

◆ is_cas_pending()

static bool is_cas_pending ( enum multi_status  cas)
inlinestatic

Definition at line 211 of file openvpn.h.

References CAS_PENDING, CAS_PENDING_DEFERRED, and CAS_PENDING_DEFERRED_PARTIAL.

Referenced by multi_process_post().

◆ packet_id_persist_init()

static void packet_id_persist_init ( struct packet_id_persist p)
inlinestatic

Definition at line 86 of file openvpn.h.

Referenced by context_init_1(), and inherit_context_child().

md_kt_size
unsigned char md_kt_size(const char *mdname)
Returns the size of the message digest, in bytes.
Definition: crypto_openssl.c:1077
protocol_dump
const char * protocol_dump(struct buffer *buffer, unsigned int flags, struct gc_arena *gc)
Definition: ssl.c:4044
PD_TLS_CRYPT
#define PD_TLS_CRYPT
Definition: ssl.h:523
PROTO_DUMP_FLAGS
#define PROTO_DUMP_FLAGS
Definition: openvpn.h:540
IS_SIG
#define IS_SIG(c)
Definition: sig.h:48
PD_TLS
#define PD_TLS
Definition: ssl.h:521