📄 linux-kernel.diff
字号:
Binary files linux-kernel/arch/um/os-Linux/util/mk_user_constants and mpls-kernel-3/arch/um/os-Linux/util/mk_user_constants differdiff -uNr linux-kernel/include/linux/genetlink.h mpls-kernel-3/include/linux/genetlink.h--- linux-kernel/include/linux/genetlink.h 2005-11-15 21:43:47.000000000 -0600+++ mpls-kernel-3/include/linux/genetlink.h 2005-11-22 12:21:03.000000000 -0600@@ -48,4 +48,35 @@ #define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) +enum {+ MPLS_CMD_UNSPEC,+ MPLS_CMD_NEWILM,+ MPLS_CMD_DELILM,+ MPLS_CMD_GETILM,+ MPLS_CMD_NEWNHLFE,+ MPLS_CMD_DELNHLFE,+ MPLS_CMD_GETNHLFE,+ MPLS_CMD_NEWXC,+ MPLS_CMD_DELXC,+ MPLS_CMD_GETXC,+ MPLS_CMD_SETLABELSPACE,+ MPLS_CMD_GETLABELSPACE,+ __MPLS_CMD_MAX,+};++#define MPLS_CMD_MAX (__MPLS_CMD_MAX - 1)++enum {+ MPLS_ATTR_UNSPEC,+ MPLS_ATTR_ILM,+ MPLS_ATTR_NHLFE,+ MPLS_ATTR_XC,+ MPLS_ATTR_LABELSPACE,+ MPLS_ATTR_INSTR,+ MPLS_ATTR_STATS,+ __MPLS_ATTR_MAX,+};++#define MPLS_ATTR_MAX (__MPLS_ATTR_MAX - 1)+ #endif /* __LINUX_GENERIC_NETLINK_H */diff -uNr linux-kernel/include/linux/if_arp.h mpls-kernel-3/include/linux/if_arp.h--- linux-kernel/include/linux/if_arp.h 2005-11-15 21:43:48.000000000 -0600+++ mpls-kernel-3/include/linux/if_arp.h 2005-11-15 23:21:15.000000000 -0600@@ -85,6 +85,7 @@ #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap 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/mpls.h mpls-kernel-3/include/linux/mpls.h--- linux-kernel/include/linux/mpls.h 1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-3/include/linux/mpls.h 2005-11-01 22:18:35.000000000 -0600@@ -0,0 +1,255 @@+/*****************************************************************************+ * 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>+ *+ * include/linux/mpls.h+ * 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>+#include <linux/if.h>+#else+#include <sys/socket.h>+#include <net/if.h>+#endif++#define MPLS_NUM_OPS 8++#define MPLS_LINUX_VERSION 0x01090500++#define MPLS_GRP_ILM 1+#define MPLS_GRP_NHLFE 2+#define MPLS_GRP_XC 4+#define MPLS_GRP_LABELSPACE 8++#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 */++#define MPLS_CHANGE_MTU 0x01+#define MPLS_CHANGE_PROP_TTL 0x02+#define MPLS_CHANGE_INSTR 0x04+#define MPLS_CHANGE_PROTO 0x10++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 int mil_proto;+ struct mpls_label mil_label;+ unsigned char mil_change_flag;+};++#define MPLS_LABELSPACE_MAX 255++struct mpls_labelspace_req {+ 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 {+ struct mpls_label mol_label;+ u_int32_t mol_mtu;+ int8_t mol_propagate_ttl;+ unsigned char mol_change_flag;+};++struct mpls_netfilter_target_info {+ u_int32_t key;++ /* only used by the netfilter kernel modules */+ void *nhlfe;+ void *proto;+};++struct mpls_xconnect_req {+ struct mpls_label mx_in;+ struct mpls_label mx_out;+};++struct mpls_tunnel_req {+ 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 {+ 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-3/include/linux/netdevice.h--- linux-kernel/include/linux/netdevice.h 2005-11-15 21:43:48.000000000 -0600+++ mpls-kernel-3/include/linux/netdevice.h 2005-11-15 23:17:03.000000000 -0600@@ -367,6 +367,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 */ /* * Cache line mostly used on receive path (including eth_type_trans())diff -uNr linux-kernel/include/linux/ppp_defs.h mpls-kernel-3/include/linux/ppp_defs.h--- linux-kernel/include/linux/ppp_defs.h 2004-08-03 23:07:51.000000000 -0500+++ mpls-kernel-3/include/linux/ppp_defs.h 2005-04-20 20:57:25.000000000 -0500@@ -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-3/include/linux/rtnetlink.h--- linux-kernel/include/linux/rtnetlink.h 2006-01-04 23:44:43.000000000 -0600+++ mpls-kernel-3/include/linux/rtnetlink.h 2006-01-05 00:13:03.000000000 -0600@@ -262,6 +262,7 @@ RTA_CACHEINFO, RTA_SESSION, RTA_MP_ALGO,+ RTA_SHIM, __RTA_MAX }; diff -uNr linux-kernel/include/linux/shim.h mpls-kernel-3/include/linux/shim.h--- linux-kernel/include/linux/shim.h 1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-3/include/linux/shim.h 2005-09-06 20:57:44.000000000 -0500@@ -0,0 +1,12 @@+#ifndef LINUX_SHIM_H+#define LINUX_SHIM_H++#define SHIMNAMSIZ 16+struct rtshim+{+ char name[SHIMNAMSIZ+1];+ short datalen;+ char data[0];+};++#endifdiff -uNr linux-kernel/include/linux/socket.h mpls-kernel-3/include/linux/socket.h--- linux-kernel/include/linux/socket.h 2005-11-15 21:43:49.000000000 -0600+++ mpls-kernel-3/include/linux/socket.h 2005-11-15 23:17:15.000000000 -0600@@ -187,6 +187,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.. */ @@ -220,6 +221,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/ip6_fib.h mpls-kernel-3/include/net/ip6_fib.h--- linux-kernel/include/net/ip6_fib.h 2005-09-19 22:47:50.000000000 -0500+++ mpls-kernel-3/include/net/ip6_fib.h 2005-09-20 23:15:13.000000000 -0500@@ -76,6 +76,7 @@ struct rt6key rt6i_src; u8 rt6i_protocol;+ struct shim_blk *rt6i_shim; }; struct fib6_walker_tdiff -uNr linux-kernel/include/net/ip_fib.h mpls-kernel-3/include/net/ip_fib.h--- linux-kernel/include/net/ip_fib.h 2005-11-15 21:43:50.000000000 -0600+++ mpls-kernel-3/include/net/ip_fib.h 2005-11-15 23:17:24.000000000 -0600@@ -38,6 +38,7 @@ struct rta_cacheinfo *rta_ci; struct rta_session *rta_sess; u32 *rta_mp_alg;+ struct rtshim *rta_shim; }; struct fib_info;@@ -57,6 +58,7 @@ #endif int nh_oif; u32 nh_gw;+ struct shim_blk *nh_shim; }; /*@@ -140,6 +142,7 @@ #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_SHIM(res) (FIB_RES_NH(res).nh_shim) #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED #define FIB_RES_NETWORK(res) ((res).network)diff -uNr linux-kernel/include/net/mpls.h mpls-kernel-3/include/net/mpls.h--- linux-kernel/include/net/mpls.h 1969-12-31 18:00:00.000000000 -0600+++ mpls-kernel-3/include/net/mpls.h 2005-12-21 22:44:36.000000000 -0600@@ -0,0 +1,694 @@+/*****************************************************************************+ * MPLS+ * An implementation of the MPLS (MultiProtocol Label+ * Switching Architecture) for Linux.+ *+ * File: linux/include/net/mpls.h+ *+ * Authors:+ * James Leu <jleu@mindspring.com>+ * Ramon Casellas <casellas@infres.enst.fr>+ *+ * (c) 1999-2004 James Leu <jleu@mindspring.com>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -