|
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 "status.h"#include "integer.h"#include "ps.h"#include "mstats.h"
Go to the source code of this file.
Macros | |
| #define | SWAP |
Functions | |
| void | msg_forked (void) |
| bool | set_debug_level (const int level, const unsigned int flags) |
| bool | set_mute_cutoff (const int cutoff) |
| msglvl_t | 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 msglvl_t flags) |
| void | x_msg (const msglvl_t flags, const char *format,...) |
| static const char * | openvpn_strerror (int err, bool crt_error, struct gc_arena *gc) |
| void | x_msg_va (const msglvl_t flags, const char *format, va_list arglist) |
| bool | dont_mute (msglvl_t flags) |
| Check muting filter. | |
| 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) |
| 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 msglvl_t flags, struct gc_arena *gc) |
| const char * | strerror_win32 (DWORD errnum, struct gc_arena *gc) |
Variables | |
| msglvl_t | x_debug_level |
| static int | mute_cutoff |
| static int | mute_count |
| static msglvl_t | 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 |
| #define SWAP |
| void assert_failed | ( | const char * | filename, |
| int | line, | ||
| const char * | condition | ||
| ) |
| void close_syslog | ( | void | ) |
| bool dont_mute | ( | msglvl_t | flags | ) |
Check muting filter.
Definition at line 385 of file error.c.
References DECODE_MUTE_LEVEL, M_INFO, M_NOMUTE, msg, mute_category, mute_count, and mute_cutoff.
Referenced by x_msg_va().
| void error_reset | ( | void | ) |
Definition at line 157 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 181 of file error.c.
References default_err, and OPENVPN_ERROR_FP.
Referenced by add_option().
| msglvl_t get_debug_level | ( | void | ) |
Definition at line 133 of file error.c.
References x_debug_level.
Referenced by man_dispatch_command().
| int get_mute_cutoff | ( | void | ) |
Definition at line 139 of file error.c.
References mute_cutoff.
Referenced by man_dispatch_command().
| int get_orig_stderr | ( | void | ) |
Definition at line 486 of file error.c.
References orig_stderr.
Referenced by get_console_input_win32().
Definition at line 745 of file error.c.
References alloc_buf_gc(), BSTR, buf_printf(), gc, M_DEBUG, M_FATAL, M_INFO, M_NONFATAL, and M_WARN.
Referenced by log_entry_print().
| FILE * msg_fp | ( | const msglvl_t | flags | ) |
Definition at line 190 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 444 of file error.c.
References M_WARN, msg, msgfp, 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 702 of file error.c.
References close_syslog(), forked, OPENVPN_EXIT_STATUS_ERROR, 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 223 of file error.c.
References gc, and strerror_win32().
Referenced by x_check_status(), and x_msg_va().
| void out_of_memory | ( | void | ) |
Definition at line 437 of file error.c.
Referenced by check_malloc_return().
| void redirect_stdout_stderr | ( | const char * | file, |
| bool | append | ||
| ) |
Definition at line 493 of file error.c.
References ASSERT, gc, 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 604 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 611 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 103 of file error.c.
References constrain_int(), M_DEBUG_LEVEL, 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 151 of file error.c.
References machine_readable_output.
Referenced by add_option().
| bool set_mute_cutoff | ( | const int | cutoff | ) |
Definition at line 119 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 774 of file error.c.
References alloc_buf_gc(), BSTR, buf_printf(), gc, buffer::len, SIZE, status, and utf16to8().
Referenced by add_route_ipapi(), close_tun(), del_route_ipapi(), dhcp_release_by_adapter_index(), dhcp_renew_by_adapter_index(), do_address_service(), do_create_adapter_service(), do_dns_domain_service(), do_dns_service(), do_route_service(), do_set_mtu_service(), do_wins_service(), get_adapter_info_list(), get_best_route(), 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(), 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 626 of file error.c.
References link_socket_info::af, gc, 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 msglvl_t | flags, |
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 214 of file error.c.
References x_msg_va().
| void x_msg_va | ( | const msglvl_t | flags, |
| const char * | format, | ||
| va_list | arglist | ||
| ) |
Definition at line 235 of file error.c.
References check_debug_level(), DEBUG_LEVEL_USEC_TIME, dont_mute(), ERR_BUF_SIZE, forked, gc, gc_free(), gc_init(), gc_malloc(), M_ERRNO, M_FATAL, M_INFO, M_MSG_VIRT_OUT, M_NOIPREFIX, M_NOLF, M_NONFATAL, M_NOPREFIX, M_OPTERR, M_USAGE_SMALL, M_WARN, machine_readable_output, msg, msg_fp(), msg_get_prefix(), msg_get_virtual_output(), msg_test(), openvpn_errno_maybe_crt(), openvpn_exit(), OPENVPN_EXIT_STATUS_ERROR, openvpn_strerror(), std_redir, suppress_timestamps, SWAP, time_string(), usage_small(), use_syslog, virtual_output_print(), and x_msg_line_num.
Referenced by plugin_vlog(), x_msg(), and x_msg().
|
static |
Definition at line 94 of file error.c.
Referenced by error_reset(), errors_to_stderr(), and msg_fp().
|
static |
Definition at line 93 of file error.c.
Referenced by error_reset(), and msg_fp().
|
static |
Definition at line 90 of file error.c.
Referenced by msg_forked(), openvpn_exit(), and x_msg_va().
|
static |
Definition at line 76 of file error.c.
Referenced by error_reset(), set_machine_readable_output(), show_settings(), and x_msg_va().
|
static |
Definition at line 87 of file error.c.
Referenced by error_reset(), msg_fp(), open_syslog(), and redirect_stdout_stderr().
|
static |
Definition at line 55 of file error.c.
Referenced by dont_mute(), and error_reset().
|
static |
Definition at line 54 of file error.c.
Referenced by dont_mute(), and error_reset().
|
static |
Definition at line 53 of file error.c.
Referenced by dont_mute(), error_reset(), get_mute_cutoff(), and set_mute_cutoff().
|
static |
Definition at line 483 of file error.c.
Referenced by get_console_input_win32(), get_orig_stderr(), and redirect_stdout_stderr().
|
static |
Definition at line 69 of file error.c.
Referenced by error_reset(), open_syslog(), redirect_stdout_stderr(), and x_msg_va().
|
static |
Definition at line 79 of file error.c.
Referenced by error_reset(), set_suppress_timestamps(), show_settings(), and x_msg_va().
|
static |
Definition at line 72 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 601 of file error.c.
Referenced by set_check_status_error_delay(), and x_check_status().
| unsigned int x_cs_info_level |
Definition at line 599 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 600 of file error.c.
Referenced by check_status(), reset_check_status(), set_check_status(), and x_check_status().
| msglvl_t x_debug_level |
Definition at line 50 of file error.c.
Referenced by error_reset(), get_debug_level(), and set_debug_level().
| int x_msg_line_num |
Definition at line 211 of file error.c.
Referenced by x_msg_va().
| const char* x_msg_prefix |
Definition at line 689 of file error.c.
Referenced by msg_get_prefix(), and msg_set_prefix().
| const struct virtual_output* x_msg_virtual_output |
Definition at line 695 of file error.c.
Referenced by msg_get_virtual_output(), and msg_set_virtual_output().