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 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022
00023 struct rtnl_qdisc;
00024
00025 extern struct nl_object_ops qdisc_obj_ops;
00026
00027
00028 extern struct rtnl_qdisc * rtnl_qdisc_alloc(void);
00029 extern void rtnl_qdisc_put(struct rtnl_qdisc *);
00030
00031
00032 extern struct nl_cache * rtnl_qdisc_alloc_cache(struct nl_handle *);
00033 extern struct rtnl_qdisc * rtnl_qdisc_get(struct nl_cache *,
00034 int, uint32_t);
00035 extern struct rtnl_qdisc * rtnl_qdisc_get_by_parent(struct nl_cache *,
00036 int, uint32_t);
00037
00038
00039 extern struct nl_msg * rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int);
00040 extern int rtnl_qdisc_add(struct nl_handle *, struct rtnl_qdisc *,
00041 int);
00042
00043
00044 extern struct nl_msg * rtnl_qdisc_build_change_request(struct rtnl_qdisc *,
00045 struct rtnl_qdisc *);
00046 extern int rtnl_qdisc_change(struct nl_handle *,
00047 struct rtnl_qdisc *,
00048 struct rtnl_qdisc *);
00049
00050
00051 extern struct nl_msg * rtnl_qdisc_build_delete_request(struct rtnl_qdisc *);
00052 extern int rtnl_qdisc_delete(struct nl_handle *,
00053 struct rtnl_qdisc *);
00054
00055
00056 extern void rtnl_qdisc_set_ifindex(struct rtnl_qdisc *, int);
00057 extern int rtnl_qdisc_get_ifindex(struct rtnl_qdisc *);
00058 extern void rtnl_qdisc_set_handle(struct rtnl_qdisc *, uint32_t);
00059 extern uint32_t rtnl_qdisc_get_handle(struct rtnl_qdisc *);
00060 extern void rtnl_qdisc_set_parent(struct rtnl_qdisc *, uint32_t);
00061 extern uint32_t rtnl_qdisc_get_parent(struct rtnl_qdisc *);
00062 extern void rtnl_qdisc_set_kind(struct rtnl_qdisc *, const char *);
00063 extern char * rtnl_qdisc_get_kind(struct rtnl_qdisc *);
00064 extern uint64_t rtnl_qdisc_get_stat(struct rtnl_qdisc *,
00065 enum rtnl_tc_stats_id);
00066
00067
00068 extern void rtnl_qdisc_foreach_child(struct rtnl_qdisc *,
00069 struct nl_cache *,
00070 void (*cb)(struct nl_object *,
00071 void *),
00072 void *);
00073
00074 extern void rtnl_qdisc_foreach_cls(struct rtnl_qdisc *,
00075 struct nl_cache *,
00076 void (*cb)(struct nl_object *,
00077 void *),
00078 void *);
00079
00080
00081 extern struct nl_msg * rtnl_qdisc_get_opts(struct rtnl_qdisc *);
00082
00083 #ifdef __cplusplus
00084 }
00085 #endif
00086
00087 #endif