Go to the documentation of this file.
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)
284 const char *str,
int msglevel);
295 #define PIPV4_PASSTOS (1<<0)
296 #define PIP_MSSFIX (1<<1)
297 #define PIP_OUTGOING (1<<2)
298 #define PIPV4_EXTRACT_DHCP_ROUTER (1<<3)
299 #define PIPV4_CLIENT_NAT (1<<4)
300 #define PIPV6_ICMP_NOHOST_CLIENT (1<<5)
301 #define PIPV6_ICMP_NOHOST_SERVER (1<<6)
339 static inline unsigned int
370 unsigned int ret = 0;
396 unsigned int ret = 0;
unsigned int event_set_status
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.
struct tls_multi * tls_multi
TLS state structure for this VPN tunnel.
int len
Length in bytes of the actual content within the allocated memory.
struct tuntap * tuntap
Tun/tap virtual network interface.
static bool tuntap_is_wintun(struct tuntap *tt)
int64_t inactivity_minimum_bytes
Contains all state information for one tunnel.
counter_type link_write_bytes_global
static void register_activity(struct context *c, const int size)
struct event_timeout inactivity_interval
struct link_socket_info * link_socket_info
This variable is used instead link_socket->info for P2MP UDP childs.
bool schedule_exit(struct context *c)
void process_outgoing_tun(struct context *c)
Write a packet to the virtual tun/tap network interface.
enum multi_status multi_state
struct context_2 c2
Level 2 context.
void pre_select(struct context *c)
void encrypt_sign(struct context *c, bool comp_frag)
Process a data channel packet that will be sent through a VPN tunnel.
void process_io(struct context *c)
static void io_wait(struct context *c, const unsigned int flags)
void process_ip_header(struct context *c, unsigned int flags, struct buffer *buf)
void io_wait_dowork(struct context *c, const unsigned int flags)
struct options options
Options loaded from command line or configuration file.
void read_incoming_tun(struct context *c)
Read a packet from the virtual tun/tap network interface.
void reschedule_multi_process(struct context *c)
Reschedule tls_multi_process.
bool send_control_channel_string_dowork(struct tls_session *session, const char *str, int msglevel)
static bool tuntap_ring_empty(struct tuntap *tt)
static struct link_socket_info * get_link_socket_info(struct context *c)
Wrapper structure for dynamically allocated memory.
struct link_socket_info info
Security parameter state of a single session within a VPN tunnel.
struct link_socket * link_socket
int get_server_poll_remaining_time(struct event_timeout *server_poll_timeout)
bool connection_established
#define IOW_CHECK_RESIDUAL
@ CAS_WAITING_OPTIONS_IMPORT
client with pull or p2p waiting for first time options import
void read_incoming_link(struct context *c)
Read a packet from the external network interface.
counter_type link_read_bytes_global
static unsigned int p2p_iow_flags(const struct context *c)
bool send_control_channel_string(struct context *c, const char *str, int msglevel)
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.
void process_incoming_tun(struct context *c)
Process a packet read from the virtual tun/tap network interface.
static void event_timeout_reset(struct event_timeout *et)
Resets a timer.
void process_outgoing_link(struct context *c)
Write a packet to the external network interface.
struct context_1 c1
Level 1 context.
static bool connection_established(struct context *c)