3.5. Packet

struct packet

Opaque packet structure.

filter_result
FILTER_ACCEPT
FILTER_DROP
size_t packet_length(struct packet *pkt)

Get the length of a packet.

const uint8 *packet_data(struct packet *pkt)

Get the data of a packet.

const char *packet_dissector(struct packet *pkt)

Get packet dissector to use.

uint8 *packet_data_modifiable(struct packet *pkt)

Make a packet modifiable.

int packet_resize(struct packet *pkt, size_t size)

Resize a packet.

void packet_drop(struct packet *pkt)

Drop a packet. The packet will be released and should not be used anymore after this call.

void packet_accept(struct packet *pkt);

Accept a packet. The packet will be released and should not be used anymore after this call.

int packet_receive(struct packet_module_state *state, struct packet **pkt)

Receive a packet from the capture module. This function will wait if no packet is available.