netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
libarptc_incl.c File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  counter_map
 
struct  arpt_error_target
 
struct  chain_cache
 

Macros

#define CHECK(h)
 

Functions

STRUCT_ENTRY_TARGETGET_TARGET (STRUCT_ENTRY *e)
 
TC_HANDLE_T TC_INIT (const char *tablename)
 
void TC_DUMP_ENTRIES (const TC_HANDLE_T handle)
 
int TC_IS_CHAIN (const char *chain, const TC_HANDLE_T handle)
 
const char * TC_FIRST_CHAIN (TC_HANDLE_T *handle)
 
const char * TC_NEXT_CHAIN (TC_HANDLE_T *handle)
 
const STRUCT_ENTRYTC_FIRST_RULE (const char *chain, TC_HANDLE_T *handle)
 
const STRUCT_ENTRYTC_NEXT_RULE (const STRUCT_ENTRY *prev, TC_HANDLE_T *handle)
 
const char * TC_GET_TARGET (const STRUCT_ENTRY *e, TC_HANDLE_T *handle)
 
int TC_BUILTIN (const char *chain, const TC_HANDLE_T handle)
 
const char * TC_GET_POLICY (const char *chain, STRUCT_COUNTERS *counters, TC_HANDLE_T *handle)
 
int TC_INSERT_ENTRY (const ARPT_CHAINLABEL chain, const STRUCT_ENTRY *e, unsigned int rulenum, TC_HANDLE_T *handle)
 
int TC_REPLACE_ENTRY (const ARPT_CHAINLABEL chain, const STRUCT_ENTRY *e, unsigned int rulenum, TC_HANDLE_T *handle)
 
int TC_APPEND_ENTRY (const ARPT_CHAINLABEL chain, const STRUCT_ENTRY *e, TC_HANDLE_T *handle)
 
int TC_DELETE_ENTRY (const ARPT_CHAINLABEL chain, const STRUCT_ENTRY *origfw, unsigned char *matchmask, TC_HANDLE_T *handle)
 
int TC_DELETE_NUM_ENTRY (const ARPT_CHAINLABEL chain, unsigned int rulenum, TC_HANDLE_T *handle)
 
const char * TC_CHECK_PACKET (const ARPT_CHAINLABEL chain, STRUCT_ENTRY *entry, TC_HANDLE_T *handle)
 
int TC_FLUSH_ENTRIES (const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 
int TC_ZERO_ENTRIES (const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 
STRUCT_COUNTERSTC_READ_COUNTER (const ARPT_CHAINLABEL chain, unsigned int rulenum, TC_HANDLE_T *handle)
 
int TC_ZERO_COUNTER (const ARPT_CHAINLABEL chain, unsigned int rulenum, TC_HANDLE_T *handle)
 
int TC_SET_COUNTER (const ARPT_CHAINLABEL chain, unsigned int rulenum, STRUCT_COUNTERS *counters, TC_HANDLE_T *handle)
 
int TC_CREATE_CHAIN (const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 
int TC_GET_REFERENCES (unsigned int *ref, const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 
int TC_DELETE_CHAIN (const ARPT_CHAINLABEL chain, TC_HANDLE_T *handle)
 
int TC_RENAME_CHAIN (const ARPT_CHAINLABEL oldname, const ARPT_CHAINLABEL newname, TC_HANDLE_T *handle)
 
int TC_SET_POLICY (const ARPT_CHAINLABEL chain, const ARPT_CHAINLABEL policy, STRUCT_COUNTERS *counters, TC_HANDLE_T *handle)
 
int TC_COMMIT (TC_HANDLE_T *handle)
 
int TC_GET_RAW_SOCKET ()
 
const char * TC_STRERROR (int err)
 

Variables

 STRUCT_TC_HANDLE
 
STRUCT_GETINFO info
 
struct counter_mapcounter_map
 
unsigned int cache_num_chains
 
unsigned int cache_num_builtins
 
struct chain_cachecache_chain_heads
 
struct chain_cachecache_chain_iteration
 
STRUCT_ENTRYcache_rule_end
 
unsigned int new_number
 
STRUCT_GET_ENTRIES entries
 

Macro Definition Documentation

Function Documentation

STRUCT_ENTRY_TARGET* GET_TARGET ( STRUCT_ENTRY e)

Referenced by TC_GET_TARGET(), TC_RENAME_CHAIN(), and TC_SET_POLICY().

Here is the caller graph for this function:

int TC_APPEND_ENTRY ( const ARPT_CHAINLABEL  chain,
const STRUCT_ENTRY e,
TC_HANDLE_T handle 
)
int TC_BUILTIN ( const char *  chain,
const TC_HANDLE_T  handle 
)

References RUNTIME_NF_ARP_NUMHOOKS.

Referenced by TC_DELETE_CHAIN(), TC_GET_POLICY(), TC_RENAME_CHAIN(), and TC_SET_POLICY().

Here is the caller graph for this function:

const char* TC_CHECK_PACKET ( const ARPT_CHAINLABEL  chain,
STRUCT_ENTRY entry,
TC_HANDLE_T handle 
)

References NULL.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_COMMIT ( TC_HANDLE_T handle)
int TC_CREATE_CHAIN ( const ARPT_CHAINLABEL  chain,
TC_HANDLE_T handle 
)

References ALIGN, ARPT_CHAINLABEL, ERROR_TARGET, LABEL_ACCEPT, LABEL_DROP, LABEL_QUEUE, LABEL_RETURN, RETURN, STANDARD_TARGET, STRUCT_ENTRY, and STRUCT_STANDARD_TARGET.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_DELETE_CHAIN ( const ARPT_CHAINLABEL  chain,
TC_HANDLE_T handle 
)

References chain_cache::end, chain_cache::start, TC_BUILTIN(), and TC_GET_REFERENCES().

Referenced by TC_STRERROR().

Here is the call graph for this function:

Here is the caller graph for this function:

int TC_DELETE_ENTRY ( const ARPT_CHAINLABEL  chain,
const STRUCT_ENTRY origfw,
unsigned char *  matchmask,
TC_HANDLE_T handle 
)

References dump_entry(), chain_cache::end, NULL, chain_cache::start, STRUCT_ENTRY, and STRUCT_ENTRY_TARGET.

Referenced by TC_STRERROR().

Here is the call graph for this function:

Here is the caller graph for this function:

int TC_DELETE_NUM_ENTRY ( const ARPT_CHAINLABEL  chain,
unsigned int  rulenum,
TC_HANDLE_T handle 
)

References chain_cache::end, NULL, chain_cache::start, and STRUCT_ENTRY.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

void TC_DUMP_ENTRIES ( const TC_HANDLE_T  handle)

References CHECK, dump_entry(), ENTRY_ITERATE, NF_ARP_IN, and NF_ARP_OUT.

Referenced by TC_COMMIT().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* TC_FIRST_CHAIN ( TC_HANDLE_T handle)

References NULL.

const STRUCT_ENTRY* TC_FIRST_RULE ( const char *  chain,
TC_HANDLE_T handle 
)
int TC_FLUSH_ENTRIES ( const ARPT_CHAINLABEL  chain,
TC_HANDLE_T handle 
)
const char* TC_GET_POLICY ( const char *  chain,
STRUCT_COUNTERS counters,
TC_HANDLE_T handle 
)

References hook, NULL, chain_cache::start, STRUCT_ENTRY, and TC_BUILTIN().

Here is the call graph for this function:

int TC_GET_RAW_SOCKET ( )

References sockfd.

int TC_GET_REFERENCES ( unsigned int *  ref,
const ARPT_CHAINLABEL  chain,
TC_HANDLE_T handle 
)

References ENTRY_ITERATE, and chain_cache::start.

Referenced by TC_DELETE_CHAIN().

Here is the caller graph for this function:

const char* TC_GET_TARGET ( const STRUCT_ENTRY e,
TC_HANDLE_T handle 
)
TC_HANDLE_T TC_INIT ( const char *  tablename)
int TC_INSERT_ENTRY ( const ARPT_CHAINLABEL  chain,
const STRUCT_ENTRY e,
unsigned int  rulenum,
TC_HANDLE_T handle 
)

References chain_cache::end, chain_cache::start, STRUCT_ENTRY, and STRUCT_ENTRY_TARGET.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_IS_CHAIN ( const char *  chain,
const TC_HANDLE_T  handle 
)

References NULL.

const char* TC_NEXT_CHAIN ( TC_HANDLE_T handle)

References NULL.

const STRUCT_ENTRY* TC_NEXT_RULE ( const STRUCT_ENTRY prev,
TC_HANDLE_T handle 
)

References NULL.

STRUCT_COUNTERS* TC_READ_COUNTER ( const ARPT_CHAINLABEL  chain,
unsigned int  rulenum,
TC_HANDLE_T handle 
)

References CHECK, chain_cache::end, NULL, chain_cache::start, and STRUCT_ENTRY.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_RENAME_CHAIN ( const ARPT_CHAINLABEL  oldname,
const ARPT_CHAINLABEL  newname,
TC_HANDLE_T handle 
)
int TC_REPLACE_ENTRY ( const ARPT_CHAINLABEL  chain,
const STRUCT_ENTRY e,
unsigned int  rulenum,
TC_HANDLE_T handle 
)

References chain_cache::end, chain_cache::start, STRUCT_ENTRY, and STRUCT_ENTRY_TARGET.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_SET_COUNTER ( const ARPT_CHAINLABEL  chain,
unsigned int  rulenum,
STRUCT_COUNTERS counters,
TC_HANDLE_T handle 
)
int TC_SET_POLICY ( const ARPT_CHAINLABEL  chain,
const ARPT_CHAINLABEL  policy,
STRUCT_COUNTERS counters,
TC_HANDLE_T handle 
)

References GET_TARGET(), hook, LABEL_ACCEPT, LABEL_DROP, NF_ACCEPT, NF_DROP, STRUCT_ENTRY, STRUCT_STANDARD_TARGET, arpt_error_target::t, and TC_BUILTIN().

Referenced by TC_STRERROR().

Here is the call graph for this function:

Here is the caller graph for this function:

int TC_ZERO_COUNTER ( const ARPT_CHAINLABEL  chain,
unsigned int  rulenum,
TC_HANDLE_T handle 
)

References CHECK, chain_cache::end, and chain_cache::start.

Referenced by TC_STRERROR().

Here is the caller graph for this function:

int TC_ZERO_ENTRIES ( const ARPT_CHAINLABEL  chain,
TC_HANDLE_T handle 
)

Variable Documentation

struct chain_cache* cache_chain_heads
struct chain_cache* cache_chain_iteration
unsigned int cache_num_builtins
unsigned int cache_num_chains
STRUCT_ENTRY* cache_rule_end
unsigned int new_number

Referenced by TC_COMMIT().

STRUCT_TC_HANDLE
Initial value:
{
int changed