diff options
author | Fred L. Templin <fred.l.templin@boeing.com> | 2007-11-29 06:11:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:55:09 -0500 |
commit | c7dc89c0ac8e7c3796bff91becf58ccdbcaf9f18 (patch) | |
tree | e876ccadf29a90b7a211522aeccfd42255dab586 /include | |
parent | df97c708d5e6eebdd9ded1fa588eae09acf53793 (diff) |
[IPV6]: Add RFC4214 support
This patch includes support for the Intra-Site Automatic Tunnel
Addressing Protocol (ISATAP) per RFC4214. It uses the SIT
module, and is configured using extensions to the "iproute2"
utility. The diffs are specific to the Linux 2.6.24-rc2 kernel
distribution.
This version includes the diff for ./include/linux/if.h which was
missing in the v2.4 submission and is needed to make the
patch compile. The patch has been installed, compiled and
tested in a clean 2.6.24-rc2 kernel build area.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if.h | 1 | ||||
-rw-r--r-- | include/linux/if_tunnel.h | 3 | ||||
-rw-r--r-- | include/linux/in.h | 8 | ||||
-rw-r--r-- | include/net/addrconf.h | 19 |
4 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/if.h b/include/linux/if.h index 186070d5c544..5c9d1fa93fef 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -63,6 +63,7 @@ | |||
63 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ | 63 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ |
64 | #define IFF_BONDING 0x20 /* bonding master or slave */ | 64 | #define IFF_BONDING 0x20 /* bonding master or slave */ |
65 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ | 65 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ |
66 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ | ||
66 | 67 | ||
67 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 68 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
68 | #define IF_GET_PROTO 0x0002 | 69 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 660b5010c2d9..228eb4eb3129 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #define GRE_FLAGS __constant_htons(0x00F8) | 17 | #define GRE_FLAGS __constant_htons(0x00F8) |
18 | #define GRE_VERSION __constant_htons(0x0007) | 18 | #define GRE_VERSION __constant_htons(0x0007) |
19 | 19 | ||
20 | /* i_flags values for SIT mode */ | ||
21 | #define SIT_ISATAP 0x0001 | ||
22 | |||
20 | struct ip_tunnel_parm | 23 | struct ip_tunnel_parm |
21 | { | 24 | { |
22 | char name[IFNAMSIZ]; | 25 | char name[IFNAMSIZ]; |
diff --git a/include/linux/in.h b/include/linux/in.h index 3975cbf52f20..a8f00cac8f79 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -253,6 +253,14 @@ struct sockaddr_in { | |||
253 | #define ZERONET(x) (((x) & htonl(0xff000000)) == htonl(0x00000000)) | 253 | #define ZERONET(x) (((x) & htonl(0xff000000)) == htonl(0x00000000)) |
254 | #define LOCAL_MCAST(x) (((x) & htonl(0xFFFFFF00)) == htonl(0xE0000000)) | 254 | #define LOCAL_MCAST(x) (((x) & htonl(0xFFFFFF00)) == htonl(0xE0000000)) |
255 | 255 | ||
256 | /* Special-Use IPv4 Addresses (RFC3330) */ | ||
257 | #define PRIVATE_10(x) (((x) & htonl(0xff000000)) == htonl(0x0A000000)) | ||
258 | #define LINKLOCAL_169(x) (((x) & htonl(0xffff0000)) == htonl(0xA9FE0000)) | ||
259 | #define PRIVATE_172(x) (((x) & htonl(0xfff00000)) == htonl(0xAC100000)) | ||
260 | #define TEST_192(x) (((x) & htonl(0xffffff00)) == htonl(0xC0000200)) | ||
261 | #define ANYCAST_6TO4(x) (((x) & htonl(0xffffff00)) == htonl(0xC0586300)) | ||
262 | #define PRIVATE_192(x) (((x) & htonl(0xffff0000)) == htonl(0xC0A80000)) | ||
263 | #define TEST_198(x) (((x) & htonl(0xfffe0000)) == htonl(0xC6120000)) | ||
256 | #endif | 264 | #endif |
257 | 265 | ||
258 | #endif /* _LINUX_IN_H */ | 266 | #endif /* _LINUX_IN_H */ |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index bccc2feb99da..c56827da0dee 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #define IPV6_MAX_ADDRESSES 16 | 18 | #define IPV6_MAX_ADDRESSES 16 |
19 | 19 | ||
20 | #include <linux/in.h> | ||
20 | #include <linux/in6.h> | 21 | #include <linux/in6.h> |
21 | 22 | ||
22 | struct prefix_info { | 23 | struct prefix_info { |
@@ -249,6 +250,24 @@ static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | |||
249 | addr->s6_addr32[3] == htonl(0x00000002)); | 250 | addr->s6_addr32[3] == htonl(0x00000002)); |
250 | } | 251 | } |
251 | 252 | ||
253 | static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr) | ||
254 | { | ||
255 | eui[0] = (ZERONET(addr) || PRIVATE_10(addr) || LOOPBACK(addr) || | ||
256 | LINKLOCAL_169(addr) || PRIVATE_172(addr) || TEST_192(addr) || | ||
257 | ANYCAST_6TO4(addr) || PRIVATE_192(addr) || TEST_198(addr) || | ||
258 | MULTICAST(addr) || BADCLASS(addr)) ? 0x00 : 0x02; | ||
259 | eui[1] = 0; | ||
260 | eui[2] = 0x5E; | ||
261 | eui[3] = 0xFE; | ||
262 | memcpy (eui+4, &addr, 4); | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | ||
267 | { | ||
268 | return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); | ||
269 | } | ||
270 | |||
252 | #ifdef CONFIG_PROC_FS | 271 | #ifdef CONFIG_PROC_FS |
253 | extern int if6_proc_init(void); | 272 | extern int if6_proc_init(void); |
254 | extern void if6_proc_exit(void); | 273 | extern void if6_proc_exit(void); |