pktloc.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * netlink/route/pktloc.h Packet Location Aliasing
  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) 2010 Thomas Graf <tgraf@suug.ch>
  10. */
  11. #ifndef NETLINK_PKTLOC_H_
  12. #define NETLINK_PKTLOC_H_
  13. #include <netlink/netlink.h>
  14. #include <netlink/cache.h>
  15. #include <netlink/route/tc.h>
  16. #include <linux/tc_ematch/tc_em_cmp.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct rtnl_pktloc
  21. {
  22. char * name;
  23. uint8_t layer;
  24. uint8_t shift;
  25. uint16_t offset;
  26. uint16_t align;
  27. uint32_t mask;
  28. uint32_t refcnt;
  29. struct nl_list_head list;
  30. };
  31. extern int rtnl_pktloc_lookup(const char *, struct rtnl_pktloc **);
  32. extern struct rtnl_pktloc *rtnl_pktloc_alloc(void);
  33. extern void rtnl_pktloc_put(struct rtnl_pktloc *);
  34. extern int rtnl_pktloc_add(struct rtnl_pktloc *);
  35. extern void rtnl_pktloc_foreach(void (*cb)(struct rtnl_pktloc *, void *),
  36. void *);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif