Modules | |
Class Based Queueing (CBQ) | |
Differentiated Services Marker (DSMARK) | |
Hierachical Token Bucket (HTB) | |
Data Structures | |
struct | rtnl_class_ops |
Class operations. More... | |
Class Module API | |
int | rtnl_class_register (struct rtnl_class_ops *ops) |
Register a class module. | |
int | rtnl_class_unregister (struct rtnl_class_ops *ops) |
Unregister a class module. | |
Class Addition/Modification | |
nl_msg * | rtnl_class_build_add_request (struct rtnl_class *class, int flags) |
Build a netlink message to add a new class. | |
int | rtnl_class_add (struct nl_handle *handle, struct rtnl_class *class, int flags) |
Add a new class. | |
General | |
rtnl_class * | rtnl_class_alloc (void) |
Allocate a new class object. | |
void | rtnl_class_put (struct rtnl_class *class) |
Give back reference on rclass object. | |
void | rtnl_class_free (struct rtnl_class *class) |
Free class object. | |
nl_cache * | rtnl_class_alloc_cache (struct nl_handle *handle, int ifindex) |
Build a class cache including all classes attached to the specified interface. | |
Leaf Qdisc Access | |
int | rtnl_class_has_leaf_qdisc (struct rtnl_class *class) |
Determine if the class has a leaf qdisc attached. | |
rtnl_qdisc * | rtnl_class_leaf_qdisc (struct rtnl_class *class, struct nl_cache *cache) |
Lookup the leaf qdisc of a class. | |
Iterators | |
void | rtnl_class_foreach_child (struct rtnl_class *class, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
Call a callback for each child class of a class. | |
void | rtnl_class_foreach_cls (struct rtnl_class *class, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
Call a callback for each classifier attached to the class. | |
Attribute Modifications | |
void | rtnl_class_set_ifindex (struct rtnl_class *class, int ifindex) |
Set the interface index of a class to the specified value. | |
int | rtnl_class_get_ifindex (struct rtnl_class *class) |
Get the interface index of a class. | |
void | rtnl_class_set_handle (struct rtnl_class *class, uint32_t handle) |
Set the handle of a class to the specified value. | |
uint32_t | rtnl_class_get_handle (struct rtnl_class *class) |
Get the handle of a class. | |
void | rtnl_class_set_parent (struct rtnl_class *class, uint32_t parent) |
Set the parent handle of a class to the specified value. | |
uint32_t | rtnl_class_get_parent (struct rtnl_class *class) |
Get the parent handle of a class. | |
void | rtnl_class_set_kind (struct rtnl_class *class, const char *name) |
Set the kind of a class to the specified value. | |
char * | rtnl_class_get_kind (struct rtnl_class *class) |
Get the kind of a class. | |
uint64_t | rtnl_class_get_stat (struct rtnl_class *class, enum rtnl_tc_stats_id id) |
Get the statistic specified by the id. |
int rtnl_class_register | ( | struct rtnl_class_ops * | ops | ) |
Register a class module.
ops | class module operations |
Definition at line 62 of file class.c.
References rtnl_class_ops::co_kind, and rtnl_class_ops::co_next.
int rtnl_class_unregister | ( | struct rtnl_class_ops * | ops | ) |
Unregister a class module.
ops | class module operations |
Definition at line 83 of file class.c.
References rtnl_class_ops::co_kind, and rtnl_class_ops::co_next.
struct nl_msg* rtnl_class_build_add_request | ( | struct rtnl_class * | class, | |
int | flags | |||
) |
Build a netlink message to add a new class.
class | class to add | |
flags | additional netlink message flags |
Common message flags
Definition at line 275 of file class.c.
References NLM_F_CREATE.
Referenced by rtnl_class_add().
int rtnl_class_add | ( | struct nl_handle * | handle, | |
struct rtnl_class * | class, | |||
int | flags | |||
) |
Add a new class.
handle | netlink handle | |
class | class to delete | |
flags | additional netlink message flags |
Common message flags
Definition at line 295 of file class.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_class_build_add_request().
struct rtnl_class* rtnl_class_alloc | ( | void | ) |
Allocate a new class object.
Definition at line 324 of file class.c.
References nl_object_alloc_from_ops().
Referenced by rtnl_class_foreach_child(), and rtnl_qdisc_foreach_child().
void rtnl_class_put | ( | struct rtnl_class * | class | ) |
Give back reference on rclass object.
class | Class object to be given back. |
Definition at line 336 of file class.c.
References nl_object_put().
Referenced by rtnl_class_foreach_child(), and rtnl_qdisc_foreach_child().
void rtnl_class_free | ( | struct rtnl_class * | class | ) |
Free class object.
class | Class object to be freed. |
Definition at line 348 of file class.c.
References nl_object_free().
struct nl_cache* rtnl_class_alloc_cache | ( | struct nl_handle * | handle, | |
int | ifindex | |||
) |
Build a class cache including all classes attached to the specified interface.
handle | netlink handle | |
ifindex | interface index of the link the classes are attached to. |
Definition at line 366 of file class.c.
References nl_cache_alloc_from_ops(), nl_cache_free(), and nl_cache_update().
int rtnl_class_has_leaf_qdisc | ( | struct rtnl_class * | class | ) |
Determine if the class has a leaf qdisc attached.
class | class to check |
Definition at line 395 of file class.c.
Referenced by rtnl_class_leaf_qdisc().
struct rtnl_qdisc* rtnl_class_leaf_qdisc | ( | struct rtnl_class * | class, | |
struct nl_cache * | cache | |||
) |
Lookup the leaf qdisc of a class.
class | the parent class | |
cache | a qdisc cache including at laest all qdiscs of the interface the specified class is attached to |
Definition at line 407 of file class.c.
References rtnl_class_has_leaf_qdisc(), and rtnl_qdisc_get_by_parent().
void rtnl_class_foreach_child | ( | struct rtnl_class * | class, | |
struct nl_cache * | cache, | |||
void(*)(struct nl_object *, void *) | cb, | |||
void * | arg | |||
) |
Call a callback for each child class of a class.
class | the parent class | |
cache | a class cache including all classes of the interface the specified class is attached to | |
cb | callback function | |
arg | argument to be passed to callback function |
Definition at line 438 of file class.c.
References nl_cache_foreach_filter(), rtnl_class_alloc(), rtnl_class_put(), rtnl_class_set_ifindex(), rtnl_class_set_kind(), and rtnl_class_set_parent().
void rtnl_class_foreach_cls | ( | struct rtnl_class * | class, | |
struct nl_cache * | cache, | |||
void(*)(struct nl_object *, void *) | cb, | |||
void * | arg | |||
) |
Call a callback for each classifier attached to the class.
class | the parent class | |
cache | a filter cache including at least all the filters attached to the specified class | |
cb | callback function | |
arg | argument to be passed to callback function |
Definition at line 463 of file class.c.
References nl_cache_foreach_filter(), rtnl_cls_alloc(), rtnl_cls_put(), rtnl_cls_set_ifindex(), and rtnl_cls_set_parent().
void rtnl_class_set_ifindex | ( | struct rtnl_class * | class, | |
int | ifindex | |||
) |
Set the interface index of a class to the specified value.
class | class to be changed | |
ifindex | new interface index |
Definition at line 491 of file class.c.
Referenced by rtnl_class_foreach_child(), and rtnl_qdisc_foreach_child().
int rtnl_class_get_ifindex | ( | struct rtnl_class * | class | ) |
void rtnl_class_set_handle | ( | struct rtnl_class * | class, | |
uint32_t | handle | |||
) |
uint32_t rtnl_class_get_handle | ( | struct rtnl_class * | class | ) |
void rtnl_class_set_parent | ( | struct rtnl_class * | class, | |
uint32_t | parent | |||
) |
Set the parent handle of a class to the specified value.
class | class to be changed | |
parent | new parent handle |
Definition at line 532 of file class.c.
Referenced by rtnl_class_foreach_child(), and rtnl_qdisc_foreach_child().
uint32_t rtnl_class_get_parent | ( | struct rtnl_class * | class | ) |
void rtnl_class_set_kind | ( | struct rtnl_class * | class, | |
const char * | name | |||
) |
Set the kind of a class to the specified value.
class | class to be changed | |
name | new kind name |
Definition at line 552 of file class.c.
Referenced by rtnl_class_foreach_child(), and rtnl_qdisc_foreach_child().
char* rtnl_class_get_kind | ( | struct rtnl_class * | class | ) |
uint64_t rtnl_class_get_stat | ( | struct rtnl_class * | class, | |
enum rtnl_tc_stats_id | id | |||
) |