structudphdr*nfq_udp_get_hdr(structpkt_buff*pktb)
nfq_udp_get_hdr - get the UDP header.
Parameterspktb Pointer to userspace network packet buffer
Returns
validated pointer to the UDP header or NULL if the UDP header was not set or if a minimal length
check fails.
Note
You have to call nfq_ip_set_transport_header() or nfq_ip6_set_transport_header() first to set the UDP
header.
Definition at line 43 of file udp.c.
void*nfq_udp_get_payload(structudphdr*udph,structpkt_buff*pktb)
nfq_udp_get_payload - get the UDP packet payload.
Parametersudph Pointer to UDP header
pktb Pointer to userspace network packet buffer
Returns
Pointer to the UDP payload, or NULL if malformed UDP packet.
Definition at line 62 of file udp.c.
unsignedintnfq_udp_get_payload_len(structudphdr*udph,structpkt_buff*pktb)
nfq_udp_get_payload_len - get the udp packet payload.
Parametersudph Pointer to UDP header
pktb Pointer to userspace network packet buffer
Returns
Length of UDP payload (user data)
Definition at line 84 of file udp.c.
intnfq_udp_mangle_ipv4(structpkt_buff*pktb,unsignedintmatch_offset,unsignedintmatch_len,constchar*rep_buffer,unsignedintrep_len)
nfq_udp_mangle_ipv4 - Mangle UDP/IPv4 packet buffer
Parameterspktb Pointer to network packet buffer
match_offset Offset from start of UDP data of content that you want to mangle
match_len Length of the existing content you want to mangle
rep_buffer Pointer to data you want to use to replace current content
rep_len Length of data you want to use to replace current content
Returns
1 for success and 0 for failure. See pktb_mangle() for failure case
Note
This function updates the IPv4 and UDP lengths and recalculates their checksums for you.
Definition at line 150 of file udp.c.
intnfq_udp_mangle_ipv6(structpkt_buff*pktb,unsignedintmatch_offset,unsignedintmatch_len,constchar*rep_buffer,unsignedintrep_len)
nfq_udp_mangle_ipv6 - Mangle UDP/IPv6 packet buffer
Parameterspktb Pointer to network packet buffer
match_offset Offset from start of UDP data of content that you want to mangle
match_len Length of the existing content you want to mangle
rep_buffer Pointer to data you want to use to replace current content
rep_len Length of data you want to use to replace current content
Returns
1 for success and 0 for failure. See pktb_mangle() for failure case
Note
This function updates the IPv6 and UDP lengths and recalculates the UDP checksum for you.
Definition at line 184 of file udp.c.
intnfq_udp_snprintf(char*buf,size_tsize,conststructudphdr*udph)
nfq_pkt_snprintf_udp_hdr - print udp header into one buffer in a humnan readable way
Parametersbuf pointer to buffer that is used to print the object
size size of the buffer (or remaining room in it).
udph pointer to a valid udp header.
Returns
The number of characters notionally written (excluding trailing NUL)
Seealsosnprintf(3)
Definition at line 220 of file udp.c.