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 "pf.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 SOCKET_READ   (1<<0)
 
#define SOCKET_WRITE   (1<<1)
 
#define TUN_READ   (1<<2)
 
#define TUN_WRITE   (1<<3)
 
#define ES_ERROR   (1<<4)
 
#define ES_TIMEOUT   (1<<5)
 
#define MANAGEMENT_READ   (1<<6)
 
#define MANAGEMENT_WRITE   (1<<7)
 
#define CAS_SUCCEEDED   0
 
#define CAS_PENDING   1
 
#define CAS_FAILED   2
 
#define CAS_PARTIAL
 
#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 CIPHER_ENABLED(c)   (c->c1.ks.key_type.cipher != NULL)
 
#define MAX_PEER_ID   0xFFFFFF
 

Functions

static void packet_id_persist_init (struct packet_id_persist *p)
 

Macro Definition Documentation

◆ CAS_FAILED

#define CAS_FAILED   2

Definition at line 455 of file openvpn.h.

Referenced by multi_connection_established(), and process_incoming_push_request().

◆ CAS_PARTIAL

#define CAS_PARTIAL
Value:
3 /* at least one client-connect script/plugin
* succeeded while a later one in the chain failed */

Definition at line 456 of file openvpn.h.

Referenced by multi_client_disconnect_script(), and multi_connection_established().

◆ CAS_PENDING

#define CAS_PENDING   1

Definition at line 454 of file openvpn.h.

Referenced by multi_create_instance().

◆ CAS_SUCCEEDED

#define CAS_SUCCEEDED   0

◆ CIPHER_ENABLED

#define CIPHER_ENABLED (   c)    (c->c1.ks.key_type.cipher != NULL)

Definition at line 569 of file openvpn.h.

Referenced by do_init_frame(), and frame_finalize_options().

◆ CM_CHILD_TCP

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

Definition at line 513 of file openvpn.h.

Referenced by close_instance(), inherit_context_child(), and init_instance().

◆ CM_CHILD_UDP

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

Definition at line 512 of file openvpn.h.

Referenced by close_instance(), inherit_context_child(), and init_instance().

◆ CM_P2P

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

Definition at line 509 of file openvpn.h.

Referenced by close_instance(), init_instance(), and tunnel_point_to_point().

◆ CM_TOP

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

◆ CM_TOP_CLONE

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

Definition at line 511 of file openvpn.h.

Referenced by inherit_context_top().

◆ ES_ERROR

#define ES_ERROR   (1<<4)

Definition at line 240 of file openvpn.h.

Referenced by io_wait_dowork().

◆ ES_TIMEOUT

#define ES_TIMEOUT   (1<<5)

◆ 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;} \
}
#define IS_SIG(c)
Definition: sig.h:50

Definition at line 545 of file openvpn.h.

◆ MANAGEMENT_READ

#define MANAGEMENT_READ   (1<<6)

Definition at line 243 of file openvpn.h.

Referenced by multi_process_io_udp(), and process_io().

◆ MANAGEMENT_WRITE

#define MANAGEMENT_WRITE   (1<<7)

Definition at line 244 of file openvpn.h.

Referenced by multi_process_io_udp(), and process_io().

◆ MAX_PEER_ID

#define MAX_PEER_ID   0xFFFFFF

Definition at line 572 of file openvpn.h.

Referenced by add_option(), multi_close_instance(), and multi_get_create_instance_udp().

◆ PROTO_DUMP

#define PROTO_DUMP (   buf,
  gc 
)
Value:
protocol_dump((buf), \
|(c->c2.tls_multi ? PD_TLS : 0) \
|(c->options.tls_auth_file ? c->c1.ks.key_type.hmac_length : 0), \
gc)
const char * protocol_dump(struct buffer *buffer, unsigned int flags, struct gc_arena *gc)
Definition: ssl.c:4207
#define PROTO_DUMP_FLAGS
Definition: openvpn.h:562
#define PD_TLS
Definition: ssl.h:595

Definition at line 563 of file openvpn.h.

Referenced by process_incoming_link_part1(), and process_outgoing_link().

◆ PROTO_DUMP_FLAGS

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

Definition at line 562 of file openvpn.h.

◆ SOCKET_READ

#define SOCKET_READ   (1<<0)

Definition at line 236 of file openvpn.h.

Referenced by io_wait_dowork(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ SOCKET_WRITE

#define SOCKET_WRITE   (1<<1)

Definition at line 237 of file openvpn.h.

Referenced by io_wait(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ TLS_MODE

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

◆ TUN_READ

#define TUN_READ   (1<<2)

Definition at line 238 of file openvpn.h.

Referenced by multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ TUN_WRITE

#define TUN_WRITE   (1<<3)

Definition at line 239 of file openvpn.h.

Referenced by io_wait(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

Function Documentation

◆ packet_id_persist_init()

static void packet_id_persist_init ( struct packet_id_persist p)
inlinestatic

Definition at line 83 of file openvpn.h.

Referenced by context_init_1(), and inherit_context_child().