Mitigator BPF API
Functions and types programs can use to filter packets.
IpHeader Struct Reference

IPv4 header. More...

#include <mitigator_bpf.h>

Detailed Description

IPv4 header.

Access the header as follows:

struct IpHeader* ip = packet_network_header(ctx);
void * packet_network_header(Context ctx)
Get packet network header, e.g. IPv4 header.
IPv4 header.
Definition: mitigator_bpf.h:269
Note
This function is for advanced users. Prefer packet_flow() to get addresses. Prefer packet_transport_payload() to access payload and its length.
If you modify the fields of this header and return RESULT_PASS from the filter, call set_packet_mangled() to update checksums.
See also
packet_network_proto() to test if IPv4 header is present.
https://en.wikipedia.org/wiki/IPv4#Packet_structure
https://tools.ietf.org/html/rfc791

The documentation for this struct was generated from the following file: