This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A implementation of the rapid spanning tree protocol for linux.".
The branch, master has been updated via 8551b0db50a02ca829be03ed6d1e86d09b9828b8 (commit) via 54aa4d79759e468c128fe8a67ca4361cc2cfa993 (commit) via 2a16118a2b99852472f8d6ec1d3d955e7efb580e (commit) via 26a8656de086b649de834a80d07fd2b9ddcb593d (commit) via 4af1be45c4be855c1053a11dd9d631f7d3c7700f (commit) via b79b9a98650cd8018141874d2a5e59c1cd78ea3c (commit) via 18da741b5f843f196b7a1ba8d85da8506a1a58f6 (commit) via 76eb7423e188f6852ba9ced4352e0d61f4dace4d (commit) via 28be5578db47550d47ef091ad240dfa933c0baf8 (commit) from c768cf44f87815675da145938c2d9b56574063ec (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 8551b0db50a02ca829be03ed6d1e86d09b9828b8 Merge: c768cf4 54aa4d7 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed May 25 11:36:42 2011 +0200
Merge remote-tracking branch 'upstream/master'
Conflicts: Makefile brmon.c
commit 54aa4d79759e468c128fe8a67ca4361cc2cfa993 Author: Stephen Hemminger shemminger@vyatta.com Date: Wed May 18 16:26:51 2011 -0700
Fix monitoring code
Ignore OPERSTATE since bridge doesn't report this correctly. Ignore messages about our own state changes Remove dead code.
commit 2a16118a2b99852472f8d6ec1d3d955e7efb580e Author: Stephen Hemminger shemminger@vyatta.com Date: Wed May 18 16:08:56 2011 -0700
Turn off compiler strict aliasing
The code does things like ntohs(*(unsigned short*) b->message_age) which break strict alias checking in gcc.
commit 26a8656de086b649de834a80d07fd2b9ddcb593d Author: Stephen Hemminger shemminger@vyatta.com Date: Wed May 18 15:48:59 2011 -0700
Remove code for passing STP BPDU via netlink
EMC implemented a mechanism of passing BPDU via netlink that was never accepted in upstream kernel.
commit 4af1be45c4be855c1053a11dd9d631f7d3c7700f Author: Stephen Hemminger shemminger@vyatta.com Date: Wed May 18 15:48:22 2011 -0700
remove dead code
commit b79b9a98650cd8018141874d2a5e59c1cd78ea3c Author: Alexander Yurchenko a.yurchenko@scalaxy.ru Date: Fri Feb 19 12:26:34 2010 +0300
Fix null pointer dereference in bridge_bpdu_rcv
Check that the interface on which bpdu was received is actually a bridge port. It's possible to receive an STP packet on a bridge interface itself if the bridge has STP disabled and forwards STP traffic.
Signed-off-by: Alexander Yurchenko a.yurchenko@scalaxy.ru
commit 18da741b5f843f196b7a1ba8d85da8506a1a58f6 Author: Alexander Yurchenko a.yurchenko@scalaxy.ru Date: Fri Feb 19 13:27:16 2010 +0300
Fix rstpctl usage
Add missing ``rstp'' command to the rstpctl arguments.
Signed-off-by: Alexander Yurchenko a.yurchenko@scalaxy.ru
commit 76eb7423e188f6852ba9ced4352e0d61f4dace4d Author: Denys Fedoryschenko denys@visp.net.lb Date: Wed Apr 1 09:06:55 2009 -0700
fixes for 4.3.3 GCC warnings/errors
After fetching current git code and compiling with gcc 4.3.3 got errors related to Werror (2 functions was ignoring return value), and ulimits.h was not declared, but INT_MAX used Here is fix, so rstp compile fine with gcc 4.3.3
Signed-off-by: Denys Fedoryschenko denys@visp.net.lb
commit 28be5578db47550d47ef091ad240dfa933c0baf8 Author: Stephen Hemminger stephen.hemminger@vyatta.com Date: Wed Apr 1 09:00:14 2009 -0700
Update headers to 2.6.29
-----------------------------------------------------------------------
Summary of changes: Makefile | 3 +- bridge-stp | 4 +- bridge_track.c | 2 +- brmon.c | 129 ++++---------- include/linux/llc.h | 11 +- include/linux/rtnetlink.h | 425 +++++++-------------------------------------- 6 files changed, 104 insertions(+), 470 deletions(-)
Difference in files: diff --git a/Makefile b/Makefile index c65dd39..f672a45 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,8 @@ CTLSOURCES = ctl_main.c ctl_cli_wrap.c ctl_socket_client.c CTLOBJECTS = $(CTLSOURCES:.c=.o)
CC=gcc -CFLAGS = -Wall -Werror -O2 -g -D_REENTRANT -D__LINUX__ -DVERSION=$(version) -DBUILD=$(build) -I. -I./include +CFLAGS = -Wall -Werror -fno-strict-aliasing -O2 -g -D_REENTRANT -D__LINUX__ \ + -DVERSION=$(version) -DBUILD=$(build) -I. -I./include -I./rstplib
all: rstpd rstpctl
diff --git a/bridge-stp b/bridge-stp index 49d5a41..5e663a9 100755 --- a/bridge-stp +++ b/bridge-stp @@ -53,9 +53,9 @@ start() { case $2 in start) daemon - exec /sbin/rstpctl $bridge on ;; + exec /sbin/rstpctl rstp $bridge on ;; stop) - exec /sbin/rstpctl $bridge off ;; + exec /sbin/rstpctl rstp $bridge off ;; *) echo "Unknown action:" $2 echo "Usage: bridge-stp <bridge> {start|stop}" diff --git a/bridge_track.c b/bridge_track.c index c685935..f5efa3f 100644 --- a/bridge_track.c +++ b/bridge_track.c @@ -449,7 +449,7 @@ void bridge_bpdu_rcv(int if_index, const unsigned char *data, int len) struct ifdata *ifc = find_if(if_index);
LOG("ifindex %d, len %d", if_index, len); - if (!ifc) + if (!ifc || !ifc->master) return;
TST(ifc->up,); diff --git a/brmon.c b/brmon.c index d29e7f5..fd4dacd 100644 --- a/brmon.c +++ b/brmon.c @@ -30,32 +30,10 @@
static const char SNAPSHOT[] = "v0.1";
- -/* RFC 2863 operational status */ -enum { - IF_OPER_UNKNOWN, - IF_OPER_NOTPRESENT, - IF_OPER_DOWN, - IF_OPER_LOWERLAYERDOWN, - IF_OPER_TESTING, - IF_OPER_DORMANT, - IF_OPER_UP, -}; - -/* link modes */ -enum { - IF_LINK_MODE_DEFAULT, - IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */ -}; - -static const char *port_states[] = { - [BR_STATE_DISABLED] = "disabled", - [BR_STATE_LISTENING] = "listening", - [BR_STATE_LEARNING] = "learning", - [BR_STATE_FORWARDING] = "forwarding", - [BR_STATE_BLOCKING] = "blocking", -}; - +static int is_up(const struct ifinfomsg *ifi) +{ + return (ifi->ifi_flags & IFF_UP) && (ifi->ifi_flags & IFF_RUNNING); +}
static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) @@ -64,25 +42,16 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, struct ifinfomsg *ifi = NLMSG_DATA(n); struct rtattr * tb[IFLA_MAX+1]; int len = n->nlmsg_len; + int master = -1; char b1[IFNAMSIZ]; - int af_family = ifi->ifi_family;
if (n->nlmsg_type == NLMSG_DONE) return 0; - + len -= NLMSG_LENGTH(sizeof(*ifi)); - if (len < 0) { + if (len < 0) return -1; - } - -#if 0 - - if (filter.ifindex && ifi->ifi_index != filter.ifindex) - return 0;
- if (filter.up && !(ifi->ifi_flags&IFF_UP)) - return 0; -#endif if (ifi->ifi_family != AF_BRIDGE && ifi->ifi_family != AF_UNSPEC) return 0;
@@ -93,73 +62,41 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
/* Check if we got this from bonding */ - if (tb[IFLA_MASTER] && af_family != AF_BRIDGE) - return 0; + if (tb[IFLA_MASTER] && ifi->ifi_family != AF_BRIDGE) + return 0; + + /* Check if hearing our own state changes */ + if (n->nlmsg_type == RTM_NEWLINK && tb[IFLA_PROTINFO]) { + uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]); + + if (state != BR_STATE_DISABLED) + return 0; + }
if (tb[IFLA_IFNAME] == NULL) { - fprintf(stderr, "BUG: nil ifname\n"); - return -1; + fprintf(stderr, "BUG: nil ifname\n"); + return -1; }
if (n->nlmsg_type == RTM_DELLINK) - fprintf(fp, "Deleted "); + fprintf(fp, "Deleted ");
fprintf(fp, "%d: %s ", ifi->ifi_index, - tb[IFLA_IFNAME] ? (char*)RTA_DATA(tb[IFLA_IFNAME]) : "<nil>"); - - - if (tb[IFLA_OPERSTATE]) { - int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]); - switch (state) { - case IF_OPER_UNKNOWN: - fprintf(fp, "Unknown "); break; - case IF_OPER_NOTPRESENT: - fprintf(fp, "Not Present "); break; - case IF_OPER_DOWN: - fprintf(fp, "Down "); break; - case IF_OPER_LOWERLAYERDOWN: - fprintf(fp, "Lowerlayerdown "); break; - case IF_OPER_TESTING: - fprintf(fp, "Testing "); break; - case IF_OPER_DORMANT: - fprintf(fp, "Dormant "); break; - case IF_OPER_UP: - fprintf(fp, "Up "); break; - default: - fprintf(fp, "State(%d) ", state); - } - } - - if (tb[IFLA_MTU]) - fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU])); + (const char*)RTA_DATA(tb[IFLA_IFNAME]));
if (tb[IFLA_MASTER]) { - fprintf(fp, "master %s ", - if_indextoname(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1)); - } - - if (tb[IFLA_PROTINFO]) { - uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]); - if (state <= BR_STATE_BLOCKING) - fprintf(fp, "state %s", port_states[state]); - else - fprintf(fp, "state (%d)", state); + master = *(int*)RTA_DATA(tb[IFLA_MASTER]); + fprintf(fp, "master %s ", if_indextoname(master, b1)); }
- fprintf(fp, "\n"); fflush(fp); - { - int newlink = (n->nlmsg_type == RTM_NEWLINK); - int up = 0; - if (newlink && tb[IFLA_OPERSTATE]) { - int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]); - up = (state == IF_OPER_UP) || (state == IF_OPER_UNKNOWN); - } - - bridge_notify((tb[IFLA_MASTER]?*(int*)RTA_DATA(tb[IFLA_MASTER]):-1), - ifi->ifi_index, newlink, up); - } + + + bridge_notify(master, ifi->ifi_index, + (n->nlmsg_type == RTM_NEWLINK), + is_up(ifi)); + return 0; }
@@ -252,7 +189,7 @@ int init_bridge_ops(void) fprintf(stderr, "Couldn't open rtnl socket for monitoring\n"); return -1; } - + if (rtnl_open(&rth_state, 0) < 0) { fprintf(stderr, "Couldn't open rtnl socket for setting state\n"); return -1; @@ -262,7 +199,7 @@ int init_bridge_ops(void) fprintf(stderr, "Cannot send dump request: %m\n"); return -1; } - + if (rtnl_dump_filter(&rth, dump_msg, stdout, NULL, NULL) < 0) { fprintf(stderr, "Dump terminated\n"); return -1; @@ -276,10 +213,10 @@ int init_bridge_ops(void) br_handler.fd = rth.fd; br_handler.arg = NULL; br_handler.handler = br_ev_handler; - + if (add_epoll(&br_handler) < 0) return -1; - + return 0; }
diff --git a/include/linux/llc.h b/include/linux/llc.h index 09f2e6d..6bb32fe 100644 --- a/include/linux/llc.h +++ b/include/linux/llc.h @@ -49,9 +49,9 @@ enum llc_sockopts {
/* LLC SAP types. */ #define LLC_SAP_NULL 0x00 /* NULL SAP. */ -#define LLC_SAP_LLC 0x02 /* LLC Sublayer Managment. */ +#define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */ #define LLC_SAP_SNA 0x04 /* SNA Path Control. */ -#define LLC_SAP_PNM 0x0E /* Proway Network Managment. */ +#define LLC_SAP_PNM 0x0E /* Proway Network Management. */ #define LLC_SAP_IP 0x06 /* TCP/IP. */ #define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */ #define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */ @@ -70,11 +70,4 @@ enum llc_sockopts { #define LLC_SAP_RM 0xD4 /* Resource Management */ #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
-#ifdef __KERNEL__ -#define LLC_SAP_DYN_START 0xC0 -#define LLC_SAP_DYN_STOP 0xDE -#define LLC_SAP_DYN_TRIES 4 - -#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0])) -#endif /* __KERNEL__ */ #endif /* __LINUX_LLC_H */ diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 5e33a20..ba9e46c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -1,7 +1,11 @@ #ifndef __LINUX_RTNETLINK_H #define __LINUX_RTNETLINK_H
+#include <linux/types.h> #include <linux/netlink.h> +#include <linux/if_link.h> +#include <linux/if_addr.h> +#include <linux/neighbour.h>
/**** * Routing/neighbour discovery messages. @@ -80,8 +84,6 @@ enum {
RTM_NEWPREFIX = 52, #define RTM_NEWPREFIX RTM_NEWPREFIX - RTM_GETPREFIX = 54, -#define RTM_GETPREFIX RTM_GETPREFIX
RTM_GETMULTICAST = 58, #define RTM_GETMULTICAST RTM_GETMULTICAST @@ -96,6 +98,21 @@ enum { RTM_SETNEIGHTBL, #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
+ RTM_NEWNDUSEROPT = 68, +#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT + + RTM_NEWADDRLABEL = 72, +#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL + RTM_DELADDRLABEL, +#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL + RTM_GETADDRLABEL, +#define RTM_GETADDRLABEL RTM_GETADDRLABEL + + RTM_GETDCB = 78, +#define RTM_GETDCB RTM_GETDCB + RTM_SETDCB, +#define RTM_SETDCB RTM_SETDCB + __RTM_MAX, #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) }; @@ -235,13 +252,12 @@ enum rt_class_t { RT_TABLE_UNSPEC=0, /* User defined values */ + RT_TABLE_COMPAT=252, RT_TABLE_DEFAULT=253, RT_TABLE_MAIN=254, RT_TABLE_LOCAL=255, - __RT_TABLE_MAX + RT_TABLE_MAX=0xFFFFFFFF }; -#define RT_TABLE_MAX (__RT_TABLE_MAX - 1) -
/* Routing message attributes */ @@ -258,11 +274,12 @@ enum rtattr_type_t RTA_PREFSRC, RTA_METRICS, RTA_MULTIPATH, - RTA_PROTOINFO, + RTA_PROTOINFO, /* no longer used */ RTA_FLOW, RTA_CACHEINFO, - RTA_SESSION, - RTA_MP_ALGO, + RTA_SESSION, /* no longer used */ + RTA_MP_ALGO, /* no longer used */ + RTA_TABLE, __RTA_MAX };
@@ -351,6 +368,8 @@ enum #define RTAX_INITCWND RTAX_INITCWND RTAX_FEATURES, #define RTAX_FEATURES RTAX_FEATURES + RTAX_RTO_MIN, +#define RTAX_RTO_MIN RTAX_RTO_MIN __RTAX_MAX };
@@ -383,226 +402,6 @@ struct rta_session } u; };
- -/********************************************************* - * Interface address. - ****/ - -struct ifaddrmsg -{ - unsigned char ifa_family; - unsigned char ifa_prefixlen; /* The prefix length */ - unsigned char ifa_flags; /* Flags */ - unsigned char ifa_scope; /* See above */ - int ifa_index; /* Link index */ -}; - -enum -{ - IFA_UNSPEC, - IFA_ADDRESS, - IFA_LOCAL, - IFA_LABEL, - IFA_BROADCAST, - IFA_ANYCAST, - IFA_CACHEINFO, - IFA_MULTICAST, - __IFA_MAX -}; - -#define IFA_MAX (__IFA_MAX - 1) - -/* ifa_flags */ - -#define IFA_F_SECONDARY 0x01 -#define IFA_F_TEMPORARY IFA_F_SECONDARY - -#define IFA_F_DEPRECATED 0x20 -#define IFA_F_TENTATIVE 0x40 -#define IFA_F_PERMANENT 0x80 - -struct ifa_cacheinfo -{ - __u32 ifa_prefered; - __u32 ifa_valid; - __u32 cstamp; /* created timestamp, hundredths of seconds */ - __u32 tstamp; /* updated timestamp, hundredths of seconds */ -}; - - -#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) -#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) - -/* - Important comment: - IFA_ADDRESS is prefix address, rather than local interface address. - It makes no difference for normally configured broadcast interfaces, - but for point-to-point IFA_ADDRESS is DESTINATION address, - local address is supplied in IFA_LOCAL attribute. - */ - -/************************************************************** - * Neighbour discovery. - ****/ - -struct ndmsg -{ - unsigned char ndm_family; - unsigned char ndm_pad1; - unsigned short ndm_pad2; - int ndm_ifindex; /* Link index */ - __u16 ndm_state; - __u8 ndm_flags; - __u8 ndm_type; -}; - -enum -{ - NDA_UNSPEC, - NDA_DST, - NDA_LLADDR, - NDA_CACHEINFO, - NDA_PROBES, - __NDA_MAX -}; - -#define NDA_MAX (__NDA_MAX - 1) - -#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) -#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg)) - -/* - * Neighbor Cache Entry Flags - */ - -#define NTF_PROXY 0x08 /* == ATF_PUBL */ -#define NTF_ROUTER 0x80 - -/* - * Neighbor Cache Entry States. - */ - -#define NUD_INCOMPLETE 0x01 -#define NUD_REACHABLE 0x02 -#define NUD_STALE 0x04 -#define NUD_DELAY 0x08 -#define NUD_PROBE 0x10 -#define NUD_FAILED 0x20 - -/* Dummy states */ -#define NUD_NOARP 0x40 -#define NUD_PERMANENT 0x80 -#define NUD_NONE 0x00 - - -struct nda_cacheinfo -{ - __u32 ndm_confirmed; - __u32 ndm_used; - __u32 ndm_updated; - __u32 ndm_refcnt; -}; - - -/***************************************************************** - * Neighbour tables specific messages. - * - * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the - * NLM_F_DUMP flag set. Every neighbour table configuration is - * spread over multiple messages to avoid running into message - * size limits on systems with many interfaces. The first message - * in the sequence transports all not device specific data such as - * statistics, configuration, and the default parameter set. - * This message is followed by 0..n messages carrying device - * specific parameter sets. - * Although the ordering should be sufficient, NDTA_NAME can be - * used to identify sequences. The initial message can be identified - * by checking for NDTA_CONFIG. The device specific messages do - * not contain this TLV but have NDTPA_IFINDEX set to the - * corresponding interface index. - * - * To change neighbour table attributes, send RTM_SETNEIGHTBL - * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], - * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked - * otherwise. Device specific parameter sets can be changed by - * setting NDTPA_IFINDEX to the interface index of the corresponding - * device. - ****/ - -struct ndt_stats -{ - __u64 ndts_allocs; - __u64 ndts_destroys; - __u64 ndts_hash_grows; - __u64 ndts_res_failed; - __u64 ndts_lookups; - __u64 ndts_hits; - __u64 ndts_rcv_probes_mcast; - __u64 ndts_rcv_probes_ucast; - __u64 ndts_periodic_gc_runs; - __u64 ndts_forced_gc_runs; -}; - -enum { - NDTPA_UNSPEC, - NDTPA_IFINDEX, /* u32, unchangeable */ - NDTPA_REFCNT, /* u32, read-only */ - NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ - NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ - NDTPA_RETRANS_TIME, /* u64, msecs */ - NDTPA_GC_STALETIME, /* u64, msecs */ - NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ - NDTPA_QUEUE_LEN, /* u32 */ - NDTPA_APP_PROBES, /* u32 */ - NDTPA_UCAST_PROBES, /* u32 */ - NDTPA_MCAST_PROBES, /* u32 */ - NDTPA_ANYCAST_DELAY, /* u64, msecs */ - NDTPA_PROXY_DELAY, /* u64, msecs */ - NDTPA_PROXY_QLEN, /* u32 */ - NDTPA_LOCKTIME, /* u64, msecs */ - __NDTPA_MAX -}; -#define NDTPA_MAX (__NDTPA_MAX - 1) - -struct ndtmsg -{ - __u8 ndtm_family; - __u8 ndtm_pad1; - __u16 ndtm_pad2; -}; - -struct ndt_config -{ - __u16 ndtc_key_len; - __u16 ndtc_entry_size; - __u32 ndtc_entries; - __u32 ndtc_last_flush; /* delta to now in msecs */ - __u32 ndtc_last_rand; /* delta to now in msecs */ - __u32 ndtc_hash_rnd; - __u32 ndtc_hash_mask; - __u32 ndtc_hash_chain_gc; - __u32 ndtc_proxy_qlen; -}; - -enum { - NDTA_UNSPEC, - NDTA_NAME, /* char *, unchangeable */ - NDTA_THRESH1, /* u32 */ - NDTA_THRESH2, /* u32 */ - NDTA_THRESH3, /* u32 */ - NDTA_CONFIG, /* struct ndt_config, read-only */ - NDTA_PARMS, /* nested TLV NDTPA_* */ - NDTA_STATS, /* struct ndt_stats, read-only */ - NDTA_GC_INTERVAL, /* u64, msecs */ - __NDTA_MAX -}; -#define NDTA_MAX (__NDTA_MAX - 1) - -#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \ - NLMSG_ALIGN(sizeof(struct ndtmsg)))) -#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg)) - - /**** * General form of address family dependent message. ****/ @@ -663,138 +462,6 @@ struct prefix_cacheinfo __u32 valid_time; };
-/* The struct should be in sync with struct net_device_stats */ -struct rtnl_link_stats -{ - __u32 rx_packets; /* total packets received */ - __u32 tx_packets; /* total packets transmitted */ - __u32 rx_bytes; /* total bytes received */ - __u32 tx_bytes; /* total bytes transmitted */ - __u32 rx_errors; /* bad packets received */ - __u32 tx_errors; /* packet transmit problems */ - __u32 rx_dropped; /* no space in linux buffers */ - __u32 tx_dropped; /* no space available in linux */ - __u32 multicast; /* multicast packets received */ - __u32 collisions; - - /* detailed rx_errors: */ - __u32 rx_length_errors; - __u32 rx_over_errors; /* receiver ring buff overflow */ - __u32 rx_crc_errors; /* recved pkt with crc error */ - __u32 rx_frame_errors; /* recv'd frame alignment error */ - __u32 rx_fifo_errors; /* recv'r fifo overrun */ - __u32 rx_missed_errors; /* receiver missed packet */ - - /* detailed tx_errors */ - __u32 tx_aborted_errors; - __u32 tx_carrier_errors; - __u32 tx_fifo_errors; - __u32 tx_heartbeat_errors; - __u32 tx_window_errors; - - /* for cslip etc */ - __u32 rx_compressed; - __u32 tx_compressed; -}; - -/* The struct should be in sync with struct ifmap */ -struct rtnl_link_ifmap -{ - __u64 mem_start; - __u64 mem_end; - __u64 base_addr; - __u16 irq; - __u8 dma; - __u8 port; -}; - -enum -{ - IFLA_UNSPEC, - IFLA_ADDRESS, - IFLA_BROADCAST, - IFLA_IFNAME, - IFLA_MTU, - IFLA_LINK, - IFLA_QDISC, - IFLA_STATS, - IFLA_COST, -#define IFLA_COST IFLA_COST - IFLA_PRIORITY, -#define IFLA_PRIORITY IFLA_PRIORITY - IFLA_MASTER, -#define IFLA_MASTER IFLA_MASTER - IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ -#define IFLA_WIRELESS IFLA_WIRELESS - IFLA_PROTINFO, /* Protocol specific information for a link */ -#define IFLA_PROTINFO IFLA_PROTINFO - IFLA_TXQLEN, -#define IFLA_TXQLEN IFLA_TXQLEN - IFLA_MAP, -#define IFLA_MAP IFLA_MAP - IFLA_WEIGHT, -#define IFLA_WEIGHT IFLA_WEIGHT - IFLA_OPERSTATE, - IFLA_LINKMODE, - __IFLA_MAX -}; - - -#define IFLA_MAX (__IFLA_MAX - 1) - -#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) -#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) - -/* ifi_flags. - - IFF_* flags. - - The only change is: - IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are - more not changeable by user. They describe link media - characteristics and set by device driver. - - Comments: - - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid - - If neither of these three flags are set; - the interface is NBMA. - - - IFF_MULTICAST does not mean anything special: - multicasts can be used on all not-NBMA links. - IFF_MULTICAST means that this media uses special encapsulation - for multicast frames. Apparently, all IFF_POINTOPOINT and - IFF_BROADCAST devices are able to use multicasts too. - */ - -/* IFLA_LINK. - For usual devices it is equal ifi_index. - If it is a "virtual interface" (f.e. tunnel), ifi_link - can point to real physical interface (f.e. for bandwidth calculations), - or maybe 0, what means, that real media is unknown (usual - for IPIP tunnels, when route to endpoint is allowed to change) - */ - -/* Subtype attributes for IFLA_PROTINFO */ -enum -{ - IFLA_INET6_UNSPEC, - IFLA_INET6_FLAGS, /* link flags */ - IFLA_INET6_CONF, /* sysctl parameters */ - IFLA_INET6_STATS, /* statistics */ - IFLA_INET6_MCAST, /* MC things. What of them? */ - IFLA_INET6_CACHEINFO, /* time values and max reasm size */ - __IFLA_INET6_MAX -}; - -#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) - -struct ifla_cacheinfo -{ - __u32 max_reasm_len; - __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ - __u32 reachable_time; - __u32 retrans_time; -};
/***************************************************************** * Traffic control messages. @@ -821,6 +488,7 @@ enum TCA_RATE, TCA_FCNT, TCA_STATS2, + TCA_STAB, __TCA_MAX };
@@ -829,6 +497,32 @@ enum #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+/******************************************************************** + * Neighbor Discovery userland options + ****/ + +struct nduseroptmsg +{ + unsigned char nduseropt_family; + unsigned char nduseropt_pad1; + unsigned short nduseropt_opts_len; /* Total length of options */ + int nduseropt_ifindex; + __u8 nduseropt_icmp_type; + __u8 nduseropt_icmp_code; + unsigned short nduseropt_pad2; + unsigned int nduseropt_pad3; + /* Followed by one or more ND options */ +}; + +enum +{ + NDUSEROPT_UNSPEC, + NDUSEROPT_SRCADDR, + __NDUSEROPT_MAX +}; + +#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) + /* RTnetlink multicast groups - backwards compatibility for userspace */ #define RTMGRP_LINK 1 #define RTMGRP_NOTIFY 2 @@ -883,10 +577,19 @@ enum rtnetlink_groups { RTNLGRP_NOP2, RTNLGRP_DECnet_ROUTE, #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE - RTNLGRP_NOP3, + RTNLGRP_DECnet_RULE, +#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE RTNLGRP_NOP4, RTNLGRP_IPV6_PREFIX, #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX + RTNLGRP_IPV6_RULE, +#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE + RTNLGRP_ND_USEROPT, +#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT + RTNLGRP_PHONET_IFADDR, +#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR + RTNLGRP_PHONET_ROUTE, +#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE __RTNLGRP_MAX }; #define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
hooks/post-receive -- A implementation of the rapid spanning tree protocol for linux.