• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _IF_TUNNEL_H_
2 #define _IF_TUNNEL_H_
3 
4 #include <linux/types.h>
5 #include <asm/byteorder.h>
6 
7 
8 #define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
9 #define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
10 #define SIOCDELTUNNEL   (SIOCDEVPRIVATE + 2)
11 #define SIOCCHGTUNNEL   (SIOCDEVPRIVATE + 3)
12 #define SIOCGETPRL      (SIOCDEVPRIVATE + 4)
13 #define SIOCADDPRL      (SIOCDEVPRIVATE + 5)
14 #define SIOCDELPRL      (SIOCDEVPRIVATE + 6)
15 #define SIOCCHGPRL      (SIOCDEVPRIVATE + 7)
16 #define SIOCGET6RD      (SIOCDEVPRIVATE + 8)
17 #define SIOCADD6RD      (SIOCDEVPRIVATE + 9)
18 #define SIOCDEL6RD      (SIOCDEVPRIVATE + 10)
19 #define SIOCCHG6RD      (SIOCDEVPRIVATE + 11)
20 
21 #define GRE_CSUM	__cpu_to_be16(0x8000)
22 #define GRE_ROUTING	__cpu_to_be16(0x4000)
23 #define GRE_KEY		__cpu_to_be16(0x2000)
24 #define GRE_SEQ		__cpu_to_be16(0x1000)
25 #define GRE_STRICT	__cpu_to_be16(0x0800)
26 #define GRE_REC		__cpu_to_be16(0x0700)
27 #define GRE_FLAGS	__cpu_to_be16(0x00F8)
28 #define GRE_VERSION	__cpu_to_be16(0x0007)
29 
30 struct ip_tunnel_parm {
31 	char			name[IFNAMSIZ];
32 	int			link;
33 	__be16			i_flags;
34 	__be16			o_flags;
35 	__be32			i_key;
36 	__be32			o_key;
37 	struct iphdr		iph;
38 };
39 
40 /* SIT-mode i_flags */
41 #define	SIT_ISATAP	0x0001
42 
43 struct ip_tunnel_prl {
44 	__be32			addr;
45 	__u16			flags;
46 	__u16			__reserved;
47 	__u32			datalen;
48 	__u32			__reserved2;
49 	/* data follows */
50 };
51 
52 /* PRL flags */
53 #define	PRL_DEFAULT		0x0001
54 
55 struct ip_tunnel_6rd {
56 	struct in6_addr		prefix;
57 	__be32			relay_prefix;
58 	__u16			prefixlen;
59 	__u16			relay_prefixlen;
60 };
61 
62 enum {
63 	IFLA_GRE_UNSPEC,
64 	IFLA_GRE_LINK,
65 	IFLA_GRE_IFLAGS,
66 	IFLA_GRE_OFLAGS,
67 	IFLA_GRE_IKEY,
68 	IFLA_GRE_OKEY,
69 	IFLA_GRE_LOCAL,
70 	IFLA_GRE_REMOTE,
71 	IFLA_GRE_TTL,
72 	IFLA_GRE_TOS,
73 	IFLA_GRE_PMTUDISC,
74 	__IFLA_GRE_MAX,
75 };
76 
77 #define IFLA_GRE_MAX	(__IFLA_GRE_MAX - 1)
78 
79 #endif /* _IF_TUNNEL_H_ */
80