3.13. IPv4

IPv4 protocol API.

class ipv4

IPv4 opaque structure

Public Members

struct packet * packet

struct lua_object lua_object

struct list2_elem frag_list

struct vbuffer_iterator select

struct vbuffer * payload

struct vbuffer packet_payload

struct vbuffer_stream reassembled_payload

size_t reassembled_offset

bool invalid_checksum

bool reassembled

IPv4 address API.

Defines

IPV4_ADDR_STRING_MAXLEN

String max size for converting ipv4addr to string.

Typedefs

typedef uint32 ipv4addr

IPv4 address type.

Functions

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 API.

Defines

IPV4_NETWORK_STRING_MAXLEN

String max size for converting ipv4network to string.

Functions

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.

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

Variables

const ipv4network ipv4_network_zero

IPv4 network initializer.

class ipv4network

IPv4 network.

Public Members

ipv4addr net

uint8 mask

3.14. TCP

class tcp

Opaque TCP dissector data.

Public Members

struct ipv4 * packet

struct lua_object lua_object

struct vbuffer payload

struct vbuffer_iterator select

bool modified

bool invalid_checksum

Functions

bool tcp_stream_create(struct tcp_stream * stream)

Create a new tcp stream.

void tcp_stream_clear(struct tcp_stream * stream)

void tcp_stream_init(struct tcp_stream * stream, uint32 seq)

Initialize the stream sequence number. This function must be called before starting pushing packet into the stream.

bool tcp_stream_push(struct tcp_stream * stream, struct tcp * tcp, struct vbuffer_iterator * current)

Push data into a tcp stream.

Return
true if successful, false otherwise (see clear_error() to get more details about the error).

struct tcp * tcp_stream_pop(struct tcp_stream * stream)

Pop data from a tcp stream.

Return
A tcp packet if available. This function will pop all packets that have data before the current position in the stream.

void tcp_stream_ack(struct tcp_stream * stream, struct tcp * tcp)

Offset the ack number of the packet.

void tcp_stream_seq(struct tcp_stream * stream, struct tcp * tcp)

Offset the seq number of the packet.

uint32 tcp_stream_lastseq(struct tcp_stream * stream)

Get last sequence number for this tcp stream.

class tcp_stream

TCP stream structure.

Public Members

struct lua_object lua_object

uint32 start_seq

uint64 last_seq

uint64 last_sent_seq

int64 first_offset_seq

uint64 sent_offset_seq

struct list2 current

struct list2 queued

struct list2 sent

struct vbuffer_stream stream