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

📄 linux-kernel.diff

📁 基于linux内核2.6.9的mpls补丁
💻 DIFF
📖 第 1 页 / 共 5 页
字号:
diff -uNr linux-kernel/include/linux/if_arp.h mpls-kernel-1/include/linux/if_arp.h--- linux-kernel/include/linux/if_arp.h	2004-07-23 12:29:16.000000000 -0500+++ mpls-kernel-1/include/linux/if_arp.h	2005-01-05 01:09:18.000000000 -0600@@ -84,6 +84,7 @@ #define ARPHRD_IEEE802_TR 800		/* Magic type ident for TR	*/ #define ARPHRD_IEEE80211 801		/* IEEE 802.11			*/ #define ARPHRD_IEEE80211_PRISM 802	/* IEEE 802.11 + Prism2 header  */+#define ARPHRD_MPLS_TUNNEL 899		/* MPLS Tunnel Interface	*/  #define ARPHRD_VOID	  0xFFFF	/* Void type, nothing is known */ #define ARPHRD_NONE	  0xFFFE	/* zero header length */diff -uNr linux-kernel/include/linux/ipv6_route.h mpls-kernel-1/include/linux/ipv6_route.h--- linux-kernel/include/linux/ipv6_route.h	2004-05-19 17:15:24.000000000 -0500+++ mpls-kernel-1/include/linux/ipv6_route.h	2005-01-05 01:09:19.000000000 -0600@@ -38,6 +38,8 @@ 	unsigned long		rtmsg_info;         __u32			rtmsg_flags; 	int			rtmsg_ifindex;+	__u32 			rtmsg_spec_proto;+	__u32			rtmsg_spec_data; };  #define RTMSG_NEWDEVICE		0x11diff -uNr linux-kernel/include/linux/mpls.h mpls-kernel-1/include/linux/mpls.h--- linux-kernel/include/linux/mpls.h	1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-1/include/linux/mpls.h	2005-01-21 23:44:36.000000000 -0600@@ -0,0 +1,298 @@+/*****************************************************************************+ * MPLS+ *      An implementation of the MPLS (MultiProtocol Label+ *      Switching Architecture) for Linux.+ *+ * Authors:+ *          James Leu        <jleu@mindspring.com>+ *          Ramon Casellas   <casellas@infres.enst.fr>+ *+ *   (c) 1999-2004   James Leu        <jleu@mindspring.com>+ *   (c) 2003-2004   Ramon Casellas   <casellas@infres.enst.fr>+ *+ * _THIS_FILE_+ *      Data types and structs used by userspace programs to access MPLS+ *      forwarding. Most interface with the MPLS subsystem is IOCTL based+ *+ *      This program is free software; you can redistribute it and/or+ *      modify it under the terms of the GNU General Public License+ *      as published by the Free Software Foundation; either version+ *      2 of the License, or (at your option) any later version.+ ****************************************************************************/++#ifndef _LINUX_MPLS_H_+#define _LINUX_MPLS_H_++#ifdef __KERNEL__+#include <linux/socket.h>+#else+#include <sys/socket.h>+#endif++#include <linux/if.h>+#define MPLS_NUM_OPS		8++#define MPLS_LINUX_VERSION	0x01090406++++/*************************************************************************+ * Netlink messages+ *+ *+ ****************************************************************************/++/* MII attributes */+enum+{+	MPLS_ATTR_ILM_UNSPEC,+	MPLS_ATTR_ILM_STATS,+	MPLS_ATTR_ILM_INSTR,+	__MPLS_ATTR_ILM_MAX+};++#define MPLS_ATTR_ILM_MAX (__MPLS_ATTR_ILM_MAX - 1)++/* NHLFE attributes */+enum+{+        MPLS_ATTR_NHLFE_UNSPEC,+        MPLS_ATTR_NHLFE_STATS,+        MPLS_ATTR_NHLFE_INSTR,+	__MPLS_ATTR_NHLFE_MAX+};++#define MPLS_ATTR_NHLFE_MAX (__MPLS_ATTR_NHLFE_MAX - 1)++#define	MPLS_GRP_ILM	1+#define	MPLS_GRP_NHLFE	2+#define	MPLS_GRP_XC	4+#define	MPLS_GRP_LABELSPACE 8++#define MPLS_RTM_ADDNHLFE     (RTM_BASE+0)+#define MPLS_RTM_DELNHLFE     (RTM_BASE+1)+#define MPLS_RTM_GETNHLFE     (RTM_BASE+2)++#define MPLS_RTM_ADDILM       (RTM_BASE+4)+#define MPLS_RTM_DELILM       (RTM_BASE+5)+#define MPLS_RTM_GETILM       (RTM_BASE+6)++#define MPLS_RTM_ADDXC       (RTM_BASE+8)+#define MPLS_RTM_DELXC       (RTM_BASE+9)+#define MPLS_RTM_GETXC       (RTM_BASE+10)++#define MPLS_RTM_ADDLABELSPACE (RTM_BASE+12)+#define MPLS_RTM_DELLABELSPACE (RTM_BASE+13)+#define MPLS_RTM_GETLABELSPACE (RTM_BASE+14)++#define MPLS_RTM_ADDTUNNEL   (RTM_BASE+16)+#define MPLS_RTM_DELTUNNEL   (RTM_BASE+17)+#define MPLS_RTM_GETTUNNEL   (RTM_BASE+18)+#define MPLS_RTM_SETTUNNEL_NHLFE (RTM_BASE+19)++#define MPLS_IPV4_EXPLICIT_NULL	0       /* only valid as sole label stack entry+					   Pop label and send to IPv4 stack */+#define MPLS_ROUTER_ALERT	1       /* anywhere except bottom, packet it is+					   forwared to a software module+					   determined by the next label,+					   if the packet is forwarded, push this+					   label back on */+#define MPLS_IPV6_EXPLICIT_NULL	2       /* only valid as sole label stack entry+					   Pop label and send to IPv6 stack */+#define MPLS_IMPLICIT_NULL	3       /* a LIB with this, signifies to pop+					   the next label and use that */++enum mpls_dir {+	MPLS_IN = 0x10,+	MPLS_OUT = 0x20+};++enum mpls_opcode_enum {+	MPLS_OP_NOP = 0x00,+	MPLS_OP_POP,+	MPLS_OP_PEEK,+	MPLS_OP_PUSH,+	MPLS_OP_DLV,+	MPLS_OP_FWD,+	MPLS_OP_NF_FWD,+	MPLS_OP_DS_FWD,+	MPLS_OP_EXP_FWD,+	MPLS_OP_SET,+	MPLS_OP_SET_RX,+	MPLS_OP_SET_TC,+	MPLS_OP_SET_DS,+	MPLS_OP_SET_EXP,+	MPLS_OP_EXP2TC,+	MPLS_OP_EXP2DS,+	MPLS_OP_TC2EXP,+	MPLS_OP_DS2EXP,+	MPLS_OP_NF2EXP,+	MPLS_OP_SET_NF,+	MPLS_OP_MAX+};++enum mpls_label_type_enum {+	MPLS_LABEL_GEN = 1,+	MPLS_LABEL_ATM,+	MPLS_LABEL_FR,+	MPLS_LABEL_KEY+};++struct mpls_label_atm {+	u_int16_t  mla_vpi;+	u_int16_t  mla_vci;+};++struct mpls_label {+	enum mpls_label_type_enum ml_type;+	union {+		u_int32_t ml_key;+		u_int32_t ml_gen;+		u_int32_t ml_fr;+		struct mpls_label_atm ml_atm;+	} u;+	int ml_index;+};++struct mpls_in_label_req {+	unsigned short	  mil_family;+	unsigned int      mil_age;+	unsigned int      mil_proto;+	struct mpls_label mil_label;+};++#define MPLS_LABELSPACE_MAX	255++struct mpls_labelspace_req {+	int mls_family;+	int mls_ifindex;                  /* Index to the MPLS-enab. interface*/+	int mls_labelspace;               /* Labelspace IN/SET -- OUT/GET     */ +};++struct mpls_nexthop_info {+	unsigned int    mni_if;+	struct sockaddr mni_addr;+};++struct mpls_out_label_req {+	unsigned short	  mol_family;+	unsigned int      mol_age;+	struct mpls_label mol_label;+	u_int32_t         mol_mtu;+	u_int8_t          mol_propagate_ttl;+};++struct mpls_xconnect_req {+	unsigned short mx_family;+	struct mpls_label mx_in;+	struct mpls_label mx_out;+};++struct mpls_tunnel_req {+	unsigned short mt_family;+	char mt_ifname[IFNAMSIZ];+	unsigned int mt_nhlfe_key;+};++#define MPLS_NFMARK_NUM 64++struct mpls_nfmark_fwd {+	unsigned int nf_key[MPLS_NFMARK_NUM];+	unsigned short nf_mask;+};++#define MPLS_DSMARK_NUM 64++struct mpls_dsmark_fwd {+	unsigned int df_key[MPLS_DSMARK_NUM];+	unsigned char df_mask;+};++#define MPLS_TCINDEX_NUM 64++struct mpls_tcindex_fwd {+	unsigned int tc_key[MPLS_TCINDEX_NUM];+	unsigned short tc_mask;+};++#define MPLS_EXP_NUM 8++struct mpls_exp_fwd {+	unsigned int ef_key[MPLS_EXP_NUM];+};++struct mpls_exp2tcindex {+	unsigned short e2t[MPLS_EXP_NUM];+};++struct mpls_exp2dsmark {+	unsigned char e2d[MPLS_EXP_NUM];+};++struct mpls_tcindex2exp {+	unsigned char t2e_mask;+	unsigned char t2e[MPLS_TCINDEX_NUM];+};++struct mpls_dsmark2exp {+	unsigned char d2e_mask;+	unsigned char d2e[MPLS_DSMARK_NUM];+};++struct mpls_nfmark2exp {+	unsigned char n2e_mask;+	unsigned char n2e[MPLS_NFMARK_NUM];+};++struct mpls_instr_elem {+	unsigned short mir_opcode;+	unsigned char mir_direction;+	union {+		struct mpls_label        push;+		struct mpls_label        fwd;+		struct mpls_nfmark_fwd   nf_fwd;+		struct mpls_dsmark_fwd   ds_fwd;+		struct mpls_exp_fwd      exp_fwd;+		struct mpls_nexthop_info set;+		unsigned int             set_rx;+		unsigned short           set_tc;+		unsigned short           set_ds;+		unsigned char            set_exp;+		struct mpls_exp2tcindex  exp2tc;+		struct mpls_exp2dsmark   exp2ds;+		struct mpls_tcindex2exp  tc2exp;+		struct mpls_dsmark2exp   ds2exp;+		struct mpls_nfmark2exp   nf2exp;+		unsigned long            set_nf;+	} mir_data;+};++/* Standard shortcuts */+#define mir_push       mir_data.push+#define mir_fwd        mir_data.fwd+#define mir_nf_fwd     mir_data.nf_fwd+#define mir_ds_fwd     mir_data.ds_fwd+#define mir_exp_fwd    mir_data.exp_fwd+#define mir_set        mir_data.set+#define mir_set_rx     mir_data.set_rx+#define mir_set_tc     mir_data.set_tc+#define mir_set_tx     mir_data.set_tx+#define mir_set_ds     mir_data.set_ds+#define mir_set_exp    mir_data.set_exp+#define mir_set_nf     mir_data.set_nf+#define mir_exp2tc     mir_data.exp2tc+#define mir_exp2ds     mir_data.exp2ds+#define mir_tc2exp     mir_data.tc2exp+#define mir_ds2exp     mir_data.ds2exp+#define mir_nf2exp     mir_data.nf2exp++struct mpls_instr_req {+	unsigned short		     mir_family;+	struct mpls_instr_elem       mir_instr[MPLS_NUM_OPS];+	unsigned char                mir_instr_length;+	unsigned char                mir_direction;+	int                          mir_index;+	struct mpls_label            mir_label;+};++#endifdiff -uNr linux-kernel/include/linux/netdevice.h mpls-kernel-1/include/linux/netdevice.h--- linux-kernel/include/linux/netdevice.h	2004-10-22 13:40:31.000000000 -0500+++ mpls-kernel-1/include/linux/netdevice.h	2005-01-05 01:09:22.000000000 -0600@@ -360,6 +360,7 @@ 	void                    *ip6_ptr;       /* IPv6 specific data */ 	void			*ec_ptr;	/* Econet specific data	*/ 	void			*ax25_ptr;	/* AX.25 specific data */+	void			*mpls_ptr;	/* MPLS specific data */  	struct list_head	poll_list;	/* Link to poll list	*/ 	int			quota;diff -uNr linux-kernel/include/linux/netfilter_ipv4/ipt_spec_nh.h mpls-kernel-1/include/linux/netfilter_ipv4/ipt_spec_nh.h--- linux-kernel/include/linux/netfilter_ipv4/ipt_spec_nh.h	1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-1/include/linux/netfilter_ipv4/ipt_spec_nh.h	2005-01-05 01:09:23.000000000 -0600@@ -0,0 +1,9 @@+#ifndef _IPT_SPEC_NH_H_target+#define _IPT_SPEC_NH_H_target++struct ipt_spec_nh_target_info {+	unsigned short proto;+	unsigned int data;+};++#endif /*_IPT_SPEC_NH_H_target*/diff -uNr linux-kernel/include/linux/netfilter_ipv6/ip6t_spec_nh.h mpls-kernel-1/include/linux/netfilter_ipv6/ip6t_spec_nh.h--- linux-kernel/include/linux/netfilter_ipv6/ip6t_spec_nh.h	1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-1/include/linux/netfilter_ipv6/ip6t_spec_nh.h	2005-01-05 01:09:24.000000000 -0600@@ -0,0 +1,9 @@+#ifndef _IP6T_SPEC_NH_H_target+#define _IP6T_SPEC_NH_H_target++struct ip6t_spec_nh_target_info {+	unsigned short proto;+	unsigned int data;+};++#endif /*_IP6T_SPEC_NH_H_target*/diff -uNr linux-kernel/include/linux/ppp_defs.h mpls-kernel-1/include/linux/ppp_defs.h--- linux-kernel/include/linux/ppp_defs.h	2004-08-03 23:07:51.000000000 -0500+++ mpls-kernel-1/include/linux/ppp_defs.h	2005-01-05 01:09:27.000000000 -0600@@ -84,7 +84,7 @@ #define PPP_IPV6CP	0x8057	/* IPv6 Control Protocol */ #define PPP_CCPFRAG	0x80fb	/* CCP at link level (below MP bundle) */ #define PPP_CCP		0x80fd	/* Compression Control Protocol */-#define PPP_MPLSCP	0x80fd	/* MPLS Control Protocol */+#define PPP_MPLSCP	0x8281	/* MPLS Control Protocol */ #define PPP_LCP		0xc021	/* Link Control Protocol */ #define PPP_PAP		0xc023	/* Password Authentication Protocol */ #define PPP_LQR		0xc025	/* Link Quality Report protocol */diff -uNr linux-kernel/include/linux/rtnetlink.h mpls-kernel-1/include/linux/rtnetlink.h--- linux-kernel/include/linux/rtnetlink.h	2004-10-22 13:40:34.000000000 -0500+++ mpls-kernel-1/include/linux/rtnetlink.h	2005-01-05 01:09:28.000000000 -0600@@ -250,6 +250,8 @@ 	RTA_FLOW, 	RTA_CACHEINFO, 	RTA_SESSION,+	RTA_SPEC_PROTO,+	RTA_SPEC_DATA, 	__RTA_MAX }; @@ -273,6 +275,8 @@ 	unsigned char		rtnh_flags; 	unsigned char		rtnh_hops; 	int			rtnh_ifindex;+	unsigned int		rtnh_spec_proto;+	unsigned int		rtnh_spec_data; };  /* rtnh_flags */diff -uNr linux-kernel/include/linux/socket.h mpls-kernel-1/include/linux/socket.h--- linux-kernel/include/linux/socket.h	2004-10-22 13:40:35.000000000 -0500+++ mpls-kernel-1/include/linux/socket.h	2005-01-05 01:09:30.000000000 -0600@@ -176,6 +176,7 @@ #define AF_PPPOX	24	/* PPPoX sockets		*/ #define AF_WANPIPE	25	/* Wanpipe API Sockets */ #define AF_LLC		26	/* Linux LLC			*/+#define AF_MPLS		30	/* MPLS sockets			*/ #define AF_BLUETOOTH	31	/* Bluetooth sockets 		*/ #define AF_MAX		32	/* For now.. */ @@ -209,6 +210,7 @@ #define PF_WANPIPE	AF_WANPIPE #define PF_LLC		AF_LLC #define PF_BLUETOOTH	AF_BLUETOOTH+#define PF_MPLS		AF_MPLS #define PF_MAX		AF_MAX  /* Maximum queue length specifiable by listen.  */diff -uNr linux-kernel/include/net/ip_fib.h mpls-kernel-1/include/net/ip_fib.h--- linux-kernel/include/net/ip_fib.h	2004-10-22 13:40:37.000000000 -0500+++ mpls-kernel-1/include/net/ip_fib.h	2005-01-05 01:09:35.000000000 -0600@@ -37,6 +37,8 @@ 	u32		*rta_flow; 	struct rta_cacheinfo *rta_ci; 	struct rta_session *rta_sess;+	unsigned short	*rta_spec_proto;+	u32		*rta_spec_data; };  struct fib_info;@@ -56,6 +58,8 @@ #endif 	int			nh_oif; 	u32			nh_gw;+	unsigned short		nh_spec_proto;+	u32			nh_spec_data; };  /*@@ -118,6 +122,8 @@ #define FIB_RES_GW(res)			(FIB_RES_NH(res).nh_gw) #define FIB_RES_DEV(res)		(FIB_RES_NH(res).nh_dev) #define FIB_RES_OIF(res)		(FIB_RES_NH(res).nh_oif)+#define FIB_RES_SPEC_PROTO(res)		(FIB_RES_NH(res).nh_spec_proto)+#define FIB_RES_SPEC_DATA(res)		(FIB_RES_NH(res).nh_spec_data)  struct fib_table {

⌨️ 快捷键说明

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