netlink-tc.h revision 44d362409d5469aed47d19e7908d19bd194493a4
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#ifdef __cplusplus
18extern "C" {
19#endif
20
21#define TCA_ATTR_HANDLE    0x001
22#define TCA_ATTR_PARENT    0x002
23#define TCA_ATTR_IFINDEX   0x004
24#define TCA_ATTR_KIND      0x008
25#define TCA_ATTR_FAMILY    0x010
26#define TCA_ATTR_INFO      0x020
27#define TCA_ATTR_OPTS      0x040
28#define TCA_ATTR_STATS     0x080
29#define TCA_ATTR_XSTATS    0x100
30#define TCA_ATTR_MAX	  TCA_ATTR_XSTATS
31
32extern int tca_parse(struct nlattr **, int, struct rtnl_tca *,
33		     struct nla_policy *);
34extern int  tca_msg_parser(struct nlmsghdr *, struct rtnl_tca *);
35extern void tca_free_data(struct rtnl_tca *);
36extern int  tca_clone(struct rtnl_tca *, struct rtnl_tca *);
37extern int  tca_dump_brief(struct rtnl_tca *, const char *,
38			   struct nl_dump_params *, int);
39extern int  tca_dump_full(struct rtnl_tca *, struct nl_dump_params *, int);
40extern int  tca_dump_stats(struct rtnl_tca *,
41				struct nl_dump_params *, int);
42extern int  tca_compare(struct nl_object *, struct nl_object *, uint32_t, int);
43
44extern void tca_set_ifindex(struct rtnl_tca *, int);
45extern int  tca_get_ifindex(struct rtnl_tca *);
46extern void tca_set_handle(struct rtnl_tca *, uint32_t);
47extern uint32_t tca_get_handle(struct rtnl_tca *);
48extern void tca_set_parent(struct rtnl_tca *, uint32_t);
49extern uint32_t tca_get_parent(struct rtnl_tca *);
50extern void tca_set_kind(struct rtnl_tca *, const char *);
51extern char *tca_get_kind(struct rtnl_tca *);
52extern uint64_t tca_get_stat(struct rtnl_tca *, int );
53
54extern struct nl_msg *tca_build_msg(struct rtnl_tca *tca, int type, int flags);
55
56static inline void *tca_priv(struct rtnl_tca *tca)
57{
58	return tca->tc_subdata;
59}
60
61static inline void *tca_xstats(struct rtnl_tca *tca)
62{
63	return tca->tc_xstats->d_data;
64}
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif
71