libnl 3.7.0
|
Modules | |
(Fast) Prio | |
Blackhole | |
Class Based Queueing (CBQ) | |
Differentiated Services Marker (DSMARK) | |
Fair Queue CoDel | |
Hierachical Token Bucket (HTB) | |
Hierarchical Fair Service Curve (HFSC) | |
Ingress qdisc | |
Network Emulator | |
For further documentation see http://linux-net.osdl.org/index.php/Netem. | |
Packet/Bytes FIFO (pfifo/bfifo) | |
The FIFO qdisc comes in two flavours: | |
Plug/Unplug Traffic (PLUG) | |
Queue traffic until an explicit release command. | |
Random Early Detection (RED) | |
Stochastic Fairness Queueing (SFQ) | |
Token Bucket Filter (TBF) | |
Allocation/Freeing | |
struct rtnl_qdisc * | rtnl_qdisc_alloc (void) |
void | rtnl_qdisc_put (struct rtnl_qdisc *qdisc) |
Addition / Modification / Deletion | |
int | rtnl_qdisc_build_add_request (struct rtnl_qdisc *qdisc, int flags, struct nl_msg **result) |
Build a netlink message requesting the addition of a qdisc. More... | |
int | rtnl_qdisc_add (struct nl_sock *sk, struct rtnl_qdisc *qdisc, int flags) |
Add qdisc. More... | |
int | rtnl_qdisc_build_update_request (struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new, int flags, struct nl_msg **result) |
Build netlink message requesting the update of a qdisc. More... | |
int | rtnl_qdisc_update (struct nl_sock *sk, struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new, int flags) |
Update qdisc. More... | |
int | rtnl_qdisc_build_delete_request (struct rtnl_qdisc *qdisc, struct nl_msg **result) |
Build netlink message requesting the deletion of a qdisc. More... | |
int | rtnl_qdisc_delete (struct nl_sock *sk, struct rtnl_qdisc *qdisc) |
Delete qdisc. More... | |
Cache Related Functions | |
int | rtnl_qdisc_alloc_cache (struct nl_sock *sk, struct nl_cache **result) |
Allocate a cache and fill it with all configured qdiscs. More... | |
struct rtnl_qdisc * | rtnl_qdisc_get_by_parent (struct nl_cache *cache, int ifindex, uint32_t parent) |
Search qdisc by interface index and parent. More... | |
struct rtnl_qdisc * | rtnl_qdisc_get_by_kind (struct nl_cache *cache, int ifindex, char *kind) |
Search qdisc by kind. More... | |
struct rtnl_qdisc * | rtnl_qdisc_get (struct nl_cache *cache, int ifindex, uint32_t handle) |
Search qdisc by interface index and handle. More... | |
Deprecated Functions | |
void | rtnl_qdisc_foreach_child (struct rtnl_qdisc *qdisc, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
Call a callback for each child class of a qdisc (deprecated) More... | |
void | rtnl_qdisc_foreach_cls (struct rtnl_qdisc *qdisc, struct nl_cache *cache, void(*cb)(struct nl_object *, void *), void *arg) |
Call a callback for each filter attached to the qdisc (deprecated) More... | |
int | rtnl_qdisc_build_change_request (struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new, struct nl_msg **result) |
Build a netlink message requesting the update of a qdisc. More... | |
int | rtnl_qdisc_change (struct nl_sock *sk, struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new) |
Change attributes of a qdisc. More... | |
int rtnl_qdisc_build_add_request | ( | struct rtnl_qdisc * | qdisc, |
int | flags, | ||
struct nl_msg ** | result | ||
) |
Build a netlink message requesting the addition of a qdisc.
qdisc | Qdisc to add |
flags | Additional netlink message flags |
result | Pointer to store resulting netlink message |
The behaviour of this function is identical to rtnl_qdisc_add() with the exception that it will not send the message but return it int the provided return pointer instead.
Definition at line 108 of file qdisc.c.
Referenced by rtnl_qdisc_add().
int rtnl_qdisc_add | ( | struct nl_sock * | sk, |
struct rtnl_qdisc * | qdisc, | ||
int | flags | ||
) |
Add qdisc.
sk | Netlink socket |
qdisc | Qdisc to add |
flags | Additional netlink message flags |
Builds a RTM_NEWQDISC
netlink message requesting the addition of a new qdisc and sends the message to the kernel. The configuration of the qdisc is derived from the attributes of the specified qdisc.
The following flags may be specified:
NLM_F_CREATE:
Create qdisc if it does not exist, otherwise -NLE_OBJ_NOTFOUND is returned.NLM_F_REPLACE:
If another qdisc is already attached to the parent, replace it even if the handles mismatch.NLM_F_EXCL:
Return -NLE_EXISTS if a qdisc with matching handle exists already.Existing qdiscs with matching handles will be updated, unless the flag NLM_F_EXCL
is specified. If their handles do not match, the error -NLE_EXISTS is returned unless the flag NLM_F_REPLACE
is specified in which case the existing qdisc is replaced with the new one. If no matching qdisc exists, it will be created if the flag NLM_F_CREATE
is set, otherwise the error -NLE_OBJ_NOTFOUND is returned.
After sending, the function will wait for the ACK or an eventual error message to be received and will therefore block until the operation has been completed.
Definition at line 156 of file qdisc.c.
References nl_send_sync(), and rtnl_qdisc_build_add_request().
int rtnl_qdisc_build_update_request | ( | struct rtnl_qdisc * | qdisc, |
struct rtnl_qdisc * | new, | ||
int | flags, | ||
struct nl_msg ** | result | ||
) |
Build netlink message requesting the update of a qdisc.
qdisc | Qdisc to update |
new | Qdisc with updated attributes |
flags | Additional netlink message flags |
result | Pointer to store resulting netlink message |
The behaviour of this function is identical to rtnl_qdisc_update() with the exception that it will not send the message but return it in the provided return pointer instead.
Definition at line 182 of file qdisc.c.
References rtnl_tc_set_handle(), rtnl_tc_set_ifindex(), rtnl_tc_set_parent(), and TC_CAST.
Referenced by rtnl_qdisc_build_change_request(), and rtnl_qdisc_update().
int rtnl_qdisc_update | ( | struct nl_sock * | sk, |
struct rtnl_qdisc * | qdisc, | ||
struct rtnl_qdisc * | new, | ||
int | flags | ||
) |
Update qdisc.
sk | Netlink socket |
qdisc | Qdisc to update |
new | Qdisc with updated attributes |
flags | Additional netlink message flags |
Builds a RTM_NEWQDISC
netlink message requesting the update of an existing qdisc and sends the message to the kernel.
This function is a varation of rtnl_qdisc_add() to update qdiscs if the qdisc to be updated is available as qdisc object. The behaviour is identical to the one of rtnl_qdisc_add except that before constructing the message, it copies the ifindex
, handle
, and parent
from the original qdisc
to the new
qdisc.
After sending, the function will wait for the ACK or an eventual error message to be received and will therefore block until the operation has been completed.
Definition at line 241 of file qdisc.c.
References nl_send_sync(), and rtnl_qdisc_build_update_request().
Referenced by rtnl_qdisc_change().
int rtnl_qdisc_build_delete_request | ( | struct rtnl_qdisc * | qdisc, |
struct nl_msg ** | result | ||
) |
Build netlink message requesting the deletion of a qdisc.
qdisc | Qdisc to delete |
result | Pointer to store resulting netlink message |
The behaviour of this function is identical to rtnl_qdisc_delete() with the exception that it will not send the message but return it in the provided return pointer instead.
Definition at line 267 of file qdisc.c.
References NLA_PUT_STRING, nlmsg_alloc_simple(), nlmsg_append(), and nlmsg_free().
Referenced by rtnl_qdisc_delete().
int rtnl_qdisc_delete | ( | struct nl_sock * | sk, |
struct rtnl_qdisc * | qdisc | ||
) |
Delete qdisc.
sk | Netlink socket |
qdisc | Qdisc to add |
Builds a RTM_NEWQDISC
netlink message requesting the deletion of a qdisc and sends the message to the kernel.
The message is constructed out of the following attributes:
ifindex
and parent
handle
(optional, must match if provided)kind
(optional, must match if provided)All other qdisc attributes including all qdisc type specific attributes are ignored.
After sending, the function will wait for the ACK or an eventual error message to be received and will therefore block until the operation has been completed.
Definition at line 334 of file qdisc.c.
References nl_send_sync(), and rtnl_qdisc_build_delete_request().
int rtnl_qdisc_alloc_cache | ( | struct nl_sock * | sk, |
struct nl_cache ** | result | ||
) |
Allocate a cache and fill it with all configured qdiscs.
sk | Netlink socket |
result | Pointer to store the created cache |
Allocates a new qdisc cache and fills it with a list of all configured qdiscs on all network devices. Release the cache with nl_cache_free().
Definition at line 362 of file qdisc.c.
References nl_cache_alloc_and_fill().
struct rtnl_qdisc * rtnl_qdisc_get_by_parent | ( | struct nl_cache * | cache, |
int | ifindex, | ||
uint32_t | parent | ||
) |
Search qdisc by interface index and parent.
cache | Qdisc cache |
ifindex | Interface index |
parent | Handle of parent qdisc |
Searches a qdisc cache previously allocated with rtnl_qdisc_alloc_cache() and searches for a qdisc matching the interface index and parent qdisc.
The reference counter is incremented before returning the qdisc, therefore the reference must be given back with rtnl_qdisc_put() after usage.
Definition at line 381 of file qdisc.c.
References nl_object_get().
Referenced by rtnl_class_leaf_qdisc().
struct rtnl_qdisc * rtnl_qdisc_get_by_kind | ( | struct nl_cache * | cache, |
int | ifindex, | ||
char * | kind | ||
) |
Search qdisc by kind.
cache | Qdisc cache |
ifindex | Interface index |
kind | Qdisc kind (tbf, htb, cbq, etc) |
Searches a qdisc cache previously allocated with rtnl_qdisc_alloc_cache() and searches for a qdisc matching the interface index and kind.
The reference counter is incremented before returning the qdisc, therefore the reference must be given back with rtnl_qdisc_put() after usage.
Definition at line 413 of file qdisc.c.
References nl_object_get().
struct rtnl_qdisc * rtnl_qdisc_get | ( | struct nl_cache * | cache, |
int | ifindex, | ||
uint32_t | handle | ||
) |
Search qdisc by interface index and handle.
cache | Qdisc cache |
ifindex | Interface index |
handle | Handle |
Searches a qdisc cache previously allocated with rtnl_qdisc_alloc_cache() and searches for a qdisc matching the interface index and handle.
The reference counter is incremented before returning the qdisc, therefore the reference must be given back with rtnl_qdisc_put() after usage.
Definition at line 445 of file qdisc.c.
References nl_object_get().
void rtnl_qdisc_foreach_child | ( | struct rtnl_qdisc * | qdisc, |
struct nl_cache * | cache, | ||
void(*)(struct nl_object *, void *) | cb, | ||
void * | arg | ||
) |
Call a callback for each child class of a qdisc (deprecated)
Definition at line 476 of file qdisc.c.
References nl_cache_foreach_filter(), rtnl_tc_set_ifindex(), rtnl_tc_set_kind(), rtnl_tc_set_parent(), and TC_CAST.
void rtnl_qdisc_foreach_cls | ( | struct rtnl_qdisc * | qdisc, |
struct nl_cache * | cache, | ||
void(*)(struct nl_object *, void *) | cb, | ||
void * | arg | ||
) |
Call a callback for each filter attached to the qdisc (deprecated)
Definition at line 500 of file qdisc.c.
References nl_cache_foreach_filter(), rtnl_tc_set_ifindex(), rtnl_tc_set_parent(), and TC_CAST.
int rtnl_qdisc_build_change_request | ( | struct rtnl_qdisc * | qdisc, |
struct rtnl_qdisc * | new, | ||
struct nl_msg ** | result | ||
) |
Build a netlink message requesting the update of a qdisc.
Definition at line 522 of file qdisc.c.
References rtnl_qdisc_build_update_request().
int rtnl_qdisc_change | ( | struct nl_sock * | sk, |
struct rtnl_qdisc * | qdisc, | ||
struct rtnl_qdisc * | new | ||
) |
Change attributes of a qdisc.
Definition at line 537 of file qdisc.c.
References rtnl_qdisc_update().