xdp_tx_iptunnel_common.h 634 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Copyright (c) 2016 Facebook
  2. *
  3. * This program is free software; you can redistribute it and/or
  4. * modify it under the terms of version 2 of the GNU General Public
  5. * License as published by the Free Software Foundation.
  6. */
  7. #ifndef _SAMPLES_BPF_XDP_TX_IPTNL_COMMON_H
  8. #define _SAMPLES_BPF_XDP_TX_IPTNL_COMMON_H
  9. #include <linux/types.h>
  10. #define MAX_IPTNL_ENTRIES 256U
  11. struct vip {
  12. union {
  13. __u32 v6[4];
  14. __u32 v4;
  15. } daddr;
  16. __u16 dport;
  17. __u16 family;
  18. __u8 protocol;
  19. };
  20. struct iptnl_info {
  21. union {
  22. __u32 v6[4];
  23. __u32 v4;
  24. } saddr;
  25. union {
  26. __u32 v6[4];
  27. __u32 v4;
  28. } daddr;
  29. __u16 family;
  30. __u8 dmac[6];
  31. };
  32. #endif