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

TCP header. More...

#include <mitigator_bpf.h>

Detailed Description

TCP header.

Access this header after checking transport protocol:

struct TcpHeader* tcp = packet_transport_header(ctx);
...
}
Note
This function is for advanced users. Prefer packet_flow() to get ports. 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
https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure
https://tools.ietf.org/html/rfc793

The documentation for this struct was generated from the following file:
packet_transport_proto
uint8_t packet_transport_proto(Context ctx)
Get packet transport protocol code, e.g. TCP, UDP, or ICMP.
TcpHeader
TCP header.
Definition: mitigator_bpf.h:249
IP_PROTO_TCP
@ IP_PROTO_TCP
Definition: mitigator_bpf.h:280
packet_transport_header
void * packet_transport_header(Context ctx)
Get packet transport header, e.g. TCP header.