Smart Home firewall
Profile-based Smart Home firewall
|
Parser for layer 3 and 4 headers (currently only IPv4, IPv6, UDP and TCP) More...
#include "header.h"
Functions | |
size_t | get_ipv4_header_length (uint8_t *data) |
size_t | get_ipv6_header_length (uint8_t *data) |
size_t | get_udp_header_length (uint8_t *data) |
size_t | get_tcp_header_length (uint8_t *data) |
size_t | get_l3_header_length (uint8_t *data) |
size_t | get_headers_length (uint8_t *data) |
uint16_t | get_udp_payload_length (uint8_t *data) |
Retrieve the length of a UDP payload. More... | |
uint16_t | get_dst_port (uint8_t *data) |
Retrieve the source port from a layer 4 header. More... | |
uint32_t | get_ipv4_src_addr (uint8_t *data) |
Retrieve the source address from an IPv4 header. More... | |
uint32_t | get_ipv4_dst_addr (uint8_t *data) |
Retrieve the destination address from an IPv4 header. More... | |
uint8_t * | get_ipv6_src_addr (uint8_t *data) |
Retrieve the source address from an IPv6 header. More... | |
uint8_t * | get_ipv6_dst_addr (uint8_t *data) |
Retrieve the destination address from an IPv6 header. More... | |
Parser for layer 3 and 4 headers (currently only IPv4, IPv6, UDP and TCP)
Parser for layer 3 and 4 headers. Currently supported protocols:
uint16_t get_dst_port | ( | uint8_t * | data | ) |
Retrieve the source port from a layer 4 header.
data | pointer to the start of the layer 4 header |
size_t get_headers_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's layer-3 and layer-4 headers.
data | a pointer to the start of the packet's layer-3 header |
uint32_t get_ipv4_dst_addr | ( | uint8_t * | data | ) |
Retrieve the destination address from an IPv4 header.
data | pointer to the start of the IPv4 header |
size_t get_ipv4_header_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's IPv4 header.
data | a pointer to the start of the packet's IPv4 header |
uint32_t get_ipv4_src_addr | ( | uint8_t * | data | ) |
Retrieve the source address from an IPv4 header.
data | pointer to the start of the IPv4 header |
uint8_t* get_ipv6_dst_addr | ( | uint8_t * | data | ) |
Retrieve the destination address from an IPv6 header.
data | pointer to the start of the IPv6 header |
size_t get_ipv6_header_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's IPv6 header.
data | a pointer to the start of the packet's IPv6 header |
uint8_t* get_ipv6_src_addr | ( | uint8_t * | data | ) |
Retrieve the source address from an IPv6 header.
data | pointer to the start of the IPv6 header |
size_t get_l3_header_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's layer 3 header (IPv4 or IPv6).
data | a pointer to the start of the packet's layer 3 header |
size_t get_tcp_header_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's TCP header.
data | a pointer to the start of the packet's TCP (layer 4) header |
size_t get_udp_header_length | ( | uint8_t * | data | ) |
Retrieve the length of a packet's UDP header.
data | a pointer to the start of the packet's UDP (layer 4) header |
uint16_t get_udp_payload_length | ( | uint8_t * | data | ) |
Retrieve the length of a UDP payload.
data | pointer to the start of the UDP header |