00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NETLINK_CLS_EMATCH_H_
00013 #define NETLINK_CLS_EMATCH_H_
00014
00015 #include <netlink/netlink.h>
00016 #include <netlink/route/classifier.h>
00017 #include <linux/pkt_cls.h>
00018
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022
00023 struct rtnl_ematch;
00024 struct rtnl_ematch_tree;
00025
00026 struct rtnl_ematch_ops
00027 {
00028 int eo_kind;
00029 const char * eo_name;
00030 size_t eo_datalen;
00031
00032 int (*eo_parse)(struct rtnl_ematch *,
00033 void *, size_t);
00034 void (*eo_dump)(struct rtnl_ematch *,
00035 struct nl_dump_params *);
00036 struct nl_list_head eo_list;
00037 };
00038
00039 extern int rtnl_ematch_register(struct rtnl_ematch_ops *);
00040 extern int rtnl_ematch_unregister(struct rtnl_ematch_ops *);
00041
00042 extern struct rtnl_ematch_ops *
00043 rtnl_ematch_lookup_ops(int);
00044 extern struct rtnl_ematch_ops *
00045 rtnl_ematch_lookup_ops_name(const char *);
00046
00047 extern struct rtnl_ematch *
00048 rtnl_ematch_alloc(struct rtnl_ematch_ops *);
00049 extern void rtnl_ematch_add_child(struct rtnl_ematch *,
00050 struct rtnl_ematch *);
00051 extern void rtnl_ematch_unlink(struct rtnl_ematch *);
00052 extern void rtnl_ematch_free(struct rtnl_ematch *);
00053
00054 extern void * rtnl_ematch_data(struct rtnl_ematch *);
00055 extern void rtnl_ematch_set_flags(struct rtnl_ematch *, uint16_t);
00056 extern void rtnl_ematch_unset_flags(struct rtnl_ematch *, uint16_t);
00057 extern uint16_t rtnl_ematch_get_flags(struct rtnl_ematch *);
00058
00059 extern struct rtnl_ematch_tree *
00060 rtnl_ematch_tree_alloc(uint16_t);
00061 extern void rtnl_ematch_tree_free(struct rtnl_ematch_tree *);
00062
00063 extern int rtnl_ematch_parse(struct nlattr *, struct rtnl_ematch_tree **);
00064 extern void rtnl_ematch_tree_add_tail(struct rtnl_ematch_tree *,
00065 struct rtnl_ematch *);
00066 extern void rtnl_ematch_tree_dump(struct rtnl_ematch_tree *,
00067 struct nl_dump_params *);
00068
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072
00073 #endif