libnetfilter_conntrack  1.0.6
Functions
Send commands to kernel-space and receive replies

Functions

int nfct_query (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 
int nfct_send (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 
int nfct_catch (struct nfct_handle *h)
 
int nfexp_query (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 
int nfexp_send (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 
int nfexp_catch (struct nfct_handle *h)
 

Detailed Description

Function Documentation

int nfct_catch ( struct nfct_handle *  h)

nfct_catch - catch events

Parameters
hlibrary handler

This function receives the event from the kernel and it invokes the callback that was registered to this handle.

On error, -1 is returned and errno is set appropiately. On success, a value greater or equal to 0 is returned indicating the callback verdict: NFCT_CB_STOP, NFCT_CB_CONTINUE or NFCT_CB_STOLEN.

Beware that this function also handles expectation events, in case they are received through this handle.

Definition at line 1020 of file conntrack/api.c.

int nfct_query ( struct nfct_handle *  h,
const enum nf_conntrack_query  qt,
const void *  data 
)

nfct_query - send a query to ctnetlink and handle the reply

Parameters
hlibrary handler
qtquery type
datadata required to send the query

On error, -1 is returned and errno is explicitely set. On success, 0 is returned.

Definition at line 954 of file conntrack/api.c.

int nfct_send ( struct nfct_handle *  h,
const enum nf_conntrack_query  qt,
const void *  data 
)

nfct_send - send a query to ctnetlink

Parameters
hlibrary handler
qtquery type
datadata required to send the query

Like nfct_query but we do not wait for the reply from ctnetlink. You can use nfct_send() and nfct_catch() to emulate nfct_query(). This is particularly useful when the socket is non-blocking.

On error, -1 is returned and errno is explicitely set. On success, 0 is returned.

Definition at line 986 of file conntrack/api.c.

int nfexp_catch ( struct nfct_handle *  h)

nfexp_catch - catch events

Parameters
hlibrary handler

This function receives the event from the kernel and it invokes the callback that was registered to this handle.

On error, -1 is returned and errno is set appropiately. On success, a value greater or equal to 0 is returned indicating the callback verdict: NFCT_CB_STOP, NFCT_CB_CONTINUE or NFCT_CB_STOLEN.

Beware that this function is equivalent to nfct_catch(), so it handles both conntrack and expectation events.

Definition at line 733 of file expect/api.c.

int nfexp_query ( struct nfct_handle *  h,
const enum nf_conntrack_query  qt,
const void *  data 
)

nfexp_query - send a query to ctnetlink

Parameters
hlibrary handler
qtquery type
datadata required to send the query

On error, -1 is returned and errno is explicitely set. On success, 0 is returned.

Definition at line 668 of file expect/api.c.

int nfexp_send ( struct nfct_handle *  h,
const enum nf_conntrack_query  qt,
const void *  data 
)

nfexp_send - send a query to ctnetlink

Parameters
hlibrary handler
qtquery type
datadata required to send the query

Like nfexp_query but we do not wait for the reply from ctnetlink. You can use nfexp_send() and nfexp_catch() to emulate nfexp_query(). This is particularly useful when the socket is non-blocking.

On error, -1 is returned and errno is explicitely set. On success, 0 is returned.

Definition at line 700 of file expect/api.c.