GRE over IPv6 tunnels support
Subsystems (2)
PATCH 1/1 GRE over IPv6 tunnels support
GRE over IPv6 tunnels support.
Signed-off-by Dmitry Kozlov <[email protected]>
--- include/linux/if_arp.h | 15 +++++ include/linux/if_tunnel.h | 21 +++++++ include/linux/ip6_tunnel.h | 18 ++++++ ip/ip6tunnel.c | 131 ++++++++++++++++++++++++++++++++++++++------ 4 files changed, 168 insertions(+), 17 deletions(-)
include/linux/if_arp.h +15 -0
@@ -92,6 +92,7 @@#define ARPHRD_PHONET 820/* PhoNet media type */ #define ARPHRD_PHONET_PIPE 821/* PhoNet pipe header */ #define ARPHRD_CAIF 822/* CAIF media type */ +#define ARPHRD_IP6GRE 823/* GRE over IPv6 */ #define ARPHRD_VOID 0xFFFF/* Void type, nothing is known */ #define ARPHRD_NONE 0xFFFE/* zero header length */
@@ -154,5 +155,19 @@ struct arphdr { }; +#ifdef __KERNEL__ +#include <linux/skbuff.h> + +static inline struct arphdr *arp_hdr (const struct sk_buff *skb) +{ +return (struct arphdr *)skb_network_header (skb); +} + +static inline int arp_hdr_len (struct net_device *dev) +{ +/* ARP header, plus 2 device addresses, plus 2 IP addresses. */ +return sizeof (struct arphdr ) + (dev->addr_len +sizeof (u32)) *2 ; +} +#endif #endif /* _LINUX_IF_ARP_H */
include/linux/if_tunnel.h +21 -0
@@ -4,6 +4,10 @@#include <linux/types.h> #include <asm/byteorder.h> +#ifdef __KERNEL__ +#include <linux/ip.h> +#include <linux/in6.h> +#endif #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
@@ -71,9 +75,26 @@ enum {IFLA_GRE_TTL ,IFLA_GRE_TOS ,IFLA_GRE_PMTUDISC , +IFLA_GRE_ENCAP_LIMIT , +IFLA_GRE_FLOWINFO , +IFLA_GRE_FLAGS , __IFLA_GRE_MAX, };#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) +/* VTI-mode i_flags */ +#define VTI_ISVTI 0x0001 + +enum { +IFLA_VTI_UNSPEC , +IFLA_VTI_LINK , +IFLA_VTI_IKEY , +IFLA_VTI_OKEY , +IFLA_VTI_LOCAL , +IFLA_VTI_REMOTE , + __IFLA_VTI_MAX, +}; + +#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)#endif /* _IF_TUNNEL_H_ */
include/linux/ip6_tunnel.h +18 -0
@@ -31,4 +31,22 @@ struct ip6_tnl_parm { struct in6_addr raddr; /* remote tunnel end-point address */ }; +struct ip6_tnl_parm2 { +char name[IFNAMSIZ ];/* name of tunnel device */ +int link;/* ifindex of underlying L2 interface */ +__u8 proto;/* tunnel protocol */ +__u8 encap_limit;/* encapsulation limit for tunnel */ +__u8 hop_limit;/* hop limit for tunnel */ +__be32 flowinfo;/* traffic class and flowlabel for tunnel */ +__u32 flags;/* tunnel flags */ +struct in6_addr laddr;/* local tunnel end-point address */ +struct in6_addr raddr;/* remote tunnel end-point address */ + +__be16 i_flags; +__be16 o_flags; +__be32 i_key; +__be32 o_key; +}; + +#endif
ip/ip6tunnel.c +114 -17
237 lines not on this page · raw message