|
Modules | |
| Class Modules | |
| Class Object | |
Addition/Modification | |
| int | rtnl_class_build_add_request (struct rtnl_class *class, int flags, struct nl_msg **result) |
| Build a netlink message to add a new class. More... | |
| int | rtnl_class_add (struct nl_sock *sk, struct rtnl_class *class, int flags) |
| Add a new class. More... | |
| int | rtnl_class_build_delete_request (struct rtnl_class *class, struct nl_msg **result) |
| int | rtnl_class_delete (struct nl_sock *sk, struct rtnl_class *class) |
| Delete a class. More... | |
Cache Management | |
| int | rtnl_class_alloc_cache (struct nl_sock *sk, int ifindex, struct nl_cache **result) |
| Build a class cache including all classes attached to the specified interface. More... | |
| struct rtnl_class * | rtnl_class_get (struct nl_cache *cache, int ifindex, uint32_t handle) |
| Look up class by its handle in the provided cache. More... | |
| int rtnl_class_add | ( | struct nl_sock * | sk, |
| struct rtnl_class * | class, | ||
| int | flags | ||
| ) |
Add a new class.
Builds a netlink message by calling rtnl_qdisc_build_add_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been processed.
Common message flags
References nl_send_auto_complete(), nlmsg_free(), and rtnl_class_build_add_request().

Build a class cache including all classes attached to the specified interface.
Allocates a new cache, initializes it properly and updates it to include all classes attached to the specified interface.
References nl_cache::c_iarg1, nl_cache_alloc(), nl_cache_free(), nl_cache_refill(), and NLE_NOMEM.

| int rtnl_class_build_add_request | ( | struct rtnl_class * | class, |
| int | flags, | ||
| struct nl_msg ** | result | ||
| ) |
Build a netlink message to add a new class.
Builds a new netlink message requesting an addition of a class. The netlink message header isn't fully equipped with all relevant fields and must be sent out via nl_send_auto_complete() or supplemented as needed.
Common message flags
References NLM_F_CREATE, and RTM_NEWTCLASS.
Referenced by rtnl_class_add().

| int rtnl_class_build_delete_request | ( | struct rtnl_class * | class, |
| struct nl_msg ** | result | ||
| ) |
References BUG, NLE_MSGSIZE, NLE_NOMEM, NLMSG_ALIGNTO, nlmsg_alloc_simple(), nlmsg_append(), nlmsg_free(), RTM_DELTCLASS, TCA_ATTR_IFINDEX, TCA_ATTR_PARENT, tcmsg::tcm_family, tcmsg::tcm_handle, tcmsg::tcm_ifindex, and tcmsg::tcm_parent.
Referenced by rtnl_class_delete().


| int rtnl_class_delete | ( | struct nl_sock * | sk, |
| struct rtnl_class * | class | ||
| ) |
Delete a class.
Builds a netlink message by calling rtnl_class_build_delete_request(), sends the request to the kernel and waits for the ACK to be received and thus blocks until the request has been processed.
References nl_send_auto_complete(), nlmsg_free(), and rtnl_class_build_delete_request().

| struct rtnl_class* rtnl_class_get | ( | struct nl_cache * | cache, |
| int | ifindex, | ||
| uint32_t | handle | ||
| ) |
Look up class by its handle in the provided cache.
References nl_cache::c_items, nl_cache::c_ops, nl_list_for_each_entry, nl_object_get(), and NULL.
