libnetfilter_queue
1.0.5
|
Modules | |
Internal IP functions | |
Functions | |
struct iphdr * | nfq_ip_get_hdr (struct pkt_buff *pktb) |
int | nfq_ip_set_transport_header (struct pkt_buff *pktb, struct iphdr *iph) |
int | nfq_ip_mangle (struct pkt_buff *pktb, unsigned int dataoff, unsigned int match_offset, unsigned int match_len, const char *rep_buffer, unsigned int rep_len) |
int | nfq_ip_snprintf (char *buf, size_t size, const struct iphdr *iph) |
struct iphdr* nfq_ip_get_hdr | ( | struct pkt_buff * | pktb | ) |
nfq_ip_get_hdr - get the IPv4 header
pktb | Pointer to user-space network packet buffer |
Many programs will not need to call this function. A possible use is to determine the layer 4 protocol. The validation is that the buffer is big enough for the declared lengths in the header, i.e. an extra check for packet truncation.
int nfq_ip_mangle | ( | struct pkt_buff * | pktb, |
unsigned int | dataoff, | ||
unsigned int | match_offset, | ||
unsigned int | match_len, | ||
const char * | rep_buffer, | ||
unsigned int | rep_len | ||
) |
nfq_ip_mangle - mangle IPv4 packet buffer
pktb | Pointer to user-space network packet buffer |
dataoff | Offset to layer 4 header, or zero to mangle IP header |
match_offset | Offset to 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 |
int nfq_ip_set_transport_header | ( | struct pkt_buff * | pktb, |
struct iphdr * | iph | ||
) |
nfq_ip_set_transport_header - set the transport_header field in pktb
pktb | Pointer to user-space network packet buffer |
iph | Pointer to the IPv4 header |
int nfq_ip_snprintf | ( | char * | buf, |
size_t | size, | ||
const struct iphdr * | iph | ||
) |
nfq_pkt_snprintf_ip - print IPv4 header into buffer in iptables LOG format
buf | Pointer to buffer that will be used to print the header |
size | Size of the buffer (or remaining room in it) |
iph | Pointer to a valid IPv4 header |