2 * netlink/route/class.h Classes
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_CLASS_H_
13 #define NETLINK_CLASS_H_
15 #include <netlink/netlink.h>
16 #include <netlink/route/tc.h>
17 #include <netlink/route/qdisc.h>
22 extern struct rtnl_class * rtnl_class_alloc(void);
23 extern void rtnl_class_put(struct rtnl_class *);
24 extern void rtnl_class_free(struct rtnl_class *);
25 extern struct nl_cache * rtnl_class_alloc_cache(struct nl_handle *, int);
27 /* leaf qdisc access */
28 extern int rtnl_class_has_leaf_qdisc(struct rtnl_class *);
29 extern struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *,
33 extern struct nl_msg * rtnl_class_build_add_request(struct rtnl_class *, int);
34 extern int rtnl_class_add(struct nl_handle *, struct rtnl_class *, int);
36 /* attribute modification */
37 extern void rtnl_class_set_ifindex(struct rtnl_class *, int);
38 extern int rtnl_class_get_ifindex(struct rtnl_class *);
39 extern void rtnl_class_set_handle(struct rtnl_class *, uint32_t);
40 extern uint32_t rtnl_class_get_handle(struct rtnl_class *);
41 extern void rtnl_class_set_parent(struct rtnl_class *, uint32_t);
42 extern uint32_t rtnl_class_get_parent(struct rtnl_class *);
43 extern void rtnl_class_set_kind(struct rtnl_class *, const char *);
44 extern char * rtnl_class_get_kind(struct rtnl_class *);
45 extern uint64_t rtnl_class_get_stat(struct rtnl_class *,
46 enum rtnl_tc_stats_id);
49 extern void rtnl_class_foreach_child(struct rtnl_class *,
51 void (*cb)(struct nl_object *,
54 extern void rtnl_class_foreach_cls(struct rtnl_class *,
56 void (*cb)(struct nl_object *,