OpenVPN
|
#include "syshead.h"
#include "error.h"
#include "buffer.h"
#include "init.h"
#include "misc.h"
#include "win32.h"
#include "socket.h"
#include "tun.h"
#include "otime.h"
#include "perf.h"
#include "status.h"
#include "integer.h"
#include "ps.h"
#include "mstats.h"
Go to the source code of this file.
Macros | |
#define | SWAP { tmp = m1; m1 = m2; m2 = tmp; } |
Functions | |
void | msg_forked (void) |
bool | set_debug_level (const int level, const unsigned int flags) |
bool | set_mute_cutoff (const int cutoff) |
int | get_debug_level (void) |
int | get_mute_cutoff (void) |
void | set_suppress_timestamps (bool suppressed) |
void | set_machine_readable_output (bool parsable) |
void | error_reset (void) |
void | errors_to_stderr (void) |
FILE * | msg_fp (const unsigned int flags) |
void | x_msg (const unsigned int flags, const char *format,...) |
static const char * | openvpn_strerror (int err, bool crt_error, struct gc_arena *gc) |
void | x_msg_va (const unsigned int flags, const char *format, va_list arglist) |
bool | dont_mute (unsigned int flags) |
Check muting filter. More... | |
void | assert_failed (const char *filename, int line, const char *condition) |
void | out_of_memory (void) |
void | open_syslog (const char *pgmname, bool stdio_to_null) |
void | close_syslog (void) |
int | get_orig_stderr () |
void | redirect_stdout_stderr (const char *file, bool append) |
void | reset_check_status (void) |
void | set_check_status (unsigned int info_level, unsigned int verbose_level) |
void | x_check_status (int status, const char *description, struct link_socket *sock, struct tuntap *tt) |
void | openvpn_exit (const int status) |
const char * | msg_flags_string (const unsigned int flags, struct gc_arena *gc) |
const char * | strerror_win32 (DWORD errnum, struct gc_arena *gc) |
Variables | |
unsigned int | x_debug_level |
static int | mute_cutoff |
static int | mute_count |
static int | mute_category |
static bool | std_redir |
static bool | use_syslog |
static bool | machine_readable_output |
static bool | suppress_timestamps |
static FILE * | msgfp |
static bool | forked |
static FILE * | default_out |
static FILE * | default_err |
int | x_msg_line_num |
static int | orig_stderr |
unsigned int | x_cs_info_level |
unsigned int | x_cs_verbose_level |
unsigned int | x_cs_err_delay_ms |
const char * | x_msg_prefix |
const struct virtual_output * | x_msg_virtual_output |
void assert_failed | ( | const char * | filename, |
int | line, | ||
const char * | condition | ||
) |
void close_syslog | ( | void | ) |
bool dont_mute | ( | unsigned int | flags | ) |
void error_reset | ( | void | ) |
Definition at line 161 of file error.c.
References default_err, default_out, machine_readable_output, msgfp, mute_category, mute_count, mute_cutoff, OPENVPN_DEBUG_FILE, openvpn_exit(), OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE, OPENVPN_MSG_FP, std_redir, suppress_timestamps, use_syslog, and x_debug_level.
Referenced by init_static().
void errors_to_stderr | ( | void | ) |
Definition at line 185 of file error.c.
References default_err, and OPENVPN_ERROR_FP.
Referenced by add_option().
int get_debug_level | ( | void | ) |
Definition at line 137 of file error.c.
Referenced by man_dispatch_command().
int get_mute_cutoff | ( | void | ) |
Definition at line 143 of file error.c.
References mute_cutoff.
Referenced by man_dispatch_command().
int get_orig_stderr | ( | ) |
Definition at line 508 of file error.c.
References orig_stderr.
Referenced by get_console_input_win32().
const char* msg_flags_string | ( | const unsigned int | flags, |
struct gc_arena * | gc | ||
) |
Definition at line 783 of file error.c.
References alloc_buf_gc(), BSTR, buf_printf(), M_DEBUG, M_FATAL, M_INFO, M_NONFATAL, and M_WARN.
Referenced by log_entry_print().
FILE* msg_fp | ( | const unsigned int | flags | ) |
Definition at line 194 of file error.c.
References default_err, default_out, M_FATAL, M_USAGE_SMALL, msgfp, openvpn_exit(), and OPENVPN_EXIT_STATUS_CANNOT_OPEN_DEBUG_FILE.
Referenced by usage(), and x_msg_va().
void open_syslog | ( | const char * | pgmname, |
bool | stdio_to_null | ||
) |
Definition at line 467 of file error.c.
References M_WARN, msg, msgfp, PACKAGE, set_std_files_to_null(), std_redir, string_alloc(), and use_syslog.
Referenced by add_option().
void openvpn_exit | ( | const int | status | ) |
Definition at line 735 of file error.c.
References close_syslog(), forked, OPENVPN_EXIT_STATUS_ERROR, OPENVPN_EXIT_STATUS_GOOD, perf_output_results(), plugin_abort(), remove_pid_file(), status, tun_abort(), and uninit_win32().
Referenced by add_option(), error_reset(), msg_fp(), openvpn_main(), usage(), usage_small(), usage_version(), and x_msg_va().
|
static |
Definition at line 222 of file error.c.
References env_set::gc, and strerror_win32().
Referenced by x_check_status(), and x_msg_va().
void out_of_memory | ( | void | ) |
Definition at line 460 of file error.c.
Referenced by check_malloc_return().
void redirect_stdout_stderr | ( | const char * | file, |
bool | append | ||
) |
Definition at line 515 of file error.c.
References ASSERT, gc_free(), gc_new(), M_ERR, M_ERRNO, M_WARN, msg, msgfp, orig_stderr, std_redir, and wide_string().
Referenced by add_option().
void reset_check_status | ( | void | ) |
Definition at line 630 of file error.c.
References x_cs_info_level, and x_cs_verbose_level.
Referenced by init_static().
void set_check_status | ( | unsigned int | info_level, |
unsigned int | verbose_level | ||
) |
Definition at line 637 of file error.c.
References x_cs_info_level, and x_cs_verbose_level.
Referenced by init_verb_mute().
bool set_debug_level | ( | const int | level, |
const unsigned int | flags | ||
) |
Definition at line 105 of file error.c.
References constrain_int(), SDL_CONSTRAIN, and x_debug_level.
Referenced by add_option(), init_verb_mute(), and man_dispatch_command().
void set_machine_readable_output | ( | bool | parsable | ) |
Definition at line 155 of file error.c.
References machine_readable_output.
Referenced by add_option().
bool set_mute_cutoff | ( | const int | cutoff | ) |
Definition at line 123 of file error.c.
References mute_cutoff.
Referenced by init_verb_mute(), and man_dispatch_command().
void set_suppress_timestamps | ( | bool | suppressed | ) |
const char* strerror_win32 | ( | DWORD | errnum, |
struct gc_arena * | gc | ||
) |
Definition at line 812 of file error.c.
Referenced by add_route_ipapi(), close_tun(), del_route_ipapi(), dhcp_release_by_adapter_index(), dhcp_renew_by_adapter_index(), do_address_service(), do_dns_domain_service(), do_dns_service(), do_route_service(), do_set_mtu_service(), do_wins_service(), get_adapter_info_list(), get_default_gateway_ipv6(), get_device_instance_id_interface(), get_interface_info_list(), get_per_adapter_info(), get_windows_routing_table(), openvpn_strerror(), register_dns_service(), route_ipv6_ipapi(), send_msg_iservice(), service_enable_dhcp(), service_register_ring_buffers(), socket_recv_queue(), socket_send_queue(), tun_read_queue(), tun_write_queue(), tuntap_set_ip_addr(), win_wfp_block_service(), win_wfp_msg_handler(), and windows_set_mtu().
void x_check_status | ( | int | status, |
const char * | description, | ||
struct link_socket * | sock, | ||
struct tuntap * | tt | ||
) |
Definition at line 652 of file error.c.
References link_socket_info::af, gc_free(), gc_new(), ignore_sys_error(), link_socket::info, msg, link_socket::mtu, link_socket_info::mtu_changed, openvpn_errno_maybe_crt(), openvpn_strerror(), platform_sleep_milliseconds(), link_socket_info::proto, proto2ascii(), link_socket::sd, SOCKET_PRINTF, status, tap_win_getinfo(), tuntap_defined(), x_cs_err_delay_ms, x_cs_info_level, and x_cs_verbose_level.
Referenced by check_status().
void x_msg | ( | const unsigned int | flags, |
const char * | format, | ||
... | |||
) |
void x_msg_va | ( | const unsigned int | flags, |
const char * | format, | ||
va_list | arglist | ||
) |
Definition at line 234 of file error.c.
Referenced by plugin_vlog(), and x_msg().
|
static |
Definition at line 96 of file error.c.
Referenced by error_reset(), errors_to_stderr(), and msg_fp().
|
static |
Definition at line 95 of file error.c.
Referenced by error_reset(), and msg_fp().
|
static |
Definition at line 92 of file error.c.
Referenced by msg_forked(), openvpn_exit(), and x_msg_va().
|
static |
Definition at line 78 of file error.c.
Referenced by error_reset(), set_machine_readable_output(), show_settings(), and x_msg_va().
|
static |
Definition at line 89 of file error.c.
Referenced by error_reset(), msg_fp(), open_syslog(), and redirect_stdout_stderr().
|
static |
Definition at line 57 of file error.c.
Referenced by dont_mute(), and error_reset().
|
static |
Definition at line 56 of file error.c.
Referenced by dont_mute(), and error_reset().
|
static |
Definition at line 55 of file error.c.
Referenced by dont_mute(), error_reset(), get_mute_cutoff(), and set_mute_cutoff().
|
static |
Definition at line 505 of file error.c.
Referenced by get_console_input_win32(), get_orig_stderr(), and redirect_stdout_stderr().
|
static |
Definition at line 71 of file error.c.
Referenced by error_reset(), open_syslog(), redirect_stdout_stderr(), and x_msg_va().
|
static |
Definition at line 81 of file error.c.
Referenced by error_reset(), set_suppress_timestamps(), show_settings(), and x_msg_va().
|
static |
Definition at line 74 of file error.c.
Referenced by close_syslog(), error_reset(), open_syslog(), and x_msg_va().
unsigned int x_cs_err_delay_ms |
Definition at line 627 of file error.c.
Referenced by set_check_status_error_delay(), and x_check_status().
unsigned int x_cs_info_level |
Definition at line 625 of file error.c.
Referenced by reset_check_status(), set_check_status(), and x_check_status().
unsigned int x_cs_verbose_level |
Definition at line 626 of file error.c.
Referenced by check_status(), reset_check_status(), set_check_status(), and x_check_status().
unsigned int x_debug_level |
Definition at line 52 of file error.c.
Referenced by error_reset(), get_debug_level(), and set_debug_level().
int x_msg_line_num |
Definition at line 210 of file error.c.
Referenced by x_msg_va().
const char* x_msg_prefix |
Definition at line 722 of file error.c.
Referenced by msg_get_prefix(), and msg_set_prefix().
const struct virtual_output* x_msg_virtual_output |
Definition at line 728 of file error.c.
Referenced by msg_get_virtual_output(), and msg_set_virtual_output().