[IPV6] MIP6: Add Mobility header definition.
authorMasahide NAKAMURA <nakam@linux-ipv6.org>
Thu, 24 Aug 2006 03:34:26 +0000 (20:34 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:07:00 +0000 (15:07 -0700)
Add Mobility header definition for Mobile IPv6.
Based on MIPL2 kernel patch.

This patch was also written by: Antti Tuominen <anttit@tcs.hut.fi>

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/in6.h
include/net/flow.h
include/net/ipv6.h
include/net/mip6.h

index 086ec2ac8c5fa431c3be80405c9185a97a53be29..d776829b443f57e52f24e0bb8b45909936f4fd48 100644 (file)
@@ -134,6 +134,7 @@ struct in6_flowlabel_req
 #define IPPROTO_ICMPV6         58      /* ICMPv6                       */
 #define IPPROTO_NONE           59      /* IPv6 no next header          */
 #define IPPROTO_DSTOPTS                60      /* IPv6 destination options     */
+#define IPPROTO_MH             135     /* IPv6 mobility header         */
 
 /*
  *     IPv6 TLV options.
index 21d988b2058ab125147a9398fc94c13ae608dd8c..e0522914316e3f659f80f06942a15e55c6ffaeba 100644 (file)
@@ -72,12 +72,21 @@ struct flowi {
                } dnports;
 
                __u32           spi;
+
+#ifdef CONFIG_IPV6_MIP6
+               struct {
+                       __u8    type;
+               } mht;
+#endif
        } uli_u;
 #define fl_ip_sport    uli_u.ports.sport
 #define fl_ip_dport    uli_u.ports.dport
 #define fl_icmp_type   uli_u.icmpt.type
 #define fl_icmp_code   uli_u.icmpt.code
 #define fl_ipsec_spi   uli_u.spi
+#ifdef CONFIG_IPV6_MIP6
+#define fl_mh_type     uli_u.mht.type
+#endif
        __u32           secid;  /* used by xfrm; see secid.txt */
 } __attribute__((__aligned__(BITS_PER_LONG/8)));
 
index 8e6ec6063f8ce1a00197744c135e1e3a7b65107c..72bf47b2a4e0c9bfe34583980f429b1d691557c9 100644 (file)
@@ -40,6 +40,7 @@
 #define NEXTHDR_ICMP           58      /* ICMP for IPv6. */
 #define NEXTHDR_NONE           59      /* No next header */
 #define NEXTHDR_DEST           60      /* Destination options header. */
+#define NEXTHDR_MOBILITY       135     /* Mobility header. */
 
 #define NEXTHDR_MAX            255
 
index 42b65bace12275d6dc957e4d8ec140cb8deb190b..fd43178faace15625296dd5852decf42c1c6f8f0 100644 (file)
 #define MIP6_OPT_PAD_1 0
 #define MIP6_OPT_PAD_N 1
 
+/*
+ * Mobility Header
+ */
+struct ip6_mh {
+       __u8    ip6mh_proto;
+       __u8    ip6mh_hdrlen;
+       __u8    ip6mh_type;
+       __u8    ip6mh_reserved;
+       __u16   ip6mh_cksum;
+       /* Followed by type specific messages */
+       __u8    data[0];
+} __attribute__ ((__packed__));
+
+#define IP6_MH_TYPE_BRR                0   /* Binding Refresh Request */
+#define IP6_MH_TYPE_HOTI       1   /* HOTI Message   */
+#define IP6_MH_TYPE_COTI       2   /* COTI Message  */
+#define IP6_MH_TYPE_HOT                3   /* HOT Message   */
+#define IP6_MH_TYPE_COT                4   /* COT Message  */
+#define IP6_MH_TYPE_BU         5   /* Binding Update */
+#define IP6_MH_TYPE_BACK       6   /* Binding ACK */
+#define IP6_MH_TYPE_BERROR     7   /* Binding Error */
+#define IP6_MH_TYPE_MAX                IP6_MH_TYPE_BERROR
+
 extern int mip6_init(void);
 extern void mip6_fini(void);