2 * netlink/route/qdisc.h Queueing Disciplines
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
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>
22 extern struct rtnl_qdisc * rtnl_qdisc_alloc(void);
23 extern void rtnl_qdisc_put(struct rtnl_qdisc *);
24 extern void rtnl_qdisc_free(struct rtnl_qdisc *);
26 /* Cache Management */
27 extern struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *);
28 extern struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *,
30 extern struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *,
34 extern struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int);
35 extern int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *,
38 /* qdisc modification */
39 extern struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *,
41 extern int rtnl_qdisc_change(struct nl_handle *,
46 extern struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *);
47 extern int rtnl_qdisc_delete(struct nl_handle *,
50 /* attribute modifications */
51 extern void rtnl_qdisc_set_ifindex(struct rtnl_qdisc *, int);
52 extern int rtnl_qdisc_get_ifindex(struct rtnl_qdisc *);
53 extern void rtnl_qdisc_set_handle(struct rtnl_qdisc *, uint32_t);
54 extern uint32_t rtnl_qdisc_get_handle(struct rtnl_qdisc *);
55 extern void rtnl_qdisc_set_parent(struct rtnl_qdisc *, uint32_t);
56 extern uint32_t rtnl_qdisc_get_parent(struct rtnl_qdisc *);
57 extern void rtnl_qdisc_set_kind(struct rtnl_qdisc *, const char *);
58 extern char * rtnl_qdisc_get_kind(struct rtnl_qdisc *);
59 extern uint64_t rtnl_qdisc_get_stat(struct rtnl_qdisc *,
60 enum rtnl_tc_stats_id);
63 extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *,
65 void (*cb)(struct nl_object *,
69 extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *,
71 void (*cb)(struct nl_object *,
75 /* qdisc specific options */
76 extern struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *);