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