netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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)
 nfct_query - send a query to ctnetlink and handle the reply More...
 
int nfct_send (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 nfct_send - send a query to ctnetlink More...
 
int nfct_catch (struct nfct_handle *h)
 nfct_catch - catch events More...
 
int nfexp_query (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 nfexp_query - send a query to ctnetlink More...
 
int nfexp_send (struct nfct_handle *h, const enum nf_conntrack_query qt, const void *data)
 nfexp_send - send a query to ctnetlink More...
 
int nfexp_catch (struct nfct_handle *h)
 nfexp_catch - catch events More...
 

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.

References nfnl_catch(), nfct_handle::nfnlh, and NULL.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References nfnl_query(), nfct_handle::nfnlh, nfct_handle::nfnlssh_ct, NULL, and size.

Referenced by main(), nl_create_conntrack(), nl_destroy_conntrack(), nl_dump_conntrack_table(), nl_flush_conntrack_table_selective(), nl_get_conntrack(), and nl_update_conntrack().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References nfnl_send(), nfct_handle::nfnlh, nfct_handle::nfnlssh_ct, NULL, and size.

Referenced by nl_send_resync().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References nfnl_catch(), nfct_handle::nfnlh, and NULL.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References nfnl_query(), nfct_handle::nfnlh, nfct_handle::nfnlssh_exp, NULL, and size.

Referenced by main(), nl_create_expect(), nl_destroy_expect(), nl_dump_expect_table(), nl_flush_expect_table(), and nl_get_expect().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References nfnl_send(), nfct_handle::nfnlh, nfct_handle::nfnlssh_exp, NULL, and size.

Referenced by nl_send_expect_resync().

Here is the call graph for this function:

Here is the caller graph for this function: