38 #define TUN_OUT(c) (BLEN(&(c)->c2.to_tun) > 0) 39 #define LINK_OUT(c) (BLEN(&(c)->c2.to_link) > 0) 40 #define ANY_OUT(c) (TUN_OUT(c) || LINK_OUT(c)) 42 #ifdef ENABLE_FRAGMENT 43 #define TO_LINK_FRAG(c) ((c)->c2.fragment && fragment_outgoing_defined((c)->c2.fragment)) 45 #define TO_LINK_FRAG(c) (false) 48 #define TO_LINK_DEF(c) (LINK_OUT(c) || TO_LINK_FRAG(c)) 54 #define IOW_TO_TUN (1<<0) 55 #define IOW_TO_LINK (1<<1) 56 #define IOW_READ_TUN (1<<2) 57 #define IOW_READ_LINK (1<<3) 58 #define IOW_SHAPER (1<<4) 59 #define IOW_CHECK_RESIDUAL (1<<5) 60 #define IOW_FRAG (1<<6) 61 #define IOW_MBUF (1<<7) 62 #define IOW_READ_TUN_FORCE (1<<8) 63 #define IOW_WAIT_SIGNAL (1<<9) 65 #define IOW_READ (IOW_READ_TUN|IOW_READ_LINK) 86 #ifdef ENABLE_FRAGMENT 318 const char *str,
int msglevel);
320 #define PIPV4_PASSTOS (1<<0) 321 #define PIP_MSSFIX (1<<1) 322 #define PIP_OUTGOING (1<<2) 323 #define PIPV4_EXTRACT_DHCP_ROUTER (1<<3) 324 #define PIPV4_CLIENT_NAT (1<<4) 325 #define PIPV6_IMCP_NOHOST_CLIENT (1<<5) 326 #define PIPV6_IMCP_NOHOST_SERVER (1<<6) 366 static inline unsigned int 393 unsigned int ret = 0;
411 #define CONNECTION_ESTABLISHED(c) (get_link_socket_info(c)->connection_established) void check_tls_dowork(struct context *c)
bool send_control_channel_string(struct context *c, const char *str, int msglevel)
static void register_activity(struct context *c, const int size)
void check_add_routes_dowork(struct context *c)
struct options options
Options loaded from command line or configuration file.
Contains all state information for one tunnel.
Security parameter state for a single VPN tunnel.
int inactivity_minimum_bytes
struct link_socket_info * link_socket_info
struct link_socket_info info
void read_incoming_link(struct context *c)
Read a packet from the external network interface.
void encrypt_sign(struct context *c, bool comp_frag)
Process a data channel packet that will be sent through a VPN tunnel.
int len
Length in bytes of the actual content within the allocated memory.
void process_io(struct context *c)
struct event_timeout inactivity_interval
void pre_select(struct context *c)
void process_ip_header(struct context *c, unsigned int flags, struct buffer *buf)
static struct link_socket_info * get_link_socket_info(struct context *c)
static void event_timeout_reset(struct event_timeout *et)
void io_wait_dowork(struct context *c, const unsigned int flags)
void show_wait_status(struct context *c)
void check_inactivity_timeout_dowork(struct context *c)
void check_incoming_control_channel_dowork(struct context *c)
void check_fragment_dowork(struct context *c)
static void io_wait(struct context *c, const unsigned int flags)
void process_outgoing_link(struct context *c)
Write a packet to the external network interface.
unsigned int counter_type
struct link_socket * link_socket
void check_push_request_dowork(struct context *c)
struct context_2 c2
Level 2 context.
void read_incoming_tun(struct context *c)
Read a packet from the virtual tun/tap network interface.
counter_type link_read_bytes_global
void check_tls_errors_co(struct context *c)
Wrapper structure for dynamically allocated memory.
#define IOW_CHECK_RESIDUAL
void check_server_poll_timeout_dowork(struct context *c)
void check_connection_established_dowork(struct context *c)
Garbage collection arena used to keep track of dynamically allocated memory.
void check_status_file_dowork(struct context *c)
void check_scheduled_exit_dowork(struct context *c)
void process_incoming_link_part2(struct context *c, struct link_socket_info *lsi, const uint8_t *orig_buf)
Continues processing a packet read from the external network interface.
void check_tls_errors_nco(struct context *c)
int get_server_poll_remaining_time(struct event_timeout *server_poll_timeout)
static unsigned int p2p_iow_flags(const struct context *c)
bool process_incoming_link_part1(struct context *c, struct link_socket_info *lsi, bool floated)
Starts processing a packet read from the external network interface.
bool send_control_channel_string_dowork(struct tls_multi *multi, const char *str, int msglevel)
unsigned int event_set_status
void process_incoming_tun(struct context *c)
Process a packet read from the virtual tun/tap network interface.
const char * wait_status_string(struct context *c, struct gc_arena *gc)
void process_outgoing_tun(struct context *c)
Write a packet to the virtual tun/tap network interface.
void schedule_exit(struct context *c, const int n_seconds, const int signal)
counter_type link_write_bytes_global