OpenVPN
Data Structures | Macros | Functions | Variables
manage.h File Reference
#include "misc.h"
#include "event.h"
#include "socket.h"
#include "mroute.h"
Include dependency graph for manage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  man_def_auth_context
 
struct  command_line
 
union  log_entry_union
 
struct  log_entry
 
struct  log_history
 
struct  management_callback
 
struct  man_persist
 
struct  man_settings
 
struct  man_connection
 
struct  management
 

Macros

#define MF_SERVER   (1<<0)
 
#define MF_QUERY_PASSWORDS   (1<<1)
 
#define MF_HOLD   (1<<2)
 
#define MF_SIGNAL   (1<<3)
 
#define MF_FORGET_DISCONNECT   (1<<4)
 
#define MF_CONNECT_AS_CLIENT   (1<<5)
 
#define MF_CLIENT_AUTH   (1<<6)
 
#define MF_UNIX_SOCK   (1<<8)
 
#define MF_EXTERNAL_KEY   (1<<9)
 
#define MF_EXTERNAL_KEY_NOPADDING   (1<<10)
 
#define MF_EXTERNAL_KEY_PKCS1PAD   (1<<11)
 
#define MF_UP_DOWN   (1<<12)
 
#define MF_QUERY_REMOTE   (1<<13)
 
#define MF_QUERY_PROXY   (1<<14)
 
#define MF_EXTERNAL_CERT   (1<<15)
 
#define MF_EXTERNAL_KEY_PSSPAD   (1<<16)
 
#define MF_EXTERNAL_KEY_DIGEST   (1<<17)
 
#define MANAGEMENT_VERSION   5
 
#define MANAGEMENT_N_PASSWORD_RETRIES   3
 
#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE   100
 
#define MANAGEMENT_ECHO_BUFFER_SIZE   100
 
#define MANAGEMENT_STATE_BUFFER_SIZE   100
 
#define DAF_CONNECTION_ESTABLISHED   (1<<0)
 
#define DAF_CONNECTION_CLOSED   (1<<1)
 
#define DAF_INITIAL_AUTH   (1<<2)
 
#define LOG_PRINT_LOG_PREFIX   (1<<0)
 
#define LOG_PRINT_ECHO_PREFIX   (1<<1)
 
#define LOG_PRINT_STATE_PREFIX   (1<<2)
 
#define LOG_PRINT_INT_DATE   (1<<3)
 
#define LOG_PRINT_MSG_FLAGS   (1<<4)
 
#define LOG_PRINT_STATE   (1<<5)
 
#define LOG_PRINT_LOCAL_IP   (1<<6)
 
#define LOG_PRINT_CRLF   (1<<7)
 
#define LOG_FATAL_NOTIFY   (1<<8)
 
#define LOG_PRINT_INTVAL   (1<<9)
 
#define LOG_PRINT_REMOTE_IP   (1<<10)
 
#define LOG_ECHO_TO_LOG   (1<<11)
 
#define MCF_SERVER   (1<<0) /* is OpenVPN being run as a server? */
 
#define MANSIG_IGNORE_USR1_HUP   (1<<0)
 
#define MANSIG_MAP_USR1_TO_HUP   (1<<1)
 
#define MANSIG_MAP_USR1_TO_TERM   (1<<2)
 
#define UP_QUERY_DISABLED   0
 
#define UP_QUERY_USER_PASS   1
 
#define UP_QUERY_PASS   2
 
#define UP_QUERY_NEED_OK   3
 
#define UP_QUERY_NEED_STR   4
 
#define MS_INITIAL   0 /* all sockets are closed */
 
#define MS_LISTEN   1 /* no client is connected */
 
#define MS_CC_WAIT_READ   2 /* client is connected, waiting for read on socket */
 
#define MS_CC_WAIT_WRITE   3 /* client is connected, waiting for ability to write to socket */
 
#define IEC_UNDEF   0
 
#define IEC_CLIENT_AUTH   1
 
#define IEC_RSA_SIGN   3
 
#define IEC_CERTIFICATE   4
 
#define IEC_PK_SIGN   5
 
#define EKS_UNDEF   0
 
#define EKS_SOLICIT   1
 
#define EKS_INPUT   2
 
#define EKS_READY   3
 
#define OPENVPN_STATE_INITIAL   0 /* Initial, undefined state */
 
#define OPENVPN_STATE_CONNECTING   1 /* Management interface has been initialized */
 
#define OPENVPN_STATE_ASSIGN_IP   2 /* Assigning IP address to virtual network interface */
 
#define OPENVPN_STATE_ADD_ROUTES   3 /* Adding routes to system */
 
#define OPENVPN_STATE_CONNECTED   4 /* Initialization sequence completed */
 
#define OPENVPN_STATE_RECONNECTING   5 /* Restart */
 
#define OPENVPN_STATE_EXITING   6 /* Exit */
 
#define OPENVPN_STATE_WAIT   7 /* Waiting for initial response from server */
 
#define OPENVPN_STATE_AUTH   8 /* Authenticating with server */
 
#define OPENVPN_STATE_GET_CONFIG   9 /* Downloading configuration from server */
 
#define OPENVPN_STATE_RESOLVE   10 /* DNS lookup */
 
#define OPENVPN_STATE_TCP_CONNECT   11 /* Connecting to TCP server */
 
#define OPENVPN_STATE_AUTH_PENDING
 
#define OPENVPN_STATE_CLIENT_BASE   7 /* Base index of client-only states */
 

Functions

struct command_linecommand_line_new (const int buf_len)
 
void command_line_free (struct command_line *cl)
 
void command_line_add (struct command_line *cl, const unsigned char *buf, const int len)
 
const char * command_line_get (struct command_line *cl)
 
void command_line_reset (struct command_line *cl)
 
void command_line_next (struct command_line *cl)
 
const char * log_entry_print (const struct log_entry *e, unsigned int flags, struct gc_arena *gc)
 
struct log_historylog_history_init (const int capacity)
 
void log_history_close (struct log_history *h)
 
void log_history_add (struct log_history *h, const struct log_entry *le)
 
void log_history_resize (struct log_history *h, const int capacity)
 
const struct log_entrylog_history_ref (const struct log_history *h, const int index)
 
static int log_history_size (const struct log_history *h)
 
static int log_history_capacity (const struct log_history *h)
 
struct managementmanagement_init (void)
 
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)
 
void management_close (struct management *man)
 
void management_post_tunnel_open (struct management *man, const in_addr_t tun_local_ip)
 
void management_pre_tunnel_close (struct management *man)
 
void management_socket_set (struct management *man, struct event_set *es, void *arg, unsigned int *persistent)
 
void management_io (struct management *man)
 
void management_set_callback (struct management *man, const struct management_callback *cb)
 
void management_clear_callback (struct management *man)
 
bool management_query_user_pass (struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
 
bool management_should_daemonize (struct management *man)
 
bool management_would_hold (struct management *man)
 
bool management_hold (struct management *man, int holdtime)
 
void management_event_loop_n_seconds (struct management *man, int sec)
 
void management_up_down (struct management *man, const char *updown, const struct env_set *es)
 
void management_notify (struct management *man, const char *severity, const char *type, const char *text)
 
void management_notify_generic (struct management *man, const char *str)
 
void management_notify_client_needing_auth (struct management *management, const unsigned int auth_id, struct man_def_auth_context *mdac, const struct env_set *es)
 
void management_connection_established (struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
 
void management_notify_client_close (struct management *management, struct man_def_auth_context *mdac, const struct env_set *es)
 
void management_learn_addr (struct management *management, struct man_def_auth_context *mdac, const struct mroute_addr *addr, const bool primary)
 
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)
 
char * management_query_pk_sig (struct management *man, const char *b64_data, const char *algorithm)
 
char * management_query_cert (struct management *man, const char *cert_name)
 
static bool management_connected (const struct management *man)
 
static bool management_query_user_pass_enabled (const struct management *man)
 
static bool management_query_remote_enabled (const struct management *man)
 
static bool management_query_proxy_enabled (const struct management *man)
 
static bool management_enable_def_auth (const struct management *man)
 
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_addr, const struct openvpn_sockaddr *remote_addr)
 
void management_echo (struct management *man, const char *string, const bool pull)
 
void management_auth_failure (struct management *man, const char *type, const char *reason)
 
void management_auth_token (struct management *man, const char *token)
 
void management_check_bytecount (struct context *c, struct management *man, struct timeval *timeval)
 
static void management_bytes_client (struct management *man, const int size_in, const int size_out)
 
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 management_bytes_server (struct management *man, const counter_type *bytes_in_total, const counter_type *bytes_out_total, struct man_def_auth_context *mdac)
 
void man_persist_client_stats (struct management *man, struct context *c)
 
void management_sleep (const int n)
 A sleep function that services the management layer for n seconds rather than doing nothing. More...
 

Variables

struct managementmanagement
 

Macro Definition Documentation

◆ DAF_CONNECTION_CLOSED

#define DAF_CONNECTION_CLOSED   (1<<1)

Definition at line 68 of file manage.h.

◆ DAF_CONNECTION_ESTABLISHED

#define DAF_CONNECTION_ESTABLISHED   (1<<0)

Definition at line 67 of file manage.h.

◆ DAF_INITIAL_AUTH

#define DAF_INITIAL_AUTH   (1<<2)

Definition at line 69 of file manage.h.

◆ EKS_INPUT

#define EKS_INPUT   2

Definition at line 309 of file manage.h.

◆ EKS_READY

#define EKS_READY   3

Definition at line 310 of file manage.h.

◆ EKS_SOLICIT

#define EKS_SOLICIT   1

Definition at line 308 of file manage.h.

◆ EKS_UNDEF

#define EKS_UNDEF   0

Definition at line 307 of file manage.h.

◆ IEC_CERTIFICATE

#define IEC_CERTIFICATE   4

Definition at line 301 of file manage.h.

◆ IEC_CLIENT_AUTH

#define IEC_CLIENT_AUTH   1

Definition at line 298 of file manage.h.

◆ IEC_PK_SIGN

#define IEC_PK_SIGN   5

Definition at line 302 of file manage.h.

◆ IEC_RSA_SIGN

#define IEC_RSA_SIGN   3

Definition at line 300 of file manage.h.

◆ IEC_UNDEF

#define IEC_UNDEF   0

Definition at line 297 of file manage.h.

◆ LOG_ECHO_TO_LOG

#define LOG_ECHO_TO_LOG   (1<<11)

Definition at line 135 of file manage.h.

◆ LOG_FATAL_NOTIFY

#define LOG_FATAL_NOTIFY   (1<<8)

Definition at line 129 of file manage.h.

◆ LOG_PRINT_CRLF

#define LOG_PRINT_CRLF   (1<<7)

Definition at line 128 of file manage.h.

◆ LOG_PRINT_ECHO_PREFIX

#define LOG_PRINT_ECHO_PREFIX   (1<<1)

Definition at line 120 of file manage.h.

◆ LOG_PRINT_INT_DATE

#define LOG_PRINT_INT_DATE   (1<<3)

Definition at line 123 of file manage.h.

◆ LOG_PRINT_INTVAL

#define LOG_PRINT_INTVAL   (1<<9)

Definition at line 131 of file manage.h.

◆ LOG_PRINT_LOCAL_IP

#define LOG_PRINT_LOCAL_IP   (1<<6)

Definition at line 126 of file manage.h.

◆ LOG_PRINT_LOG_PREFIX

#define LOG_PRINT_LOG_PREFIX   (1<<0)

Definition at line 119 of file manage.h.

◆ LOG_PRINT_MSG_FLAGS

#define LOG_PRINT_MSG_FLAGS   (1<<4)

Definition at line 124 of file manage.h.

◆ LOG_PRINT_REMOTE_IP

#define LOG_PRINT_REMOTE_IP   (1<<10)

Definition at line 133 of file manage.h.

◆ LOG_PRINT_STATE

#define LOG_PRINT_STATE   (1<<5)

Definition at line 125 of file manage.h.

◆ LOG_PRINT_STATE_PREFIX

#define LOG_PRINT_STATE_PREFIX   (1<<2)

Definition at line 121 of file manage.h.

◆ MANAGEMENT_ECHO_BUFFER_SIZE

#define MANAGEMENT_ECHO_BUFFER_SIZE   100

Definition at line 58 of file manage.h.

◆ MANAGEMENT_LOG_HISTORY_INITIAL_SIZE

#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE   100

Definition at line 57 of file manage.h.

◆ MANAGEMENT_N_PASSWORD_RETRIES

#define MANAGEMENT_N_PASSWORD_RETRIES   3

Definition at line 56 of file manage.h.

◆ MANAGEMENT_STATE_BUFFER_SIZE

#define MANAGEMENT_STATE_BUFFER_SIZE   100

Definition at line 59 of file manage.h.

◆ MANAGEMENT_VERSION

#define MANAGEMENT_VERSION   5

Definition at line 55 of file manage.h.

◆ MANSIG_IGNORE_USR1_HUP

#define MANSIG_IGNORE_USR1_HUP   (1<<0)

Definition at line 260 of file manage.h.

◆ MANSIG_MAP_USR1_TO_HUP

#define MANSIG_MAP_USR1_TO_HUP   (1<<1)

Definition at line 261 of file manage.h.

◆ MANSIG_MAP_USR1_TO_TERM

#define MANSIG_MAP_USR1_TO_TERM   (1<<2)

Definition at line 262 of file manage.h.

◆ MCF_SERVER

#define MCF_SERVER   (1<<0) /* is OpenVPN being run as a server? */

Definition at line 177 of file manage.h.

◆ MF_CLIENT_AUTH

#define MF_CLIENT_AUTH   (1<<6)

Definition at line 34 of file manage.h.

◆ MF_CONNECT_AS_CLIENT

#define MF_CONNECT_AS_CLIENT   (1<<5)

Definition at line 33 of file manage.h.

◆ MF_EXTERNAL_CERT

#define MF_EXTERNAL_CERT   (1<<15)

Definition at line 43 of file manage.h.

◆ MF_EXTERNAL_KEY

#define MF_EXTERNAL_KEY   (1<<9)

Definition at line 37 of file manage.h.

◆ MF_EXTERNAL_KEY_DIGEST

#define MF_EXTERNAL_KEY_DIGEST   (1<<17)

Definition at line 45 of file manage.h.

◆ MF_EXTERNAL_KEY_NOPADDING

#define MF_EXTERNAL_KEY_NOPADDING   (1<<10)

Definition at line 38 of file manage.h.

◆ MF_EXTERNAL_KEY_PKCS1PAD

#define MF_EXTERNAL_KEY_PKCS1PAD   (1<<11)

Definition at line 39 of file manage.h.

◆ MF_EXTERNAL_KEY_PSSPAD

#define MF_EXTERNAL_KEY_PSSPAD   (1<<16)

Definition at line 44 of file manage.h.

◆ MF_FORGET_DISCONNECT

#define MF_FORGET_DISCONNECT   (1<<4)

Definition at line 32 of file manage.h.

◆ MF_HOLD

#define MF_HOLD   (1<<2)

Definition at line 30 of file manage.h.

◆ MF_QUERY_PASSWORDS

#define MF_QUERY_PASSWORDS   (1<<1)

Definition at line 29 of file manage.h.

◆ MF_QUERY_PROXY

#define MF_QUERY_PROXY   (1<<14)

Definition at line 42 of file manage.h.

◆ MF_QUERY_REMOTE

#define MF_QUERY_REMOTE   (1<<13)

Definition at line 41 of file manage.h.

◆ MF_SERVER

#define MF_SERVER   (1<<0)

Definition at line 28 of file manage.h.

◆ MF_SIGNAL

#define MF_SIGNAL   (1<<3)

Definition at line 31 of file manage.h.

◆ MF_UNIX_SOCK

#define MF_UNIX_SOCK   (1<<8)

Definition at line 36 of file manage.h.

◆ MF_UP_DOWN

#define MF_UP_DOWN   (1<<12)

Definition at line 40 of file manage.h.

◆ MS_CC_WAIT_READ

#define MS_CC_WAIT_READ   2 /* client is connected, waiting for read on socket */

Definition at line 276 of file manage.h.

◆ MS_CC_WAIT_WRITE

#define MS_CC_WAIT_WRITE   3 /* client is connected, waiting for ability to write to socket */

Definition at line 277 of file manage.h.

◆ MS_INITIAL

#define MS_INITIAL   0 /* all sockets are closed */

Definition at line 274 of file manage.h.

◆ MS_LISTEN

#define MS_LISTEN   1 /* no client is connected */

Definition at line 275 of file manage.h.

◆ OPENVPN_STATE_ADD_ROUTES

#define OPENVPN_STATE_ADD_ROUTES   3 /* Adding routes to system */

Definition at line 474 of file manage.h.

◆ OPENVPN_STATE_ASSIGN_IP

#define OPENVPN_STATE_ASSIGN_IP   2 /* Assigning IP address to virtual network interface */

Definition at line 473 of file manage.h.

◆ OPENVPN_STATE_AUTH

#define OPENVPN_STATE_AUTH   8 /* Authenticating with server */

Definition at line 481 of file manage.h.

◆ OPENVPN_STATE_AUTH_PENDING

#define OPENVPN_STATE_AUTH_PENDING
Value:
12 /* Waiting in auth-pending mode
* technically variant of GET_CONFIG */

Definition at line 485 of file manage.h.

◆ OPENVPN_STATE_CLIENT_BASE

#define OPENVPN_STATE_CLIENT_BASE   7 /* Base index of client-only states */

Definition at line 487 of file manage.h.

◆ OPENVPN_STATE_CONNECTED

#define OPENVPN_STATE_CONNECTED   4 /* Initialization sequence completed */

Definition at line 475 of file manage.h.

◆ OPENVPN_STATE_CONNECTING

#define OPENVPN_STATE_CONNECTING   1 /* Management interface has been initialized */

Definition at line 472 of file manage.h.

◆ OPENVPN_STATE_EXITING

#define OPENVPN_STATE_EXITING   6 /* Exit */

Definition at line 477 of file manage.h.

◆ OPENVPN_STATE_GET_CONFIG

#define OPENVPN_STATE_GET_CONFIG   9 /* Downloading configuration from server */

Definition at line 482 of file manage.h.

◆ OPENVPN_STATE_INITIAL

#define OPENVPN_STATE_INITIAL   0 /* Initial, undefined state */

Definition at line 471 of file manage.h.

◆ OPENVPN_STATE_RECONNECTING

#define OPENVPN_STATE_RECONNECTING   5 /* Restart */

Definition at line 476 of file manage.h.

◆ OPENVPN_STATE_RESOLVE

#define OPENVPN_STATE_RESOLVE   10 /* DNS lookup */

Definition at line 483 of file manage.h.

◆ OPENVPN_STATE_TCP_CONNECT

#define OPENVPN_STATE_TCP_CONNECT   11 /* Connecting to TCP server */

Definition at line 484 of file manage.h.

◆ OPENVPN_STATE_WAIT

#define OPENVPN_STATE_WAIT   7 /* Waiting for initial response from server */

Definition at line 480 of file manage.h.

◆ UP_QUERY_DISABLED

#define UP_QUERY_DISABLED   0

Definition at line 267 of file manage.h.

◆ UP_QUERY_NEED_OK

#define UP_QUERY_NEED_OK   3

Definition at line 270 of file manage.h.

◆ UP_QUERY_NEED_STR

#define UP_QUERY_NEED_STR   4

Definition at line 271 of file manage.h.

◆ UP_QUERY_PASS

#define UP_QUERY_PASS   2

Definition at line 269 of file manage.h.

◆ UP_QUERY_USER_PASS

#define UP_QUERY_USER_PASS   1

Definition at line 268 of file manage.h.

Function Documentation

◆ command_line_add()

void command_line_add ( struct command_line cl,
const unsigned char *  buf,
const int  len 
)

Definition at line 3895 of file manage.c.

References command_line::buf, buf_clear(), buf_write_u8(), CC_NEWLINE, CC_PRINT, and char_class().

Referenced by man_read().

◆ command_line_free()

void command_line_free ( struct command_line cl)

Definition at line 3882 of file manage.c.

References command_line::buf, command_line_reset(), free_buf(), and command_line::residual.

Referenced by man_connection_close().

◆ command_line_get()

const char* command_line_get ( struct command_line cl)

◆ command_line_new()

struct command_line* command_line_new ( const int  buf_len)

Definition at line 3865 of file manage.c.

References alloc_buf(), ALLOC_OBJ_CLEAR, command_line::buf, buf_len(), and command_line::residual.

Referenced by man_connection_init().

◆ command_line_next()

void command_line_next ( struct command_line cl)

Definition at line 3927 of file manage.c.

References command_line::buf, buf_clear(), buf_copy(), and command_line::residual.

Referenced by man_read().

◆ command_line_reset()

void command_line_reset ( struct command_line cl)

Definition at line 3875 of file manage.c.

References command_line::buf, buf_clear(), and command_line::residual.

Referenced by command_line_free(), and man_reset_client_socket().

◆ log_entry_print()

const char* log_entry_print ( const struct log_entry e,
unsigned int  flags,
struct gc_arena gc 
)

◆ log_history_add()

void log_history_add ( struct log_history h,
const struct log_entry le 
)

◆ log_history_capacity()

static int log_history_capacity ( const struct log_history h)
inlinestatic

Definition at line 164 of file manage.h.

References log_history::capacity.

◆ log_history_close()

void log_history_close ( struct log_history h)

Definition at line 4052 of file manage.c.

References log_history_free_contents().

Referenced by man_persist_close().

◆ log_history_init()

struct log_history* log_history_init ( const int  capacity)

Definition at line 4031 of file manage.c.

References ALLOC_OBJ, ASSERT, log_history::capacity, and log_history_obj_init().

Referenced by man_persist_init().

◆ log_history_ref()

const struct log_entry* log_history_ref ( const struct log_history h,
const int  index 
)

Definition at line 4101 of file manage.c.

References log_history::array, log_index(), and log_history::size.

Referenced by man_history().

◆ log_history_resize()

void log_history_resize ( struct log_history h,
const int  capacity 
)

◆ log_history_size()

static int log_history_size ( const struct log_history h)
inlinestatic

Definition at line 158 of file manage.h.

References log_history::size.

Referenced by man_history().

◆ man_bytecount_output_server()

void man_bytecount_output_server ( const counter_type bytes_in_total,
const counter_type bytes_out_total,
struct man_def_auth_context mdac 
)

◆ man_persist_client_stats()

void man_persist_client_stats ( struct management man,
struct context c 
)

◆ management_auth_failure()

void management_auth_failure ( struct management man,
const char *  type,
const char *  reason 
)

Definition at line 3080 of file manage.c.

References ASSERT, M_CLIENT, and msg.

Referenced by auth_user_pass_mgmt(), receive_auth_failed(), tls_ctx_load_pkcs12(), and tls_ctx_load_priv_file().

◆ management_auth_token()

void management_auth_token ( struct management man,
const char *  token 
)

Definition at line 3093 of file manage.c.

References M_CLIENT, and msg.

Referenced by add_option().

◆ management_bytes_client()

static void management_bytes_client ( struct management man,
const int  size_in,
const int  size_out 
)
inlinestatic

◆ management_bytes_server()

static void management_bytes_server ( struct management man,
const counter_type bytes_in_total,
const counter_type bytes_out_total,
struct man_def_auth_context mdac 
)
inlinestatic

◆ management_check_bytecount()

void management_check_bytecount ( struct context c,
struct management man,
struct timeval *  timeval 
)

◆ management_clear_callback()

void management_clear_callback ( struct management man)

◆ management_close()

void management_close ( struct management man)

◆ management_connected()

static bool management_connected ( const struct management man)
inlinestatic

◆ management_connection_established()

void management_connection_established ( struct management management,
struct man_def_auth_context mdac,
const struct env_set es 
)

◆ management_echo()

void management_echo ( struct management man,
const char *  string,
const bool  pull 
)

◆ management_enable_def_auth()

static bool management_enable_def_auth ( const struct management man)
inlinestatic

◆ management_event_loop_n_seconds()

void management_event_loop_n_seconds ( struct management man,
int  sec 
)

◆ management_hold()

bool management_hold ( struct management man,
int  holdtime 
)

◆ management_init()

struct management* management_init ( void  )

◆ management_io()

void management_io ( struct management man)

◆ management_learn_addr()

void management_learn_addr ( struct management management,
struct man_def_auth_context mdac,
const struct mroute_addr addr,
const bool  primary 
)

◆ management_notify()

void management_notify ( struct management man,
const char *  severity,
const char *  type,
const char *  text 
)

Definition at line 2888 of file manage.c.

References M_CLIENT, and msg.

Referenced by receive_exit_message(), and server_pushed_signal().

◆ management_notify_client_close()

void management_notify_client_close ( struct management management,
struct man_def_auth_context mdac,
const struct env_set es 
)

◆ management_notify_client_cr_response()

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 
)

◆ management_notify_client_needing_auth()

void management_notify_client_needing_auth ( struct management management,
const unsigned int  auth_id,
struct man_def_auth_context mdac,
const struct env_set es 
)

◆ management_notify_generic()

void management_notify_generic ( struct management man,
const char *  str 
)

Definition at line 2894 of file manage.c.

References M_CLIENT, and msg.

Referenced by ce_management_query_proxy(), ce_management_query_remote(), and server_pushed_info().

◆ management_open()

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 
)

◆ management_post_tunnel_open()

void management_post_tunnel_open ( struct management man,
const in_addr_t  tun_local_ip 
)

◆ management_pre_tunnel_close()

void management_pre_tunnel_close ( struct management man)

◆ management_query_cert()

char* management_query_cert ( struct management man,
const char *  cert_name 
)

◆ management_query_pk_sig()

char* management_query_pk_sig ( struct management man,
const char *  b64_data,
const char *  algorithm 
)

◆ management_query_proxy_enabled()

static bool management_query_proxy_enabled ( const struct management man)
inlinestatic

Definition at line 454 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_PROXY, and management::settings.

Referenced by next_connection_entry().

◆ management_query_remote_enabled()

static bool management_query_remote_enabled ( const struct management man)
inlinestatic

Definition at line 448 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_REMOTE, and management::settings.

Referenced by next_connection_entry().

◆ management_query_user_pass()

bool management_query_user_pass ( struct management man,
struct user_pass up,
const char *  type,
const unsigned int  flags,
const char *  static_challenge 
)

◆ management_query_user_pass_enabled()

static bool management_query_user_pass_enabled ( const struct management man)
inlinestatic

Definition at line 442 of file manage.h.

References BOOL_CAST, man_settings::flags, MF_QUERY_PASSWORDS, and management::settings.

Referenced by get_user_pass_cr().

◆ management_set_callback()

void management_set_callback ( struct management man,
const struct management_callback cb 
)

◆ management_set_state()

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_addr,
const struct openvpn_sockaddr remote_addr 
)

◆ management_should_daemonize()

bool management_should_daemonize ( struct management man)

◆ management_sleep()

void management_sleep ( const int  n)

A sleep function that services the management layer for n seconds rather than doing nothing.

Definition at line 4114 of file manage.c.

References management_event_loop_n_seconds(), sleep, and win32_sleep().

Referenced by dco_connect_wait(), do_up(), exec_command(), openvpn_connect(), openvpn_getaddrinfo(), read_incoming_link(), socket_listen_accept(), socket_restart_pause(), and tuntap_set_connected().

◆ management_socket_set()

void management_socket_set ( struct management man,
struct event_set es,
void *  arg,
unsigned int *  persistent 
)

◆ management_up_down()

void management_up_down ( struct management man,
const char *  updown,
const struct env_set es 
)

Definition at line 2878 of file manage.c.

References es, man_settings::flags, M_CLIENT, man_output_env(), MF_UP_DOWN, msg, and management::settings.

Referenced by do_close_tun(), and do_route().

◆ management_would_hold()

bool management_would_hold ( struct management man)

Variable Documentation

◆ management

Definition at line 63 of file manage.c.