netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
filter.c File Reference
#include "filter.h"
#include "bitops.h"
#include "jhash.h"
#include "hash.h"
#include "vector.h"
#include "conntrackd.h"
#include "log.h"
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
Include dependency graph for filter.c:

Data Structures

struct  ct_filter
 
struct  exp_filter
 
struct  exp_filter_item
 

Macros

#define FILTER_POOL_SIZE   128
 
#define FILTER_POOL_LIMIT   INT_MAX
 

Functions

struct ct_filterct_filter_create (void)
 
void ct_filter_destroy (struct ct_filter *filter)
 
void ct_filter_set_logic (struct ct_filter *filter, enum ct_filter_type type, enum ct_filter_logic logic)
 
int ct_filter_add_ip (struct ct_filter *filter, void *data, uint8_t family)
 
int ct_filter_add_netmask (struct ct_filter *filter, void *data, uint8_t family)
 
void ct_filter_add_proto (struct ct_filter *f, int protonum)
 
void ct_filter_add_state (struct ct_filter *f, int protonum, int val)
 
int ct_filter_conntrack (const struct nf_conntrack *ct, int userspace)
 
int ct_filter_master (const struct nf_conntrack *master)
 
struct exp_filterexp_filter_create (void)
 
int exp_filter_add (struct exp_filter *f, const char *helper_name)
 
int exp_filter_find (struct exp_filter *f, const struct nf_expect *exp)
 

Macro Definition Documentation

#define FILTER_POOL_LIMIT   INT_MAX

Referenced by ct_filter_create().

#define FILTER_POOL_SIZE   128

Referenced by ct_filter_create().

Function Documentation

int ct_filter_add_ip ( struct ct_filter filter,
void *  data,
uint8_t  family 
)
int ct_filter_add_netmask ( struct ct_filter filter,
void *  data,
uint8_t  family 
)

References ct_filter::v, ct_filter::v6, vector_add(), and vector_iterate().

Here is the call graph for this function:

void ct_filter_add_proto ( struct ct_filter f,
int  protonum 
)

References ct_filter::l4protomap.

void ct_filter_add_state ( struct ct_filter f,
int  protonum,
int  val 
)

References ct_filter::statemap.

int ct_filter_conntrack ( const struct nf_conntrack ct,
int  userspace 
)

References STATE.

struct ct_filter* ct_filter_create ( void  )
void ct_filter_destroy ( struct ct_filter filter)

References ct_filter::h, ct_filter::h6, hashtable_destroy(), ct_filter::v, ct_filter::v6, and vector_destroy().

Referenced by ctnl_kill().

Here is the call graph for this function:

Here is the caller graph for this function:

int ct_filter_master ( const struct nf_conntrack master)

References STATE.

void ct_filter_set_logic ( struct ct_filter filter,
enum ct_filter_type  type,
enum ct_filter_logic  logic 
)

References ct_filter::logic, and type.

int exp_filter_add ( struct exp_filter f,
const char *  helper_name 
)
struct exp_filter* exp_filter_create ( void  )
int exp_filter_find ( struct exp_filter f,
const struct nf_expect exp 
)