Classifier Modules
[Classifiers]

Data Structures

struct  rtnl_cls_ops
 Classifier operations. More...

Modules

 Firewall Classifier
 Universal 32-bit Classifier

Classifier Module API



int rtnl_cls_register (struct rtnl_cls_ops *cops)
 Register a classifier module.
int rtnl_cls_unregister (struct rtnl_cls_ops *cops)
 Unregister a classifier module.
struct rtnl_cls_ops__rtnl_cls_lookup_ops (const char *kind)
struct rtnl_cls_opsrtnl_cls_lookup_ops (struct rtnl_cls *cls)
 Lookup classifier operations for a classifier object.

Function Documentation

int rtnl_cls_register ( struct rtnl_cls_ops cops  ) 
Parameters:
cops classifier module operations

Definition at line 38 of file cls_api.c.

References rtnl_cls_ops::co_kind, and rtnl_cls_ops::co_next.

00039 {
00040         struct rtnl_cls_ops *o, **op;
00041 
00042         if (!cops->co_kind)
00043                 BUG();
00044 
00045         for (op = &cls_ops_list; (o = *op) != NULL; op = &o->co_next)
00046                 if (!strcasecmp(cops->co_kind, o->co_kind))
00047                         return nl_errno(EEXIST);
00048 
00049         cops->co_next = NULL;
00050         *op = cops;
00051 
00052         return 0;
00053 }

int rtnl_cls_unregister ( struct rtnl_cls_ops cops  ) 
Parameters:
cops classifier module operations

Definition at line 59 of file cls_api.c.

References rtnl_cls_ops::co_kind, and rtnl_cls_ops::co_next.

00060 {
00061         struct rtnl_cls_ops *o, **op;
00062 
00063         for (op = &cls_ops_list; (o = *op) != NULL; op = &o->co_next)
00064                 if (!strcasecmp(cops->co_kind, o->co_kind))
00065                         break;
00066 
00067         if (!o)
00068                 return nl_errno(ENOENT);
00069 
00070         *op = cops->co_next;
00071 
00072         return 0;
00073 }

struct rtnl_cls_ops* rtnl_cls_lookup_ops ( struct rtnl_cls *  cls  )  [read]
Parameters:
cls Classifier object.
Returns:
Classifier operations or NULL if not found.

Definition at line 92 of file cls_api.c.

00093 {
00094         if (!cls->c_ops)
00095                 cls->c_ops = __rtnl_cls_lookup_ops(cls->c_kind);
00096 
00097         return cls->c_ops;
00098 }


Generated on 30 Oct 2009 for libnl by  doxygen 1.6.1