Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
ematch.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <net/pkt_cls.h>

Go to the source code of this file.

Functions

int tcf_em_register (struct tcf_ematch_ops *ops)
 
 EXPORT_SYMBOL (tcf_em_register)
 
void tcf_em_unregister (struct tcf_ematch_ops *ops)
 
 EXPORT_SYMBOL (tcf_em_unregister)
 
int tcf_em_tree_validate (struct tcf_proto *tp, struct nlattr *nla, struct tcf_ematch_tree *tree)
 
 EXPORT_SYMBOL (tcf_em_tree_validate)
 
void tcf_em_tree_destroy (struct tcf_proto *tp, struct tcf_ematch_tree *tree)
 
 EXPORT_SYMBOL (tcf_em_tree_destroy)
 
int tcf_em_tree_dump (struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv)
 
 EXPORT_SYMBOL (tcf_em_tree_dump)
 
int __tcf_em_tree_match (struct sk_buff *skb, struct tcf_ematch_tree *tree, struct tcf_pkt_info *info)
 
 EXPORT_SYMBOL (__tcf_em_tree_match)
 

Function Documentation

int __tcf_em_tree_match ( struct sk_buff skb,
struct tcf_ematch_tree tree,
struct tcf_pkt_info info 
)

Definition at line 496 of file ematch.c.

EXPORT_SYMBOL ( tcf_em_register  )
EXPORT_SYMBOL ( tcf_em_unregister  )
EXPORT_SYMBOL ( tcf_em_tree_validate  )
EXPORT_SYMBOL ( tcf_em_tree_destroy  )
EXPORT_SYMBOL ( tcf_em_tree_dump  )
EXPORT_SYMBOL ( __tcf_em_tree_match  )
int tcf_em_register ( struct tcf_ematch_ops *  ops)

tcf_em_register - register an extended match

: ematch operations lookup table

This function must be called by ematches to announce their presence. The given must have kind set to a unique identifier and the callback match() must be implemented. All other callbacks are optional and a fallback implementation is used instead.

Returns -EEXISTS if an ematch of the same kind has already registered.

Definition at line 126 of file ematch.c.

void tcf_em_tree_destroy ( struct tcf_proto tp,
struct tcf_ematch_tree tree 
)

tcf_em_tree_destroy - destroy an ematch tree

: classifier kind handle : ematch tree to be deleted

This functions destroys an ematch tree previously created by tcf_em_tree_validate()/tcf_em_tree_change(). You must ensure that the ematch tree is not in use before calling this function.

Definition at line 396 of file ematch.c.

int tcf_em_tree_dump ( struct sk_buff skb,
struct tcf_ematch_tree tree,
int  tlv 
)

tcf_em_tree_dump - dump ematch tree into a rtnl message

: skb holding the rtnl message : ematch tree to be dumped : TLV type to be used to encapsulate the tree

This function dumps a ematch tree into a rtnl message. It is valid to call this function while the ematch tree is in use.

Returns -1 if the skb tailroom is insufficient.

Definition at line 433 of file ematch.c.

int tcf_em_tree_validate ( struct tcf_proto tp,
struct nlattr nla,
struct tcf_ematch_tree tree 
)

tcf_em_tree_validate - validate ematch config TLV and build ematch tree

: classifier kind handle : ematch tree configuration TLV : destination ematch tree variable to store the resulting ematch tree.

This function validates the given configuration TLV and builds an ematch tree in . The resulting tree must later be copied into the private classifier data using tcf_em_tree_change(). You MUST NOT provide the ematch tree variable of the private classifier data directly, the changes would not be locked properly.

Returns a negative error code if the configuration TLV contains errors.

Definition at line 301 of file ematch.c.

void tcf_em_unregister ( struct tcf_ematch_ops *  ops)

tcf_em_unregister - unregster and extended match

: ematch operations lookup table

This function must be called by ematches to announce their disappearance for examples when the module gets unloaded. The parameter must be the same as the one used for registration.

Returns -ENOENT if no matching ematch was found.

Definition at line 158 of file ematch.c.