54#define ETHERNET_MTU 1500
60#define TUN_MTU_MIN 100
65#define LINK_MTU_DEFAULT 1500
70#define TUN_MTU_DEFAULT 1500
75#define TAP_MTU_EXTRA_DEFAULT 32
80#define MSSFIX_DEFAULT 1492
85#define TLS_MTU_DEFAULT 1250
91#define PAYLOAD_ALIGN 4
172#define BUF_SIZE(f) ((f)->buf.headroom + (f)->buf.payload_size + (f)->buf.tailroom)
276#if EXTENDED_SOCKET_ERROR_CAPABILITY
278void set_sock_extended_error_passing(
int sd,
sa_family_t proto_af);
280const char *format_extended_socket_error(
int fd,
int *mtu,
struct gc_arena *
gc);
void frame_print(const struct frame *frame, int level, const char *prefix)
size_t frame_calculate_payload_size(const struct frame *frame, const struct options *options, const struct key_type *kt)
Calculates the size of the payload according to tun-mtu and tap overhead.
int translate_mtu_discover_type_name(const char *name)
size_t calc_options_string_link_mtu(const struct options *options, const struct frame *frame)
Calculate the link-mtu to advertise to our peer.
size_t frame_calculate_protocol_header_size(const struct key_type *kt, const struct options *options, bool occ)
Calculates the size of the OpenVPN protocol header.
unsigned int calc_packet_id_size_dc(const struct options *options, const struct key_type *kt)
Return the size of the packet ID size that is currently in use by cipher and options for the data cha...
void alloc_buf_sock_tun(struct buffer *buf, const struct frame *frame)
void set_mtu_discover_type(socket_descriptor_t sd, int mtu_type, sa_family_t proto_af)
size_t frame_calculate_payload_overhead(size_t extra_tun, const struct options *options, const struct key_type *kt)
Calculates the size of the payload overhead according to tun-mtu and tap overhead.
Wrapper structure for dynamically allocated memory.
Packet geometry parameters.
int tun_mtu
the (user) configured tun-mtu.
int payload_size
the maximum size that a payload that our buffers can hold from either tun device or network link.
int tun_max_mtu
the maximum tun-mtu size the buffers are are sized for.
int extra_tun
Maximum number of bytes in excess of the tun/tap MTU that might be read from or written to the virtua...
int headroom
the headroom in the buffer, this is choosen to allow all potential header to be added before the pack...
uint16_t mss_fix
The actual MSS value that should be written to the payload packets.
int max_fragment_size
The maximum size of a fragment.
int tailroom
the tailroom in the buffer.
Garbage collection arena used to keep track of dynamically allocated memory.
unsigned short sa_family_t
SOCKET socket_descriptor_t