ip6_tunnel.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _IP6_TUNNEL_H
  3. #define _IP6_TUNNEL_H
  4. #include <linux/types.h>
  5. #include <linux/if.h> /* For IFNAMSIZ. */
  6. #include <linux/in6.h> /* For struct in6_addr. */
  7. #define IPV6_TLV_TNL_ENCAP_LIMIT 4
  8. #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
  9. /* don't add encapsulation limit if one isn't present in inner packet */
  10. #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
  11. /* copy the traffic class field from the inner packet */
  12. #define IP6_TNL_F_USE_ORIG_TCLASS 0x2
  13. /* copy the flowlabel from the inner packet */
  14. #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
  15. /* being used for Mobile IPv6 */
  16. #define IP6_TNL_F_MIP6_DEV 0x8
  17. /* copy DSCP from the outer packet */
  18. #define IP6_TNL_F_RCV_DSCP_COPY 0x10
  19. /* copy fwmark from inner packet */
  20. #define IP6_TNL_F_USE_ORIG_FWMARK 0x20
  21. /* allow remote endpoint on the local node */
  22. #define IP6_TNL_F_ALLOW_LOCAL_REMOTE 0x40
  23. struct ip6_tnl_parm {
  24. char name[IFNAMSIZ]; /* name of tunnel device */
  25. int link; /* ifindex of underlying L2 interface */
  26. __u8 proto; /* tunnel protocol */
  27. __u8 encap_limit; /* encapsulation limit for tunnel */
  28. __u8 hop_limit; /* hop limit for tunnel */
  29. __be32 flowinfo; /* traffic class and flowlabel for tunnel */
  30. __u32 flags; /* tunnel flags */
  31. struct in6_addr laddr; /* local tunnel end-point address */
  32. struct in6_addr raddr; /* remote tunnel end-point address */
  33. };
  34. struct ip6_tnl_parm2 {
  35. char name[IFNAMSIZ]; /* name of tunnel device */
  36. int link; /* ifindex of underlying L2 interface */
  37. __u8 proto; /* tunnel protocol */
  38. __u8 encap_limit; /* encapsulation limit for tunnel */
  39. __u8 hop_limit; /* hop limit for tunnel */
  40. __be32 flowinfo; /* traffic class and flowlabel for tunnel */
  41. __u32 flags; /* tunnel flags */
  42. struct in6_addr laddr; /* local tunnel end-point address */
  43. struct in6_addr raddr; /* remote tunnel end-point address */
  44. __be16 i_flags;
  45. __be16 o_flags;
  46. __be32 i_key;
  47. __be32 o_key;
  48. };
  49. #endif