netlink-tc.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #ifndef NETLINK_TC_PRIV_H_
  12. #define NETLINK_TC_PRIV_H_
  13. #include <netlink-local.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  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. extern int tca_parse(struct nlattr **, int, struct rtnl_tca *,
  28. struct nla_policy *);
  29. extern int tca_msg_parser(struct nlmsghdr *, struct rtnl_tca *);
  30. extern void tca_free_data(struct rtnl_tca *);
  31. extern int tca_clone(struct rtnl_tca *, 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_compare(struct nl_object *, struct nl_object *, uint32_t, int);
  38. extern void tca_set_ifindex(struct rtnl_tca *, int);
  39. extern int tca_get_ifindex(struct rtnl_tca *);
  40. extern void tca_set_handle(struct rtnl_tca *, uint32_t);
  41. extern uint32_t tca_get_handle(struct rtnl_tca *);
  42. extern void tca_set_parent(struct rtnl_tca *, uint32_t);
  43. extern uint32_t tca_get_parent(struct rtnl_tca *);
  44. extern void tca_set_kind(struct rtnl_tca *, const char *);
  45. extern char *tca_get_kind(struct rtnl_tca *);
  46. extern uint64_t tca_get_stat(struct rtnl_tca *, int );
  47. extern struct nl_msg *tca_build_msg(struct rtnl_tca *tca, int type, int flags);
  48. static inline void *tca_priv(struct rtnl_tca *tca)
  49. {
  50. return tca->tc_subdata;
  51. }
  52. static inline void *tca_xstats(struct rtnl_tca *tca)
  53. {
  54. return tca->tc_xstats->d_data;
  55. }
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif