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))
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))
55#define IOW_TO_TUN (1<<0)
56#define IOW_TO_LINK (1<<1)
57#define IOW_READ_TUN (1<<2)
58#define IOW_READ_LINK (1<<3)
59#define IOW_SHAPER (1<<4)
60#define IOW_CHECK_RESIDUAL (1<<5)
61#define IOW_FRAG (1<<6)
62#define IOW_MBUF (1<<7)
63#define IOW_READ_TUN_FORCE (1<<8)
64#define IOW_WAIT_SIGNAL (1<<9)
66#define IOW_READ (IOW_READ_TUN|IOW_READ_LINK)
295 const char *str,
int msglevel);
306#define PIPV4_PASSTOS (1<<0)
307#define PIP_MSSFIX (1<<1)
308#define PIP_OUTGOING (1<<2)
309#define PIPV4_EXTRACT_DHCP_ROUTER (1<<3)
310#define PIPV4_CLIENT_NAT (1<<4)
311#define PIPV6_ICMP_NOHOST_CLIENT (1<<5)
312#define PIPV6_ICMP_NOHOST_SERVER (1<<6)
351static inline unsigned int
366 flags &= ~IOW_READ_TUN;
383 unsigned int ret = 0;
409 unsigned int ret = 0;
static unsigned int p2p_iow_flags(const struct context *c)
counter_type link_write_bytes_global
void reschedule_multi_process(struct context *c)
Reschedule tls_multi_process.
int get_server_poll_remaining_time(struct event_timeout *server_poll_timeout)
bool send_control_channel_string_dowork(struct tls_session *session, const char *str, int msglevel)
void process_io(struct context *c, struct link_socket *sock)
bool schedule_exit(struct context *c)
bool send_control_channel_string(struct context *c, const char *str, int msglevel)
static void io_wait(struct context *c, const unsigned int flags)
static struct link_socket_info * get_link_socket_info(struct context *c)
void get_io_flags_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
void pre_select(struct context *c)
#define IOW_CHECK_RESIDUAL
static bool connection_established(struct context *c)
static void register_activity(struct context *c, const int size)
void get_io_flags_dowork_udp(struct context *c, struct multi_io *multi_io, const unsigned int flags)
counter_type link_read_bytes_global
void io_wait_dowork(struct context *c, const unsigned int flags)
void process_ip_header(struct context *c, unsigned int flags, struct buffer *buf, struct link_socket *sock)
void encrypt_sign(struct context *c, bool comp_frag)
Process a data channel packet that will be sent through a VPN tunnel.
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_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 process_outgoing_link(struct context *c, struct link_socket *sock)
Write a packet to the external network interface.
void read_incoming_link(struct context *c, struct link_socket *sock)
Read a packet from the external network interface.
void read_incoming_tun(struct context *c)
Read a packet from the virtual tun/tap network interface.
void process_incoming_tun(struct context *c, struct link_socket *out_sock)
Process a packet read from the virtual tun/tap network interface.
void process_outgoing_tun(struct context *c, struct link_socket *in_sock)
Write a packet to the virtual tun/tap network interface.
static void event_timeout_reset(struct event_timeout *et)
Resets a timer.
static bool proto_is_dgram(int proto)
Return if the protocol is datagram (UDP)
@ CAS_WAITING_OPTIONS_IMPORT
client with pull or p2p waiting for first time options import
Wrapper structure for dynamically allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
struct tuntap * tuntap
Tun/tap virtual network interface.
unsigned int event_set_status
struct tls_multi * tls_multi
TLS state structure for this VPN tunnel.
struct link_socket ** link_sockets
struct link_socket_info ** link_socket_infos
struct event_timeout inactivity_interval
Contains all state information for one tunnel.
struct context_2 c2
Level 2 context.
struct options options
Options loaded from command line or configuration file.
struct context_1 c1
Level 1 context.
bool connection_established
struct link_socket_info info
int64_t inactivity_minimum_bytes
enum multi_status multi_state
Security parameter state of a single session within a VPN tunnel.
static bool tuntap_is_wintun(struct tuntap *tt)
static bool tuntap_ring_empty(struct tuntap *tt)