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  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 MANAGEMENT_VERSION   2
 
#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 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_CLIENT_PF   2
 
#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 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_UNIX_SOCK   (1<<8)
 
#define MF_EXTERNAL_KEY   (1<<9)
 
#define MF_UP_DOWN   (1<<10)
 
#define MF_QUERY_REMOTE   (1<<11)
 
#define MF_QUERY_PROXY   (1<<12)
 
#define MF_EXTERNAL_CERT   (1<<13)
 
#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_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 char *write_peer_info_file, 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)
 
char * management_query_pk_sig (struct management *man, const char *b64_data)
 
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)
 
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 man_bytecount_output_client (struct management *man)
 
static void man_bytecount_possible_output_client (struct management *man)
 
static void management_bytes_out_client (struct management *man, const int size)
 
static void management_bytes_in_client (struct management *man, const int size)
 
static void management_bytes_out (struct management *man, const int size)
 
static void management_bytes_in (struct management *man, const int size)
 
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

◆ EKS_INPUT

#define EKS_INPUT   2

Definition at line 292 of file manage.h.

Referenced by man_certificate(), man_pk_sig(), and management_query_multiline().

◆ EKS_READY

#define EKS_READY   3

Definition at line 293 of file manage.h.

Referenced by in_extra_dispatch(), and management_query_multiline().

◆ EKS_SOLICIT

#define EKS_SOLICIT   1

Definition at line 291 of file manage.h.

Referenced by man_certificate(), man_pk_sig(), and management_query_multiline().

◆ EKS_UNDEF

#define EKS_UNDEF   0

Definition at line 290 of file manage.h.

Referenced by management_query_multiline().

◆ IEC_CERTIFICATE

#define IEC_CERTIFICATE   4

Definition at line 282 of file manage.h.

Referenced by in_extra_dispatch(), and man_certificate().

◆ IEC_CLIENT_AUTH

#define IEC_CLIENT_AUTH   1

Definition at line 279 of file manage.h.

Referenced by in_extra_dispatch().

◆ IEC_CLIENT_PF

#define IEC_CLIENT_PF   2

Definition at line 280 of file manage.h.

Referenced by in_extra_dispatch().

◆ IEC_PK_SIGN

#define IEC_PK_SIGN   5

Definition at line 283 of file manage.h.

Referenced by in_extra_dispatch(), and man_pk_sig().

◆ IEC_RSA_SIGN

#define IEC_RSA_SIGN   3

Definition at line 281 of file manage.h.

◆ IEC_UNDEF

#define IEC_UNDEF   0

Definition at line 278 of file manage.h.

Referenced by in_extra_reset().

◆ LOG_ECHO_TO_LOG

#define LOG_ECHO_TO_LOG   (1<<11)

Definition at line 116 of file manage.h.

Referenced by log_entry_print(), and management_set_state().

◆ LOG_FATAL_NOTIFY

#define LOG_FATAL_NOTIFY   (1<<8)

Definition at line 110 of file manage.h.

Referenced by log_entry_print(), and virtual_output_callback_func().

◆ LOG_PRINT_CRLF

#define LOG_PRINT_CRLF   (1<<7)

◆ LOG_PRINT_ECHO_PREFIX

#define LOG_PRINT_ECHO_PREFIX   (1<<1)

Definition at line 101 of file manage.h.

Referenced by log_entry_print(), and management_echo().

◆ LOG_PRINT_INT_DATE

#define LOG_PRINT_INT_DATE   (1<<3)

◆ LOG_PRINT_INTVAL

#define LOG_PRINT_INTVAL   (1<<9)

Definition at line 112 of file manage.h.

Referenced by log_entry_print().

◆ LOG_PRINT_LOCAL_IP

#define LOG_PRINT_LOCAL_IP   (1<<6)

Definition at line 107 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_LOG_PREFIX

#define LOG_PRINT_LOG_PREFIX   (1<<0)

Definition at line 100 of file manage.h.

Referenced by log_entry_print(), and virtual_output_callback_func().

◆ LOG_PRINT_MSG_FLAGS

#define LOG_PRINT_MSG_FLAGS   (1<<4)

Definition at line 105 of file manage.h.

Referenced by log_entry_print(), man_log(), and virtual_output_callback_func().

◆ LOG_PRINT_REMOTE_IP

#define LOG_PRINT_REMOTE_IP   (1<<10)

Definition at line 114 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_STATE

#define LOG_PRINT_STATE   (1<<5)

Definition at line 106 of file manage.h.

Referenced by log_entry_print(), man_state(), and management_set_state().

◆ LOG_PRINT_STATE_PREFIX

#define LOG_PRINT_STATE_PREFIX   (1<<2)

Definition at line 102 of file manage.h.

Referenced by log_entry_print(), and management_set_state().

◆ MANAGEMENT_ECHO_BUFFER_SIZE

#define MANAGEMENT_ECHO_BUFFER_SIZE   100

Definition at line 37 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_LOG_HISTORY_INITIAL_SIZE

#define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE   100

Definition at line 36 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_N_PASSWORD_RETRIES

#define MANAGEMENT_N_PASSWORD_RETRIES   3

Definition at line 35 of file manage.h.

Referenced by man_check_password().

◆ MANAGEMENT_STATE_BUFFER_SIZE

#define MANAGEMENT_STATE_BUFFER_SIZE   100

Definition at line 38 of file manage.h.

Referenced by management_init().

◆ MANAGEMENT_VERSION

#define MANAGEMENT_VERSION   2

Definition at line 34 of file manage.h.

Referenced by man_dispatch_command(), and man_welcome().

◆ MANSIG_IGNORE_USR1_HUP

#define MANSIG_IGNORE_USR1_HUP   (1<<0)

Definition at line 241 of file manage.h.

Referenced by man_mod_signal(), and management_hold().

◆ MANSIG_MAP_USR1_TO_HUP

#define MANSIG_MAP_USR1_TO_HUP   (1<<1)

Definition at line 242 of file manage.h.

Referenced by man_mod_signal(), and man_settings_init().

◆ MANSIG_MAP_USR1_TO_TERM

#define MANSIG_MAP_USR1_TO_TERM   (1<<2)

Definition at line 243 of file manage.h.

Referenced by man_mod_signal(), and man_settings_init().

◆ MCF_SERVER

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

◆ MF_CONNECT_AS_CLIENT

#define MF_CONNECT_AS_CLIENT   (1<<5)

◆ MF_EXTERNAL_CERT

#define MF_EXTERNAL_CERT   (1<<13)

Definition at line 349 of file manage.h.

Referenced by add_option(), init_ssl(), options_postprocess_verify_ce(), and show_settings().

◆ MF_EXTERNAL_KEY

#define MF_EXTERNAL_KEY   (1<<9)

◆ MF_FORGET_DISCONNECT

#define MF_FORGET_DISCONNECT   (1<<4)

Definition at line 336 of file manage.h.

Referenced by add_option(), and man_reset_client_socket().

◆ MF_HOLD

#define MF_HOLD   (1<<2)

Definition at line 334 of file manage.h.

Referenced by add_option(), man_hold(), and management_would_hold().

◆ MF_QUERY_PASSWORDS

#define MF_QUERY_PASSWORDS   (1<<1)

◆ MF_QUERY_PROXY

#define MF_QUERY_PROXY   (1<<12)

Definition at line 348 of file manage.h.

Referenced by add_option(), and management_query_proxy_enabled().

◆ MF_QUERY_REMOTE

#define MF_QUERY_REMOTE   (1<<11)

Definition at line 347 of file manage.h.

Referenced by add_option(), and management_query_remote_enabled().

◆ MF_SERVER

#define MF_SERVER   (1<<0)

Definition at line 332 of file manage.h.

Referenced by management_set_state(), and open_management().

◆ MF_SIGNAL

#define MF_SIGNAL   (1<<3)

Definition at line 335 of file manage.h.

Referenced by add_option(), and man_reset_client_socket().

◆ MF_UNIX_SOCK

#define MF_UNIX_SOCK   (1<<8)

◆ MF_UP_DOWN

#define MF_UP_DOWN   (1<<10)

Definition at line 346 of file manage.h.

Referenced by add_option(), and management_up_down().

◆ MS_CC_WAIT_READ

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

◆ MS_CC_WAIT_WRITE

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

◆ MS_INITIAL

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

◆ MS_LISTEN

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

◆ OPENVPN_STATE_ADD_ROUTES

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

Definition at line 485 of file manage.h.

Referenced by add_routes(), and man_state_name().

◆ OPENVPN_STATE_ASSIGN_IP

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

Definition at line 484 of file manage.h.

Referenced by do_ifconfig(), and man_state_name().

◆ OPENVPN_STATE_AUTH

#define OPENVPN_STATE_AUTH   8 /* Authenticating with server */

Definition at line 492 of file manage.h.

Referenced by man_state_name(), and tls_pre_decrypt().

◆ OPENVPN_STATE_CLIENT_BASE

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

Definition at line 497 of file manage.h.

Referenced by management_set_state().

◆ OPENVPN_STATE_CONNECTED

#define OPENVPN_STATE_CONNECTED   4 /* Initialization sequence completed */

Definition at line 486 of file manage.h.

Referenced by initialization_sequence_completed(), and man_state_name().

◆ OPENVPN_STATE_CONNECTING

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

Definition at line 483 of file manage.h.

Referenced by man_state_name(), and open_management().

◆ OPENVPN_STATE_EXITING

#define OPENVPN_STATE_EXITING   6 /* Exit */

Definition at line 488 of file manage.h.

Referenced by man_state_name(), and signal_restart_status().

◆ OPENVPN_STATE_GET_CONFIG

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

Definition at line 493 of file manage.h.

Referenced by check_connection_established_dowork(), and man_state_name().

◆ OPENVPN_STATE_INITIAL

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

Definition at line 482 of file manage.h.

Referenced by man_state_name().

◆ OPENVPN_STATE_RECONNECTING

#define OPENVPN_STATE_RECONNECTING   5 /* Restart */

Definition at line 487 of file manage.h.

Referenced by man_state_name(), and signal_restart_status().

◆ OPENVPN_STATE_RESOLVE

#define OPENVPN_STATE_RESOLVE   10 /* DNS lookup */

Definition at line 494 of file manage.h.

Referenced by man_state_name(), and openvpn_getaddrinfo().

◆ OPENVPN_STATE_TCP_CONNECT

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

Definition at line 495 of file manage.h.

Referenced by man_state_name(), and socket_connect().

◆ OPENVPN_STATE_WAIT

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

Definition at line 491 of file manage.h.

Referenced by man_state_name(), and tls_process().

◆ UP_QUERY_DISABLED

#define UP_QUERY_DISABLED   0

Definition at line 248 of file manage.h.

Referenced by man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_NEED_OK

#define UP_QUERY_NEED_OK   3

Definition at line 251 of file manage.h.

Referenced by man_query_need_ok(), man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_NEED_STR

#define UP_QUERY_NEED_STR   4

Definition at line 252 of file manage.h.

Referenced by man_query_need_str(), man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_PASS

#define UP_QUERY_PASS   2

Definition at line 250 of file manage.h.

Referenced by man_query_password(), man_up_finalize(), and management_query_user_pass().

◆ UP_QUERY_USER_PASS

#define UP_QUERY_USER_PASS   1

Function Documentation

◆ command_line_add()

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

Definition at line 3774 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 3765 of file manage.c.

References command_line::buf, command_line_reset(), free, 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 3748 of file manage.c.

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

Referenced by man_connection_init().

◆ command_line_next()

void command_line_next ( struct command_line cl)

Definition at line 3806 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 3758 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 145 of file manage.h.

References log_history::capacity.

◆ log_history_close()

void log_history_close ( struct log_history h)

Definition at line 3933 of file manage.c.

References free, and log_history_free_contents().

Referenced by man_persist_close().

◆ log_history_init()

struct log_history* log_history_init ( const int  capacity)

Definition at line 3912 of file manage.c.

References ALLOC_OBJ, ASSERT, 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 3982 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 139 of file manage.h.

References log_history::size.

Referenced by man_history().

◆ man_bytecount_output_client()

void man_bytecount_output_client ( struct management man)

◆ man_bytecount_possible_output_client()

static void man_bytecount_possible_output_client ( struct management man)
inlinestatic

◆ management_auth_failure()

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

Definition at line 2983 of file manage.c.

References M_CLIENT, and msg.

Referenced by get_user_pass_cr(), 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 2996 of file manage.c.

References M_CLIENT, and msg.

Referenced by add_option().

◆ management_bytes_in()

static void management_bytes_in ( struct management man,
const int  size 
)
inlinestatic

◆ management_bytes_in_client()

static void management_bytes_in_client ( struct management man,
const int  size 
)
inlinestatic

◆ management_bytes_out()

static void management_bytes_out ( struct management man,
const int  size 
)
inlinestatic

◆ management_bytes_out_client()

static void management_bytes_out_client ( struct management man,
const int  size 
)
inlinestatic

◆ 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_echo()

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

◆ 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_notify()

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

Definition at line 2812 of file manage.c.

References M_CLIENT, and msg.

Referenced by server_pushed_signal().

◆ management_notify_generic()

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

◆ 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 char *  write_peer_info_file,
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 
)

◆ management_query_proxy_enabled()

static bool management_query_proxy_enabled ( const struct management man)
inlinestatic

Definition at line 456 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 450 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 444 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 3995 of file manage.c.

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

Referenced by do_up(), management_bytes_in(), management_sleep(), netsh_command(), open_null(), open_tun(), openvpn_connect(), openvpn_getaddrinfo(), read_incoming_link(), socket_listen_accept(), and socket_restart_pause().

◆ 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 2802 of file manage.c.

References 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.