Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _IP6_TUNNEL_H
0003 #define _IP6_TUNNEL_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/if.h>       /* For IFNAMSIZ. */
0007 #include <linux/in6.h>      /* For struct in6_addr. */
0008 
0009 #define IPV6_TLV_TNL_ENCAP_LIMIT 4
0010 #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
0011 
0012 /* don't add encapsulation limit if one isn't present in inner packet */
0013 #define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
0014 /* copy the traffic class field from the inner packet */
0015 #define IP6_TNL_F_USE_ORIG_TCLASS 0x2
0016 /* copy the flowlabel from the inner packet */
0017 #define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
0018 /* being used for Mobile IPv6 */
0019 #define IP6_TNL_F_MIP6_DEV 0x8
0020 /* copy DSCP from the outer packet */
0021 #define IP6_TNL_F_RCV_DSCP_COPY 0x10
0022 /* copy fwmark from inner packet */
0023 #define IP6_TNL_F_USE_ORIG_FWMARK 0x20
0024 /* allow remote endpoint on the local node */
0025 #define IP6_TNL_F_ALLOW_LOCAL_REMOTE 0x40
0026 
0027 struct ip6_tnl_parm {
0028     char name[IFNAMSIZ];    /* name of tunnel device */
0029     int link;       /* ifindex of underlying L2 interface */
0030     __u8 proto;     /* tunnel protocol */
0031     __u8 encap_limit;   /* encapsulation limit for tunnel */
0032     __u8 hop_limit;     /* hop limit for tunnel */
0033     __be32 flowinfo;    /* traffic class and flowlabel for tunnel */
0034     __u32 flags;        /* tunnel flags */
0035     struct in6_addr laddr;  /* local tunnel end-point address */
0036     struct in6_addr raddr;  /* remote tunnel end-point address */
0037 };
0038 
0039 struct ip6_tnl_parm2 {
0040     char name[IFNAMSIZ];    /* name of tunnel device */
0041     int link;       /* ifindex of underlying L2 interface */
0042     __u8 proto;     /* tunnel protocol */
0043     __u8 encap_limit;   /* encapsulation limit for tunnel */
0044     __u8 hop_limit;     /* hop limit for tunnel */
0045     __be32 flowinfo;    /* traffic class and flowlabel for tunnel */
0046     __u32 flags;        /* tunnel flags */
0047     struct in6_addr laddr;  /* local tunnel end-point address */
0048     struct in6_addr raddr;  /* remote tunnel end-point address */
0049 
0050     __be16          i_flags;
0051     __be16          o_flags;
0052     __be32          i_key;
0053     __be32          o_key;
0054 };
0055 
0056 #endif