libnl  1.1.4
class.h
1 /*
2  * netlink/route/class.h Classes
3  *
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
7  * of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_CLASS_H_
13 #define NETLINK_CLASS_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/route/tc.h>
17 #include <netlink/route/qdisc.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct rtnl_class;
24 
25 extern struct nl_object_ops class_obj_ops;
26 
27 /* General */
28 extern struct rtnl_class * rtnl_class_alloc(void);
29 extern void rtnl_class_put(struct rtnl_class *);
30 extern struct nl_cache * rtnl_class_alloc_cache(struct nl_handle *, int);
31 
32 /* leaf qdisc access */
33 extern struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *,
34  struct nl_cache *);
35 
36 /* class addition */
37 extern struct nl_msg * rtnl_class_build_add_request(struct rtnl_class *, int);
38 extern int rtnl_class_add(struct nl_handle *, struct rtnl_class *, int);
39 
40 /* attribute modification */
41 extern void rtnl_class_set_ifindex(struct rtnl_class *, int);
42 extern int rtnl_class_get_ifindex(struct rtnl_class *);
43 extern void rtnl_class_set_handle(struct rtnl_class *, uint32_t);
44 extern uint32_t rtnl_class_get_handle(struct rtnl_class *);
45 extern void rtnl_class_set_parent(struct rtnl_class *, uint32_t);
46 extern uint32_t rtnl_class_get_parent(struct rtnl_class *);
47 extern void rtnl_class_set_kind(struct rtnl_class *, const char *);
48 extern char * rtnl_class_get_kind(struct rtnl_class *);
49 extern uint64_t rtnl_class_get_stat(struct rtnl_class *,
50  enum rtnl_tc_stats_id);
51 
52 /* iterators */
53 extern void rtnl_class_foreach_child(struct rtnl_class *,
54  struct nl_cache *,
55  void (*cb)(struct nl_object *,
56  void *),
57  void *);
58 extern void rtnl_class_foreach_cls(struct rtnl_class *,
59  struct nl_cache *,
60  void (*cb)(struct nl_object *,
61  void *),
62  void *);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif