Functions | |
struct iphdr * | nfq_ip_get_hdr (struct pkt_buff *pktb) |
nfq_ip_get_hdr - get IPv4 header More... | |
EXPORT_SYMBOL (nfq_ip_get_hdr) | |
int | nfq_ip_set_transport_header (struct pkt_buff *pktb, struct iphdr *iph) |
nfq_ip_set_transport_header - set transport header More... | |
EXPORT_SYMBOL (nfq_ip_set_transport_header) | |
void | nfq_ip_set_checksum (struct iphdr *iph) |
nfq_ip_set_checksum - set IPv4 checksum More... | |
EXPORT_SYMBOL (nfq_ip_set_checksum) | |
int | nfq_ip_mangle (struct pkt_buff *pkt, 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 More... | |
EXPORT_SYMBOL (nfq_ip_mangle) | |
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 More... | |
EXPORT_SYMBOL (nfq_ip_snprintf) | |
EXPORT_SYMBOL | ( | nfq_ip_get_hdr | ) |
EXPORT_SYMBOL | ( | nfq_ip_set_transport_header | ) |
EXPORT_SYMBOL | ( | nfq_ip_set_checksum | ) |
EXPORT_SYMBOL | ( | nfq_ip_mangle | ) |
EXPORT_SYMBOL | ( | nfq_ip_snprintf | ) |
nfq_ip_get_hdr - get IPv4 header
pktb | pointer to network packet buffer |
This funcion returns NULL if the IPv4 is malformed or the protocol version is not 4. On success, it returns a valid pointer to the IPv4 header.
References pkt_buff::network_header, NULL, and pkt_buff::tail.
int nfq_ip_mangle | ( | struct pkt_buff * | pkt, |
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 network packet buffer |
dataoff | offset to layer 4 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 |
References pkt_buff::len, pkt_buff::network_header, nfq_ip_set_checksum(), and pktb_mangle().
Referenced by nfq_tcp_mangle_ipv4(), and nfq_udp_mangle_ipv4().
void nfq_ip_set_checksum | ( | struct iphdr * | iph | ) |
nfq_ip_set_checksum - set IPv4 checksum
iph | pointer to the IPv4 header |
References nfq_checksum().
Referenced by nfq_ip_mangle().
nfq_ip_set_transport_header - set transport header
pktb | pointer to network packet buffer |
iph | pointer to the IPv4 header |
References pkt_buff::len, pkt_buff::network_header, and pkt_buff::transport_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) |
ip | pointer to a valid IPv4 header |
This function returns the number of bytes that would have been written in case that there is enough room in the buffer. Read snprintf manpage for more information to know more about this strange behaviour.