Modules | |
Firewall Classifier | |
Universal 32-bit Classifier | |
Data Structures | |
struct | rtnl_cls_ops |
Classifier operations. More... | |
Classifier Module API | |
int | rtnl_cls_register (struct rtnl_cls_ops *ops) |
Register a classifier module. | |
int | rtnl_cls_unregister (struct rtnl_cls_ops *ops) |
Unregister a classifier module. | |
Classifier Addition/Modification/Deletion | |
nl_msg * | rtnl_cls_build_add_request (struct rtnl_cls *cls, int flags) |
Build a netlink message to add a new classifier. | |
int | rtnl_cls_add (struct nl_handle *handle, struct rtnl_cls *cls, int flags) |
Add a new classifier. | |
nl_msg * | rtnl_cls_build_change_request (struct rtnl_cls *cls, int flags) |
Build a netlink message to change classifier attributes. | |
int | rtnl_cls_change (struct nl_handle *handle, struct rtnl_cls *cls, int flags) |
Change a classifier. | |
nl_msg * | rtnl_cls_build_delete_request (struct rtnl_cls *cls, int flags) |
Build a netlink request message to delete a classifier. | |
int | rtnl_cls_delete (struct nl_handle *handle, struct rtnl_cls *cls, int flags) |
Delete a classifier. | |
General API | |
rtnl_cls * | rtnl_cls_alloc (void) |
Allocate a new classifier object. | |
void | rtnl_cls_put (struct rtnl_cls *cls) |
Give back reference on classifier object. | |
void | rtnl_cls_free (struct rtnl_cls *cls) |
Free classifier object. | |
nl_cache * | rtnl_cls_alloc_cache (struct nl_handle *handle, int ifindex, uint32_t parent) |
Build a classifier cache including all classifiers attached to the specified class/qdisc on eht specified interface. | |
void | rtnl_cls_set_ifindex (struct rtnl_cls *f, int ifindex) |
Allocate a new classifier object. | |
void | rtnl_cls_set_handle (struct rtnl_cls *f, uint32_t handle) |
Allocate a new classifier object. | |
void | rtnl_cls_set_parent (struct rtnl_cls *f, uint32_t parent) |
Allocate a new classifier object. | |
void | rtnl_cls_set_kind (struct rtnl_cls *f, const char *kind) |
Allocate a new classifier object. | |
void | rtnl_cls_set_prio (struct rtnl_cls *cls, int prio) |
Set prioroty of a classifier. | |
int | rtnl_cls_get_prio (struct rtnl_cls *cls) |
Get priority of a classifier. | |
void | rtnl_cls_set_protocol (struct rtnl_cls *cls, int protocol) |
Set protocol of a classifier. | |
int | rtnl_cls_get_protocol (struct rtnl_cls *cls) |
Get protocol of a classifier. |
int rtnl_cls_register | ( | struct rtnl_cls_ops * | ops | ) |
Register a classifier module.
ops | classifier module operations |
Definition at line 73 of file classifier.c.
References rtnl_cls_ops::co_kind, and rtnl_cls_ops::co_next.
int rtnl_cls_unregister | ( | struct rtnl_cls_ops * | ops | ) |
Unregister a classifier module.
ops | classifier module operations |
Definition at line 94 of file classifier.c.
References rtnl_cls_ops::co_kind, and rtnl_cls_ops::co_next.
struct nl_msg* rtnl_cls_build_add_request | ( | struct rtnl_cls * | cls, | |
int | flags | |||
) |
Build a netlink message to add a new classifier.
cls | classifier to add | |
flags | additional netlink message flags |
rtnl_cls_set_*
functions. opts may point to the clsasifier specific options.
Definition at line 292 of file classifier.c.
References NLM_F_CREATE.
Referenced by rtnl_cls_add().
int rtnl_cls_add | ( | struct nl_handle * | handle, | |
struct rtnl_cls * | cls, | |||
int | flags | |||
) |
Add a new classifier.
handle | netlink handle | |
cls | classifier to add | |
flags | additional netlink message flags |
Definition at line 309 of file classifier.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_cls_build_add_request().
struct nl_msg* rtnl_cls_build_change_request | ( | struct rtnl_cls * | cls, | |
int | flags | |||
) |
Build a netlink message to change classifier attributes.
cls | classifier to change | |
flags | additional netlink message flags |
Definition at line 338 of file classifier.c.
References NLM_F_REPLACE.
Referenced by rtnl_cls_change().
int rtnl_cls_change | ( | struct nl_handle * | handle, | |
struct rtnl_cls * | cls, | |||
int | flags | |||
) |
Change a classifier.
handle | netlink handle | |
cls | classifier to change | |
flags | additional netlink message flags |
Definition at line 355 of file classifier.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_cls_build_change_request().
struct nl_msg* rtnl_cls_build_delete_request | ( | struct rtnl_cls * | cls, | |
int | flags | |||
) |
Build a netlink request message to delete a classifier.
cls | classifier to delete | |
flags | additional netlink message flags |
Definition at line 385 of file classifier.c.
Referenced by rtnl_cls_delete().
int rtnl_cls_delete | ( | struct nl_handle * | handle, | |
struct rtnl_cls * | cls, | |||
int | flags | |||
) |
Delete a classifier.
handle | netlink handle | |
cls | classifier to delete | |
flags | additional netlink message flags |
Definition at line 403 of file classifier.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_cls_build_delete_request().
struct rtnl_cls* rtnl_cls_alloc | ( | void | ) |
Allocate a new classifier object.
Definition at line 431 of file classifier.c.
References nl_object_alloc_from_ops().
Referenced by rtnl_class_foreach_cls(), and rtnl_qdisc_foreach_cls().
void rtnl_cls_put | ( | struct rtnl_cls * | cls | ) |
Give back reference on classifier object.
cls | Classifier object to be given back. |
Definition at line 443 of file classifier.c.
References nl_object_put().
Referenced by rtnl_class_foreach_cls(), and rtnl_qdisc_foreach_cls().
void rtnl_cls_free | ( | struct rtnl_cls * | cls | ) |
Free classifier object.
cls | Classifier object to be freed. |
Definition at line 455 of file classifier.c.
References nl_object_free().
struct nl_cache* rtnl_cls_alloc_cache | ( | struct nl_handle * | handle, | |
int | ifindex, | |||
uint32_t | parent | |||
) |
Build a classifier cache including all classifiers attached to the specified class/qdisc on eht specified interface.
handle | netlink handle | |
ifindex | interface index of the link the classes are attached to. | |
parent | parent qdisc/class |
Definition at line 475 of file classifier.c.
References nl_cache_alloc_from_ops(), nl_cache_free(), and nl_cache_update().
void rtnl_cls_set_ifindex | ( | struct rtnl_cls * | f, | |
int | ifindex | |||
) |
Allocate a new classifier object.
Definition at line 495 of file classifier.c.
Referenced by rtnl_class_foreach_cls(), and rtnl_qdisc_foreach_cls().
void rtnl_cls_set_handle | ( | struct rtnl_cls * | f, | |
uint32_t | handle | |||
) |
Allocate a new classifier object.
Definition at line 500 of file classifier.c.
void rtnl_cls_set_parent | ( | struct rtnl_cls * | f, | |
uint32_t | parent | |||
) |
Allocate a new classifier object.
Definition at line 505 of file classifier.c.
Referenced by rtnl_class_foreach_cls(), and rtnl_qdisc_foreach_cls().
void rtnl_cls_set_kind | ( | struct rtnl_cls * | f, | |
const char * | kind | |||
) |
Allocate a new classifier object.
Definition at line 510 of file classifier.c.
void rtnl_cls_set_prio | ( | struct rtnl_cls * | cls, | |
int | prio | |||
) |
Set prioroty of a classifier.
cls | classifier to change | |
prio | new priority |
Definition at line 520 of file classifier.c.
int rtnl_cls_get_prio | ( | struct rtnl_cls * | cls | ) |
Get priority of a classifier.
cls | classifier |
Definition at line 530 of file classifier.c.
void rtnl_cls_set_protocol | ( | struct rtnl_cls * | cls, | |
int | protocol | |||
) |
Set protocol of a classifier.
cls | classifier to change | |
protocol | protocol identifier (ETH_P_xxx) in host byte-order |
Definition at line 543 of file classifier.c.
int rtnl_cls_get_protocol | ( | struct rtnl_cls * | cls | ) |
Get protocol of a classifier.
cls | classifier |
Definition at line 553 of file classifier.c.