OpenVPN
|
Go to the source code of this file.
Functions | |
static bool | is_ipv_X (int tunnel_type, struct buffer *buf, int ip_ver) |
bool | is_ipv4 (int tunnel_type, struct buffer *buf) |
bool | is_ipv6 (int tunnel_type, struct buffer *buf) |
uint16_t | ip_checksum (const sa_family_t af, const uint8_t *payload, const int len_payload, const uint8_t *src_addr, const uint8_t *dest_addr, const int proto) |
Calculates an IP or IPv6 checksum with a pseudo header as required by TCP, UDP and ICMPv6. More... | |
uint16_t ip_checksum | ( | const sa_family_t | af, |
const uint8_t * | payload, | ||
const int | len_payload, | ||
const uint8_t * | src_addr, | ||
const uint8_t * | dest_addr, | ||
const int | proto | ||
) |
Calculates an IP or IPv6 checksum with a pseudo header as required by TCP, UDP and ICMPv6.
af | - Address family for which the checksum is calculated AF_INET or AF_INET6 |
payload | - the TCP, ICMPv6 or UDP packet |
len_payload | - length of payload |
src_addr | - Source address of the packet |
dest_addr | - Destination address of the packet |
proto | next - header or IP protocol of the packet |
Definition at line 123 of file proto.c.
Referenced by dhcp_extract_router_msg(), and ipv6_send_icmp_unreachable().
bool is_ipv4 | ( | int | tunnel_type, |
struct buffer * | buf | ||
) |
bool is_ipv6 | ( | int | tunnel_type, |
struct buffer * | buf | ||
) |
Definition at line 116 of file proto.c.
References is_ipv_X().
Referenced by ipv6_send_icmp_unreachable(), and process_ip_header().
|
static |
Definition at line 40 of file proto.c.
References BLEN, BPTR, buf_advance(), DEV_TYPE_TAP, DEV_TYPE_TUN, OPENVPN_ETH_P_8021Q, OPENVPN_ETH_P_IPV4, OPENVPN_ETH_P_IPV6, OPENVPN_IPH_GET_VER, openvpn_ethhdr::proto, openvpn_8021qhdr::proto, verify_align_4, and openvpn_iphdr::version_len.