Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ip_set_core.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/ip.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/netlink.h>
#include <linux/rculist.h>
#include <net/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/ipset/ip_set.h>

Go to the source code of this file.

Macros

#define STREQ(a, b)   (strncmp(a, b, IPSET_MAXNAMELEN) == 0)
 
#define find_set_type_get(name, family, revision, found)   __find_set_type_get(name, family, revision, found, false)
 
#define find_set_type_minmax(name, family, min, max)   __find_set_type_minmax(name, family, min, max, false)
 
#define family_name(f)
 
#define DUMP_INIT   0
 
#define DUMP_ALL   1
 
#define DUMP_ONE   2
 
#define DUMP_LAST   3
 
#define DUMP_TYPE(arg)   (((u32)(arg)) & 0x0000FFFF)
 
#define DUMP_FLAGS(arg)   (((u32)(arg)) >> 16)
 

Functions

 module_param (max_sets, int, 0600)
 
 MODULE_PARM_DESC (max_sets,"maximal number of sets")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Jozsef Kadlecsik <[email protected]>")
 
 MODULE_DESCRIPTION ("core IP set support")
 
 MODULE_ALIAS_NFNL_SUBSYS (NFNL_SUBSYS_IPSET)
 
int ip_set_type_register (struct ip_set_type *type)
 
 EXPORT_SYMBOL_GPL (ip_set_type_register)
 
void ip_set_type_unregister (struct ip_set_type *type)
 
 EXPORT_SYMBOL_GPL (ip_set_type_unregister)
 
voidip_set_alloc (size_t size)
 
 EXPORT_SYMBOL_GPL (ip_set_alloc)
 
void ip_set_free (void *members)
 
 EXPORT_SYMBOL_GPL (ip_set_free)
 
int ip_set_get_ipaddr4 (struct nlattr *nla, __be32 *ipaddr)
 
 EXPORT_SYMBOL_GPL (ip_set_get_ipaddr4)
 
int ip_set_get_ipaddr6 (struct nlattr *nla, union nf_inet_addr *ipaddr)
 
 EXPORT_SYMBOL_GPL (ip_set_get_ipaddr6)
 
int ip_set_test (ip_set_id_t index, const struct sk_buff *skb, const struct xt_action_param *par, const struct ip_set_adt_opt *opt)
 
 EXPORT_SYMBOL_GPL (ip_set_test)
 
int ip_set_add (ip_set_id_t index, const struct sk_buff *skb, const struct xt_action_param *par, const struct ip_set_adt_opt *opt)
 
 EXPORT_SYMBOL_GPL (ip_set_add)
 
int ip_set_del (ip_set_id_t index, const struct sk_buff *skb, const struct xt_action_param *par, const struct ip_set_adt_opt *opt)
 
 EXPORT_SYMBOL_GPL (ip_set_del)
 
ip_set_id_t ip_set_get_byname (const char *name, struct ip_set **set)
 
 EXPORT_SYMBOL_GPL (ip_set_get_byname)
 
void ip_set_put_byindex (ip_set_id_t index)
 
 EXPORT_SYMBOL_GPL (ip_set_put_byindex)
 
const charip_set_name_byindex (ip_set_id_t index)
 
 EXPORT_SYMBOL_GPL (ip_set_name_byindex)
 
ip_set_id_t ip_set_nfnl_get (const char *name)
 
 EXPORT_SYMBOL_GPL (ip_set_nfnl_get)
 
ip_set_id_t ip_set_nfnl_get_byindex (ip_set_id_t index)
 
 EXPORT_SYMBOL_GPL (ip_set_nfnl_get_byindex)
 
void ip_set_nfnl_put (ip_set_id_t index)
 
 EXPORT_SYMBOL_GPL (ip_set_nfnl_put)
 
 module_init (ip_set_init)
 
 module_exit (ip_set_fini)
 

Macro Definition Documentation

#define DUMP_ALL   1

Definition at line 984 of file ip_set_core.c.

#define DUMP_FLAGS (   arg)    (((u32)(arg)) >> 16)

Definition at line 989 of file ip_set_core.c.

#define DUMP_INIT   0

Definition at line 983 of file ip_set_core.c.

#define DUMP_LAST   3

Definition at line 986 of file ip_set_core.c.

#define DUMP_ONE   2

Definition at line 985 of file ip_set_core.c.

#define DUMP_TYPE (   arg)    (((u32)(arg)) & 0x0000FFFF)

Definition at line 988 of file ip_set_core.c.

#define family_name (   f)
Value:
((f) == NFPROTO_IPV4 ? "inet" : \
(f) == NFPROTO_IPV6 ? "inet6" : "any")

Definition at line 169 of file ip_set_core.c.

#define find_set_type_get (   name,
  family,
  revision,
  found 
)    __find_set_type_get(name, family, revision, found, false)

Definition at line 96 of file ip_set_core.c.

#define find_set_type_minmax (   name,
  family,
  min,
  max 
)    __find_set_type_minmax(name, family, min, max, false)

Definition at line 136 of file ip_set_core.c.

#define STREQ (   a,
  b 
)    (strncmp(a, b, IPSET_MAXNAMELEN) == 0)

Definition at line 34 of file ip_set_core.c.

Function Documentation

EXPORT_SYMBOL_GPL ( ip_set_type_register  )
EXPORT_SYMBOL_GPL ( ip_set_type_unregister  )
EXPORT_SYMBOL_GPL ( ip_set_alloc  )
EXPORT_SYMBOL_GPL ( ip_set_free  )
EXPORT_SYMBOL_GPL ( ip_set_get_ipaddr4  )
EXPORT_SYMBOL_GPL ( ip_set_get_ipaddr6  )
EXPORT_SYMBOL_GPL ( ip_set_test  )
EXPORT_SYMBOL_GPL ( ip_set_add  )
EXPORT_SYMBOL_GPL ( ip_set_del  )
EXPORT_SYMBOL_GPL ( ip_set_get_byname  )
EXPORT_SYMBOL_GPL ( ip_set_put_byindex  )
EXPORT_SYMBOL_GPL ( ip_set_name_byindex  )
EXPORT_SYMBOL_GPL ( ip_set_nfnl_get  )
EXPORT_SYMBOL_GPL ( ip_set_nfnl_get_byindex  )
EXPORT_SYMBOL_GPL ( ip_set_nfnl_put  )
int ip_set_add ( ip_set_id_t  index,
const struct sk_buff skb,
const struct xt_action_param par,
const struct ip_set_adt_opt opt 
)

Definition at line 387 of file ip_set_core.c.

void* ip_set_alloc ( size_t  size)

Definition at line 231 of file ip_set_core.c.

int ip_set_del ( ip_set_id_t  index,
const struct sk_buff skb,
const struct xt_action_param par,
const struct ip_set_adt_opt opt 
)

Definition at line 410 of file ip_set_core.c.

void ip_set_free ( void members)

Definition at line 253 of file ip_set_core.c.

ip_set_id_t ip_set_get_byname ( const char name,
struct ip_set **  set 
)

Definition at line 438 of file ip_set_core.c.

int ip_set_get_ipaddr4 ( struct nlattr nla,
__be32 ipaddr 
)

Definition at line 277 of file ip_set_core.c.

int ip_set_get_ipaddr6 ( struct nlattr nla,
union nf_inet_addr ipaddr 
)

Definition at line 294 of file ip_set_core.c.

const char* ip_set_name_byindex ( ip_set_id_t  index)

Definition at line 478 of file ip_set_core.c.

ip_set_id_t ip_set_nfnl_get ( const char name)

Definition at line 502 of file ip_set_core.c.

ip_set_id_t ip_set_nfnl_get_byindex ( ip_set_id_t  index)

Definition at line 522 of file ip_set_core.c.

void ip_set_nfnl_put ( ip_set_id_t  index)

Definition at line 546 of file ip_set_core.c.

void ip_set_put_byindex ( ip_set_id_t  index)

Definition at line 463 of file ip_set_core.c.

int ip_set_test ( ip_set_id_t  index,
const struct sk_buff skb,
const struct xt_action_param par,
const struct ip_set_adt_opt opt 
)

Definition at line 348 of file ip_set_core.c.

int ip_set_type_register ( struct ip_set_type type)

Definition at line 176 of file ip_set_core.c.

void ip_set_type_unregister ( struct ip_set_type type)

Definition at line 210 of file ip_set_core.c.

MODULE_ALIAS_NFNL_SUBSYS ( NFNL_SUBSYS_IPSET  )
MODULE_AUTHOR ( "Jozsef Kadlecsik <[email protected]>"  )
MODULE_DESCRIPTION ( "core IP set support )
module_exit ( ip_set_fini  )
module_init ( ip_set_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( max_sets  ,
int  ,
0600   
)
MODULE_PARM_DESC ( max_sets  ,
"maximal number of sets"   
)