libnetfilter_cthelper  1.0.0
Functions
Accounting object handling

Functions

struct nfct_helpernfct_helper_alloc (void)
 
void nfct_helper_free (struct nfct_helper *h)
 
struct nfct_helper_policynfct_helper_policy_alloc (void)
 
void nfct_helper_policy_free (struct nfct_helper_policy *p)
 
void nfct_helper_policy_attr_set (struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const void *data)
 
void nfct_helper_policy_attr_set_str (struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, const char *name)
 
void nfct_helper_policy_attr_set_u32 (struct nfct_helper_policy *p, enum nfct_helper_policy_attr_type type, uint32_t value)
 
void nfct_helper_attr_set (struct nfct_helper *h, enum nfct_helper_attr_type type, const void *data)
 
void nfct_helper_attr_set_str (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, const char *name)
 
void nfct_helper_attr_set_u8 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint8_t value)
 
void nfct_helper_attr_set_u16 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint16_t value)
 
void nfct_helper_attr_set_u32 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type, uint32_t value)
 
void nfct_helper_attr_unset (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
 
const void * nfct_helper_attr_get (struct nfct_helper *helper, enum nfct_helper_attr_type type)
 
const char * nfct_helper_attr_get_str (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
 
uint8_t nfct_helper_attr_get_u8 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
 
uint16_t nfct_helper_attr_get_u16 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
 
uint32_t nfct_helper_attr_get_u32 (struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
 
int nfct_helper_snprintf (char *buf, size_t size, struct nfct_helper *helper, unsigned int type, unsigned int flags)
 

Detailed Description

Function Documentation

struct nfct_helper* nfct_helper_alloc ( void  )

nfct_helper_alloc - allocate a new helper object

In case of success, this function returns a valid pointer, otherwise NULL s returned and errno is appropriately set.

Definition at line 102 of file libnetfilter_cthelper.c.

const void* nfct_helper_attr_get ( struct nfct_helper helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_get - get one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

This function returns a valid pointer to the attribute data. If a unsupported attribute is used, this returns NULL.

Definition at line 320 of file libnetfilter_cthelper.c.

const char* nfct_helper_attr_get_str ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_get_str - get one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

This function returns a valid pointer to the beginning of the string. If the attribute is unsupported, this returns NULL.

Definition at line 372 of file libnetfilter_cthelper.c.

uint16_t nfct_helper_attr_get_u16 ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_get_u16 - get one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

This function returns a unsigned 16-bits integer. If the attribute is unsupported, this returns NULL.

Definition at line 402 of file libnetfilter_cthelper.c.

uint32_t nfct_helper_attr_get_u32 ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_get_u32 - get one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

This function returns a unsigned 32-bits integer. If the attribute is unsupported, this returns NULL.

Definition at line 417 of file libnetfilter_cthelper.c.

uint8_t nfct_helper_attr_get_u8 ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_get_u8 - get one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

This function returns a unsigned 8-bits integer. If the attribute is unsupported, this returns NULL.

Definition at line 387 of file libnetfilter_cthelper.c.

void nfct_helper_attr_set ( struct nfct_helper h,
enum nfct_helper_attr_type  type,
const void *  data 
)

nfct_helper_attr_set - set one attribute of the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set
datapointer to data that will be used to set this attribute

Definition at line 206 of file libnetfilter_cthelper.c.

void nfct_helper_attr_set_str ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type,
const char *  name 
)

nfct_helper_attr_set_str - set one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set
namestring that will be used to set this attribute

Definition at line 262 of file libnetfilter_cthelper.c.

void nfct_helper_attr_unset ( struct nfct_helper nfct_helper,
enum nfct_helper_attr_type  type 
)

nfct_helper_attr_unset - unset one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set

Definition at line 299 of file libnetfilter_cthelper.c.

void nfct_helper_free ( struct nfct_helper h)

nfct_helper_free - release one helper object

Parameters
nfct_helperpointer to the helper object

Definition at line 112 of file libnetfilter_cthelper.c.

struct nfct_helper_policy* nfct_helper_policy_alloc ( void  )

nfct_helper_policy_alloc - allocate a new helper policy object

In case of success, this function returns a valid pointer, otherwise NULL s returned and errno is appropriately set.

Definition at line 130 of file libnetfilter_cthelper.c.

void nfct_helper_policy_attr_set ( struct nfct_helper_policy p,
enum nfct_helper_policy_attr_type  type,
const void *  data 
)

nfct_helper_policy_attr_set - set one attribute of the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set
datapointer to data that will be used to set this attribute

Definition at line 153 of file libnetfilter_cthelper.c.

void nfct_helper_policy_attr_set_str ( struct nfct_helper_policy p,
enum nfct_helper_policy_attr_type  type,
const char *  name 
)

nfct_helper_attr_set_str - set one attribute the helper object

Parameters
nfct_helperpointer to the helper object
typeattribute type you want to set
namestring that will be used to set this attribute

Definition at line 182 of file libnetfilter_cthelper.c.

void nfct_helper_policy_free ( struct nfct_helper_policy p)

nfct_helper_free - release one helper policy object

Parameters
nfct_helperpointer to the helper object

Definition at line 140 of file libnetfilter_cthelper.c.

int nfct_helper_snprintf ( char *  buf,
size_t  size,
struct nfct_helper helper,
unsigned int  type,
unsigned int  flags 
)

nfct_helper_snprintf - print helper object into one buffer

Parameters
bufpointer to buffer that is used to print the object
sizesize of the buffer (or remaining room in it).
nfct_helperpointer to a valid helper object.
flagsoutput flags (NFCTH_SNPRINTF_F_FULL).

This function returns -1 in case that some mandatory attributes are missing. On sucess, it returns 0.

Definition at line 434 of file libnetfilter_cthelper.c.