12 #ifndef NETLINK_QDISC_H_
13 #define NETLINK_QDISC_H_
15 #include <netlink/netlink.h>
16 #include <netlink/cache.h>
17 #include <netlink/route/tc.h>
28 extern struct rtnl_qdisc * rtnl_qdisc_alloc(
void);
29 extern void rtnl_qdisc_put(
struct rtnl_qdisc *);
56 extern void rtnl_qdisc_set_ifindex(
struct rtnl_qdisc *,
int);
57 extern int rtnl_qdisc_get_ifindex(
struct rtnl_qdisc *);
58 extern void rtnl_qdisc_set_handle(
struct rtnl_qdisc *, uint32_t);
59 extern uint32_t rtnl_qdisc_get_handle(
struct rtnl_qdisc *);
60 extern void rtnl_qdisc_set_parent(
struct rtnl_qdisc *, uint32_t);
61 extern uint32_t rtnl_qdisc_get_parent(
struct rtnl_qdisc *);
62 extern void rtnl_qdisc_set_kind(
struct rtnl_qdisc *,
const char *);
63 extern char * rtnl_qdisc_get_kind(
struct rtnl_qdisc *);
64 extern uint64_t rtnl_qdisc_get_stat(
struct rtnl_qdisc *,
70 void (*cb)(
struct nl_object *,
76 void (*cb)(
struct nl_object *,
struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *cache, int ifindex, uint32_t parent)
Look up qdisc by its parent in the provided cache.
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.
struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *handle)
Build a qdisc cache including all qdiscs currently configured in the kernel.
struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *qdisc, int flags)
Build a netlink message to add a new qdisc.
rtnl_tc_stats_id
TC statistics identifiers.
struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *qdisc)
Return qdisc specific options for use in TCA_OPTIONS.
int rtnl_qdisc_change(struct nl_handle *handle, struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new)
Change attributes of a qdisc.
struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *cache, int ifindex, uint32_t handle)
Look up qdisc by its handle in the provided cache.
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.
int rtnl_qdisc_delete(struct nl_handle *handle, struct rtnl_qdisc *qdisc)
Delete a qdisc.
struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *qdisc, struct rtnl_qdisc *new)
Build a netlink message to change attributes of a existing qdisc.
struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *qdisc)
Build a netlink request message to delete a qdisc.
int rtnl_qdisc_add(struct nl_handle *handle, struct rtnl_qdisc *qdisc, int flags)
Add a new qdisc.