3.7. IPv4

3.7.1. Types

struct ipv4

Opaque IPv4 dissector data.


IPv4 address structure.


IPv4 network structure.

ipv4addr net
uint8 mask

3.7.2. Functions

IPv4 address

void ipv4_addr_to_string(ipv4addr addr, char *string, size_t size)

Convert IP from ipv4addr to string.

ipv4addr ipv4_addr_from_string(const char *string)

Convert IP from string to ipv4addr structure.

ipv4addr ipv4_addr_from_bytes(uint8 a, uint8 b, uint8 c, uint8 d)

Convert IP from bytes to ipv4addr.

IPv4 network

const ipv4network ipv4_network_zero
void ipv4_network_to_string(ipv4network net, char *string, size_t size)

Convert network address from ipv4network to string.

ipv4network ipv4_network_from_string(const char *string)

Convert network address from string to ipv4network structure.

uint8 ipv4_network_contains(ipv4network network, ipv4addr addr)

Checks if IPv4 address is in network range.

Returns:True if ip address is in network range and False otherwise.