00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NETLINK_QDISC_H_
00013 #define NETLINK_QDISC_H_
00014
00015 #include <netlink/netlink.h>
00016 #include <netlink/cache.h>
00017 #include <netlink/route/tc.h>
00018
00019 struct rtnl_qdisc;
00020
00021
00022 extern struct rtnl_qdisc * rtnl_qdisc_alloc(void);
00023 extern void rtnl_qdisc_put(struct rtnl_qdisc *);
00024 extern void rtnl_qdisc_free(struct rtnl_qdisc *);
00025
00026
00027 extern struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *);
00028 extern struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *,
00029 int, uint32_t);
00030 extern struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *,
00031 int, uint32_t);
00032
00033
00034 extern struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int);
00035 extern int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *,
00036 int);
00037
00038
00039 extern struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *,
00040 struct rtnl_qdisc *);
00041 extern int rtnl_qdisc_change(struct nl_handle *,
00042 struct rtnl_qdisc *,
00043 struct rtnl_qdisc *);
00044
00045
00046 extern struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *);
00047 extern int rtnl_qdisc_delete(struct nl_handle *,
00048 struct rtnl_qdisc *);
00049
00050
00051 extern void rtnl_qdisc_set_ifindex(struct rtnl_qdisc *, int);
00052 extern int rtnl_qdisc_get_ifindex(struct rtnl_qdisc *);
00053 extern void rtnl_qdisc_set_handle(struct rtnl_qdisc *, uint32_t);
00054 extern uint32_t rtnl_qdisc_get_handle(struct rtnl_qdisc *);
00055 extern void rtnl_qdisc_set_parent(struct rtnl_qdisc *, uint32_t);
00056 extern uint32_t rtnl_qdisc_get_parent(struct rtnl_qdisc *);
00057 extern void rtnl_qdisc_set_kind(struct rtnl_qdisc *, const char *);
00058 extern char * rtnl_qdisc_get_kind(struct rtnl_qdisc *);
00059 extern uint64_t rtnl_qdisc_get_stat(struct rtnl_qdisc *,
00060 enum rtnl_tc_stats_id);
00061
00062
00063 extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *,
00064 struct nl_cache *,
00065 void (*cb)(struct nl_object *,
00066 void *),
00067 void *);
00068
00069 extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *,
00070 struct nl_cache *,
00071 void (*cb)(struct nl_object *,
00072 void *),
00073 void *);
00074
00075
00076 extern struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *);
00077
00078 #endif