⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mipv6-1.0-v2.4.22.patch

📁 mobile ipv6协议Linux实现源代码
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
+ */++#ifndef _NET_MIPV6_H+#define _NET_MIPV6_H++#include <linux/types.h>+#include <asm/byteorder.h>+#include <linux/in6.h>++/*+ *+ * Mobile IPv6 Protocol constants+ *+ */+#define DHAAD_RETRIES			4	/* transmissions	*/+#define INITIAL_BINDACK_TIMEOUT		1	/* seconds 		*/+#define INITIAL_DHAAD_TIMEOUT		3	/* seconds		*/+#define INITIAL_SOLICIT_TIMER		3	/* seconds		*/+#define MAX_BINDACK_TIMEOUT		32 	/* seconds		*/+#define MAX_NONCE_LIFE			240	/* seconds		*/+#define MAX_TOKEN_LIFE			210	/* seconds		*/+#define MAX_RR_BINDING_LIFE		420	/* seconds		*/+#define MAX_UPDATE_RATE			3	/* 1/s (min delay=1s) 	*/+#define PREFIX_ADV_RETRIES		3	/* transmissions	*/+#define PREFIX_ADV_TIMEOUT		3	/* seconds		*/++#define MAX_FAST_UPDATES		5 	/* transmissions	*/+#define MAX_PFX_ADV_DELAY		1000	/* seconds		*/+#define SLOW_UPDATE_RATE		10	/* 1/10s (max delay=10s)*/+#define INITIAL_BINDACK_DAD_TIMEOUT	3	/* seconds		*/++/*+ *+ * Mobile IPv6 Protocol configuration variable defaults+ *+ */+#define DefHomeRtrAdvInterval		1000	/* seconds		*/+#define DefMaxMobPfxAdvInterval		86400	/* seconds		*/+#define DefMinDelayBetweenRAs		3	/* seconds (min 0.03)	*/+#define DefMinMobPfxAdvInterval		600	/* seconds		*/+#define DefInitialBindackTimeoutFirstReg	1.5 /* seconds		*/++/* This is not actually specified in the draft, but is needed to avoid+ * prefix solicitation storm when valid lifetime of a prefix is smaller+ * than MAX_PFX_ADV_DELAY+ */+#define MIN_PFX_SOL_DELAY		5	/* seconds		*/++/* Mobile IPv6 ICMP types		  */+/*+ * TODO: Check with IANA+ */+#define MIPV6_DHAAD_REQUEST		150+#define MIPV6_DHAAD_REPLY		151+#define MIPV6_PREFIX_SOLICIT		152+#define MIPV6_PREFIX_ADV		153++/* Binding update flag codes              */+#define MIPV6_BU_F_ACK			0x80+#define MIPV6_BU_F_HOME			0x40+#define MIPV6_BU_F_LLADDR		0x20+#define MIPV6_BU_F_KEYMGM		0x10++/* Binding ackknowledgment flag codes */+#define MIPV6_BA_F_KEYMGM		0x80++/* Binding error status */+#define MIPV6_BE_HAO_WO_BINDING		1+#define MIPV6_BE_UNKNOWN_MH_TYPE	2++/* Mobility Header */+struct mipv6_mh+{+	__u8	payload;		/* Payload Protocol 		*/+	__u8	length;			/* MH Length 			*/+	__u8	type;			/* MH Type			*/+	__u8	reserved;		/* Reserved			*/+	__u16	checksum;		/* Checksum			*/+	__u8	data[0];		/* Message specific data	*/+} __attribute__ ((packed));++/* Mobility Header type */+#define IPPROTO_MOBILITY                62 /* TODO: No official protocol number at this point */                +/* Mobility Header Message Types */++#define MIPV6_MH_BRR			0+#define MIPV6_MH_HOTI			1+#define MIPV6_MH_COTI			2+#define MIPV6_MH_HOT			3+#define MIPV6_MH_COT			4+#define MIPV6_MH_BU			5+#define MIPV6_MH_BA			6+#define MIPV6_MH_BE			7++/*+ * Status codes for Binding Acknowledgements+ */+#define SUCCESS				0+#define REASON_UNSPECIFIED		128+#define ADMINISTRATIVELY_PROHIBITED	129+#define INSUFFICIENT_RESOURCES		130+#define HOME_REGISTRATION_NOT_SUPPORTED	131+#define NOT_HOME_SUBNET			132+#define NOT_HA_FOR_MN			133+#define DUPLICATE_ADDR_DETECT_FAIL	134+#define SEQUENCE_NUMBER_OUT_OF_WINDOW	135+#define EXPIRED_HOME_NONCE_INDEX	136+#define EXPIRED_CAREOF_NONCE_INDEX	137+#define EXPIRED_NONCES			138+#define REG_TYPE_CHANGE_FORBIDDEN       139+/*+ * Values for mipv6_flags in struct inet6_skb_parm+ */++#define MIPV6_RCV_TUNNEL		0x1+#define MIPV6_SND_HAO			0x2+++/*+ * Mobility Header Message structures+ */++struct mipv6_mh_brr+{+	__u16		reserved;+	/* Mobility options */+} __attribute__ ((packed));++struct mipv6_mh_bu+{+	__u16		sequence;	/* sequence number of BU	*/+	__u8		flags;		/* flags			*/+	__u8		reserved;	/* reserved bits		*/+	__u16		lifetime;	/* lifetime of BU		*/+	/* Mobility options */+} __attribute__ ((packed));++struct mipv6_mh_ba+{+	__u8		status;		/* statuscode			*/+	__u8		reserved;	/* reserved bits		*/+	__u16		sequence;	/* sequence number of BA	*/+	__u16		lifetime;	/* lifetime in CN's bcache	*/+	/* Mobility options */+} __attribute__ ((packed));++struct mipv6_mh_be+{+	__u8		status;+	__u8		reserved;+	struct in6_addr	home_addr;+	/* Mobility options */+} __attribute__ ((packed));++struct mipv6_mh_addr_ti+{+	__u16		reserved;	/* Reserved			*/+	u_int8_t	init_cookie[8]; /* HoT/CoT Init Cookie		*/+	/* Mobility options */+} __attribute__ ((packed));++struct mipv6_mh_addr_test+{+	__u16		nonce_index;    /* Home/Care-of Nonce Index	*/+	u_int8_t	init_cookie[8]; /* HoT/CoT Init Cookie		*/+	u_int8_t	kgen_token[8];	/* Home/Care-of key generation token */+	/* Mobility options */+} __attribute__ ((packed));++/*+ * Mobility Options for various MH types.+ */+#define MIPV6_OPT_PAD1			0x00+#define MIPV6_OPT_PADN			0x01+#define MIPV6_OPT_BIND_REFRESH_ADVICE	0x02+#define MIPV6_OPT_ALTERNATE_COA		0x03+#define MIPV6_OPT_NONCE_INDICES		0x04+#define MIPV6_OPT_AUTH_DATA		0x05++#define MIPV6_SEQ_GT(x,y) \+        ((short int)(((__u16)(x)) - ((__u16)(y))) > 0)++/*+ * Mobility Option structures+ */++struct mipv6_mo+{+	__u8		type;+	__u8		length;+	__u8		value[0];	/* type specific data */+} __attribute__ ((packed));++struct mipv6_mo_pad1+{+	__u8		type;+} __attribute__ ((packed));++struct mipv6_mo_padn+{+	__u8		type;+	__u8		length;+	__u8		data[0];+} __attribute__ ((packed));++struct mipv6_mo_alt_coa+{+	__u8		type;+	__u8		length;+	struct in6_addr	addr;		/* alternate care-of-address	*/+} __attribute__ ((packed));++struct mipv6_mo_nonce_indices+{+	__u8		type;+	__u8		length;+	__u16		home_nonce_i;	/* Home Nonce Index		*/+	__u16		careof_nonce_i;	/* Careof Nonce Index		*/+} __attribute__ ((packed)); ++struct mipv6_mo_bauth_data+{+	__u8		type;+	__u8		length;+	__u8		data[0];+} __attribute__ ((packed)); ++struct mipv6_mo_br_advice+{+	__u8		type;+	__u8		length;+	__u16		refresh_interval; /* Refresh Interval		*/+} __attribute__ ((packed));++/*+ * Home Address Destination Option structure+ */+struct mipv6_dstopt_homeaddr+{+	__u8		type;		/* type-code for option 	*/+	__u8		length;		/* option length 		*/+	struct in6_addr	addr;		/* home address 		*/+} __attribute__ ((packed));++#endif /* _NET_MIPV6_H */diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/include/net/ndisc.h devel/include/net/ndisc.h--- linux-2.4/include/net/ndisc.h	Sat Aug  2 00:07:53 2003+++ devel/include/net/ndisc.h	Thu Oct  2 13:39:14 2003@@ -21,6 +21,10 @@ #define ND_OPT_REDIRECT_HDR		4 #define ND_OPT_MTU			5 +/* Mobile IPv6 specific ndisc options */ +#define ND_OPT_RTR_ADV_INTERVAL		7 +#define ND_OPT_HOME_AGENT_INFO		8  + #define MAX_RTR_SOLICITATION_DELAY	HZ  #define ND_REACHABLE_TIME		(30*HZ)diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/include/net/sock.h devel/include/net/sock.h--- linux-2.4/include/net/sock.h	Sat Aug  2 00:07:53 2003+++ devel/include/net/sock.h	Thu Oct  2 13:36:16 2003@@ -146,7 +146,9 @@ 	struct in6_addr 	rcv_saddr; 	struct in6_addr		daddr; 	struct in6_addr		*daddr_cache;-+#if defined(CONFIG_IPV6_SUBTREES)+	struct in6_addr		*saddr_cache;+#endif 	__u32			flow_label; 	__u32			frag_size; 	int			hop_limit;diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/net/Makefile devel/net/Makefile--- linux-2.4/net/Makefile	Sat Aug  2 00:07:53 2003+++ devel/net/Makefile	Tue Aug  5 14:11:49 2003@@ -23,6 +23,7 @@ ifneq ($(CONFIG_IPV6),n) ifneq ($(CONFIG_IPV6),) subdir-$(CONFIG_NETFILTER)	+= ipv6/netfilter+subdir-$(CONFIG_IPV6_MOBILITY)	+= ipv6/mobile_ip6 endif endif diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/net/core/neighbour.c devel/net/core/neighbour.c--- linux-2.4/net/core/neighbour.c	Sat Aug  2 00:07:57 2003+++ devel/net/core/neighbour.c	Tue Aug 26 11:08:56 2003@@ -358,7 +358,7 @@ 	if (!creat) 		return NULL; -	n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL);+	n = kmalloc(sizeof(*n) + key_len, GFP_ATOMIC); 	if (n == NULL) 		return NULL; diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/net/ipv6/Config.in devel/net/ipv6/Config.in--- linux-2.4/net/ipv6/Config.in	Sat Aug  2 00:07:57 2003+++ devel/net/ipv6/Config.in	Wed Sep 24 14:29:27 2003@@ -1,9 +1,15 @@ # # IPv6 configuration # -+bool '    IPv6: routing by source address (EXPERIMENTAL)' CONFIG_IPV6_SUBTREES #bool '    IPv6: flow policy support' CONFIG_RT6_POLICY #bool '    IPv6: firewall support' CONFIG_IPV6_FIREWALL++if [ "$CONFIG_IPV6" != "n" ]; then+	dep_tristate '    IPv6: IPv6 over IPv6 Tunneling (EXPERIMENTAL)' CONFIG_IPV6_TUNNEL $CONFIG_IPV6+fi++source net/ipv6/mobile_ip6/Config.in  if [ "$CONFIG_NETFILTER" != "n" ]; then    source net/ipv6/netfilter/Config.indiff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/net/ipv6/Makefile devel/net/ipv6/Makefile--- linux-2.4/net/ipv6/Makefile	Sat Aug  2 00:07:57 2003+++ devel/net/ipv6/Makefile	Wed Sep 24 14:29:27 2003@@ -9,13 +9,27 @@  O_TARGET := ipv6.o +export-objs :=	ipv6_tunnel.o+ obj-y :=	af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o sit.o \ 		route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ 		protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ 		exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ 		ip6_flowlabel.o +ifeq ($(CONFIG_IPV6_TUNNEL),y)+obj-y += ipv6_tunnel.o+endif++ifeq ($(CONFIG_IPV6_MOBILITY),m)+obj-y += mipglue.o+endif+ obj-m  := $(O_TARGET)++ifeq ($(CONFIG_IPV6_TUNNEL),m)+obj-m += ipv6_tunnel.o+endif  #obj-$(CONFIG_IPV6_FIREWALL) += ip6_fw.o diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet linux-2.4/net/ipv6/addrconf.c devel/net/ipv6/addrconf.c--- linux-2.4/net/ipv6/addrconf.c	Sat Aug  2 00:07:57 2003+++ devel/net/ipv6/addrconf.c	Thu Sep 18 23:43:09 2003@@ -68,6 +68,8 @@  #include <asm/uaccess.h> +#include <net/mipglue.h>+ #define IPV6_MAX_ADDRESSES 16  /* Set to 3 to get tracing... */@@ -105,7 +107,7 @@  static void addrconf_dad_start(struct inet6_ifaddr *ifp); static void addrconf_dad_timer(unsigned long data);-static void addrconf_dad_completed(struct inet6_ifaddr *ifp);+void addrconf_dad_completed(struct inet6_ifaddr *ifp); static void addrconf_rs_timer(unsigned long data); static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); @@ -330,38 +332,6 @@ 	return idev; } -void ipv6_addr_prefix(struct in6_addr *prefix,-	struct in6_addr *addr, int prefix_len)-{-	unsigned long mask;-	int ncopy, nbits;--	memset(prefix, 0, sizeof(*prefix));--	if (prefix_len <= 0)-		return;-	if (prefix_len > 128)-		prefix_len = 128;--	ncopy = prefix_len / 32;-	switch (ncop

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -