libnetfilter_queue  1.0.5
Functions
IPv6 helper functions

Functions

struct ip6_hdr * nfq_ip6_get_hdr (struct pkt_buff *pktb)
 
int nfq_ip6_set_transport_header (struct pkt_buff *pktb, struct ip6_hdr *ip6h, uint8_t target)
 
int nfq_ip6_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_ip6_snprintf (char *buf, size_t size, const struct ip6_hdr *ip6h)
 

Detailed Description

Function Documentation

◆ nfq_ip6_get_hdr()

struct ip6_hdr* nfq_ip6_get_hdr ( struct pkt_buff *  pktb)

nfq_ip6_get_hdr - get IPv6 header

Parameters
pktbPointer to user-space network packet buffer
Returns
pointer to IPv6 header if a valid header found, else NULL.

Definition at line 36 of file ipv6.c.

◆ nfq_ip6_mangle()

int nfq_ip6_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_ip6_mangle - mangle IPv6 packet buffer

Parameters
pktbPointer to user-space network packet buffer
dataoffOffset to layer 4 header
match_offsetOffset to content that you want to mangle
match_lenLength of the existing content you want to mangle
rep_bufferPointer to data you want to use to replace current content
rep_lenLength 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 length (if necessary)

Definition at line 131 of file ipv6.c.

◆ nfq_ip6_set_transport_header()

int nfq_ip6_set_transport_header ( struct pkt_buff *  pktb,
struct ip6_hdr *  ip6h,
uint8_t  target 
)

nfq_ip6_set_transport_header - set transport header pointer for IPv6 packet

Parameters
pktbPointer to user-space network packet buffer
ip6hPointer to IPv6 header
targetProtocol number to find transport header (ie. IPPROTO_*)
Returns
1 if the protocol has been found and the transport header has been set, else 0.

Definition at line 64 of file ipv6.c.

◆ nfq_ip6_snprintf()

int nfq_ip6_snprintf ( char *  buf,
size_t  size,
const struct ip6_hdr *  ip6h 
)

nfq_ip6_snprintf - print IPv6 header into one buffer in iptables LOG format

Parameters
bufPointer to buffer that is used to print the object
sizeSize of the buffer (or remaining room in it).
ip6hPointer to a valid IPv6 header.
Returns
same as snprintf
See also
snprintf(3)

Definition at line 158 of file ipv6.c.