OpenVPN
|
#include "syshead.h"
#include "error.h"
#include "mss.h"
#include "crypto.h"
#include "ssl_common.h"
#include "memdbg.h"
#include "forward.h"
Go to the source code of this file.
Functions | |
void | mss_fixup_ipv4 (struct buffer *buf, uint16_t maxmss) |
void | mss_fixup_ipv6 (struct buffer *buf, uint16_t maxmss) |
void | mss_fixup_dowork (struct buffer *buf, uint16_t maxmss) |
static size_t | adjust_payload_max_cbc (const struct key_type *kt, size_t target) |
static size_t | get_ip_encap_overhead (const struct options *options, const struct link_socket_info *lsi) |
static void | frame_calculate_fragment (struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi) |
static void | frame_calculate_mssfix (struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi) |
void | frame_calculate_dynamic (struct frame *frame, struct key_type *kt, const struct options *options, struct link_socket_info *lsi) |
Set the –mssfix option. More... | |
void | frame_adjust_path_mtu (struct context *c) |
Checks and adjusts the fragment and mssfix value according to the discovered path mtu value. More... | |
|
inlinestatic |
Definition at line 211 of file mss.c.
References key_type::cipher, cipher_kt_block_size(), cipher_kt_mode_cbc(), and round_down_size().
Referenced by frame_calculate_fragment(), and frame_calculate_mssfix().
void frame_adjust_path_mtu | ( | struct context * | c | ) |
Checks and adjusts the fragment and mssfix value according to the discovered path mtu value.
c | context to adjust |
Definition at line 355 of file mss.c.
References link_socket_addr::actual, openvpn_sockaddr::addr, context::c1, context::c2, options::ce, D_MTU_INFO, datagram_overhead(), link_socket_actual::dest, connection_entry::fragment, connection_entry::fragment_encap, context_2::frame, frame_calculate_dynamic(), context_2::frame_fragment, get_link_socket_info(), key_schedule::key_type, context_1::ks, context_2::link_socket, link_socket_info::lsa, msg, connection_entry::mssfix, connection_entry::mssfix_encap, link_socket::mtu, context::options, link_socket_info::proto, and openvpn_sockaddr::sa.
Referenced by check_fragment().
void frame_calculate_dynamic | ( | struct frame * | frame, |
struct key_type * | kt, | ||
const struct options * | options, | ||
struct link_socket_info * | lsi | ||
) |
Set the –mssfix option.
Definition at line 335 of file mss.c.
References options::ce, connection_entry::fragment, frame_calculate_fragment(), frame_calculate_mssfix(), and connection_entry::mssfix.
Referenced by do_init_fragment(), frame_adjust_path_mtu(), init_instance(), test_mssfix_mtu_calculation(), and tls_session_update_crypto_params_do_work().
|
static |
Definition at line 256 of file mss.c.
References adjust_payload_max_cbc(), calc_packet_id_size_dc(), options::ce, key_type::cipher, cipher_kt_mode_cbc(), clamp_size_to_int(), connection_entry::fragment, connection_entry::fragment_encap, frame_calculate_protocol_header_size(), get_ip_encap_overhead(), and frame::max_fragment_size.
Referenced by frame_calculate_dynamic().
|
static |
Definition at line 287 of file mss.c.
References adjust_payload_max_cbc(), options::ce, frame::extra_tun, frame_calculate_payload_overhead(), frame_calculate_protocol_header_size(), get_ip_encap_overhead(), frame::mss_fix, connection_entry::mssfix, connection_entry::mssfix_encap, and connection_entry::mssfix_fixed.
Referenced by frame_calculate_dynamic().
|
static |
Definition at line 231 of file mss.c.
References link_socket_addr::actual, openvpn_sockaddr::addr, connection_entry::af, options::ce, datagram_overhead(), link_socket_actual::dest, link_socket_info::lsa, connection_entry::proto, link_socket_info::proto, and openvpn_sockaddr::sa.
Referenced by frame_calculate_fragment(), and frame_calculate_mssfix().
void mss_fixup_dowork | ( | struct buffer * | buf, |
uint16_t | maxmss | ||
) |
Definition at line 144 of file mss.c.
References ADJUST_CHECKSUM, BLEN, BPTR, openvpn_tcphdr::check, D_MSS, dmsg, openvpn_tcphdr::doff_res, OPENVPN_TCPH_GET_DOFF, OPENVPN_TCPOLEN_MAXSEG, OPENVPN_TCPOPT_EOL, OPENVPN_TCPOPT_MAXSEG, OPENVPN_TCPOPT_NOP, and verify_align_4.
Referenced by mss_fixup_ipv4(), and mss_fixup_ipv6().
void mss_fixup_ipv4 | ( | struct buffer * | buf, |
uint16_t | maxmss | ||
) |
Definition at line 47 of file mss.c.
References BLEN, BPTR, buf_advance(), openvpn_tcphdr::flags, openvpn_iphdr::frag_off, mss_fixup_dowork(), OPENVPN_IP_OFFMASK, OPENVPN_IPH_GET_LEN, OPENVPN_IPPROTO_TCP, OPENVPN_TCPH_SYN_MASK, openvpn_iphdr::protocol, openvpn_iphdr::tot_len, verify_align_4, and openvpn_iphdr::version_len.
Referenced by process_ip_header().
void mss_fixup_ipv6 | ( | struct buffer * | buf, |
uint16_t | maxmss | ||
) |
Definition at line 87 of file mss.c.
References BLEN, BPTR, buf_advance(), openvpn_tcphdr::flags, mss_fixup_dowork(), openvpn_ipv6hdr::nexthdr, OPENVPN_IPPROTO_TCP, OPENVPN_TCPH_SYN_MASK, openvpn_ipv6hdr::payload_len, and verify_align_4.
Referenced by process_ip_header().