oops
[libnl.git] / include / netlink-tc.h
1 /*
2  * netlink-tc.h         Local Traffic Control Interface
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_TC_PRIV_H_
13 #define NETLINK_TC_PRIV_H_
14
15 #include <netlink-local.h>
16
17 #define TCA_ATTR_HANDLE    0x001
18 #define TCA_ATTR_PARENT    0x002
19 #define TCA_ATTR_IFINDEX   0x004
20 #define TCA_ATTR_KIND      0x008
21 #define TCA_ATTR_FAMILY    0x010
22 #define TCA_ATTR_INFO      0x020
23 #define TCA_ATTR_OPTS      0x040
24 #define TCA_ATTR_STATS     0x080
25 #define TCA_ATTR_XSTATS    0x100
26 #define TCA_ATTR_MAX      TCA_ATTR_XSTATS
27
28 extern int tca_parse(struct nlattr **, int, struct rtnl_tca *,
29                      struct nla_policy *);
30 extern int  tca_msg_parser(struct nlmsghdr *, struct rtnl_tca *);
31 extern void tca_free_data(struct rtnl_tca *);
32 extern int  tca_dump_brief(struct rtnl_tca *, const char *,
33                            struct nl_dump_params *, int);
34 extern int  tca_dump_full(struct rtnl_tca *, struct nl_dump_params *, int);
35 extern int  tca_dump_stats(struct rtnl_tca *,
36                                 struct nl_dump_params *, int);
37 extern int  tca_filter(struct rtnl_tca *, struct rtnl_tca *);
38
39 extern void tca_set_ifindex(struct rtnl_tca *, int);
40 extern int  tca_get_ifindex(struct rtnl_tca *);
41 extern void tca_set_handle(struct rtnl_tca *, uint32_t);
42 extern uint32_t tca_get_handle(struct rtnl_tca *);
43 extern void tca_set_parent(struct rtnl_tca *, uint32_t);
44 extern uint32_t tca_get_parent(struct rtnl_tca *);
45 extern void tca_set_kind(struct rtnl_tca *, const char *);
46 extern char *tca_get_kind(struct rtnl_tca *);
47 extern uint64_t tca_get_stat(struct rtnl_tca *, int );
48
49 extern struct nl_msg *tca_build_msg(struct rtnl_tca *tca, int type, int flags);
50
51 static inline void *tca_priv(struct rtnl_tca *tca)
52 {
53         return tca->tc_subdata;
54 }
55
56 static inline void *tca_xstats(struct rtnl_tca *tca)
57 {
58         return tca->tc_xstats->d_data;
59 }
60
61 #endif