lib: check for integer-overflow in nlmsg_reserve()
[platform/upstream/libnl3.git] / include / netlink / route / class.h
1 /*
2  * netlink/route/class.h       Traffic 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-2011 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 rtnl_class *
26                         rtnl_class_alloc(void);
27 extern void             rtnl_class_put(struct rtnl_class *);
28
29 extern int              rtnl_class_alloc_cache(struct nl_sock *, int,
30                                                struct nl_cache **);
31 extern struct rtnl_class *
32                         rtnl_class_get(struct nl_cache *, int, uint32_t);
33
34 extern struct rtnl_qdisc *
35                         rtnl_class_leaf_qdisc(struct rtnl_class *,
36                                                       struct nl_cache *);
37
38 extern int              rtnl_class_build_add_request(struct rtnl_class *, int,
39                                                      struct nl_msg **);
40 extern int              rtnl_class_add(struct nl_sock *, struct rtnl_class *,
41                                        int);
42
43 extern int              rtnl_class_build_delete_request(struct rtnl_class *,
44                                                         struct nl_msg **);
45 extern int              rtnl_class_delete(struct nl_sock *,
46                                           struct rtnl_class *);
47
48 /* deprecated functions */
49 extern void             rtnl_class_foreach_child(struct rtnl_class *,
50                                                  struct nl_cache *,
51                                                  void (*cb)(struct nl_object *,
52                                                             void *),
53                                                  void *)
54                                                  __attribute__((deprecated));
55 extern void             rtnl_class_foreach_cls(struct rtnl_class *,
56                                                struct nl_cache *,
57                                                void (*cb)(struct nl_object *,
58                                                           void *),
59                                                void *)
60                                                __attribute__((deprecated));
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif