]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - pkgs/rstp/patches/rstp-0.21-upstream-fixes.patch
c209e99c173280ccd85972428794cc0539c3bf6f
[people/amarx/ipfire-3.x.git] / pkgs / rstp / patches / rstp-0.21-upstream-fixes.patch
1 diff --git a/Makefile b/Makefile
2 index c65dd39..f672a45 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -9,7 +9,8 @@ CTLSOURCES = ctl_main.c ctl_cli_wrap.c ctl_socket_client.c
6 CTLOBJECTS = $(CTLSOURCES:.c=.o)
7
8 CC=gcc
9 -CFLAGS = -Wall -Werror -O2 -g -D_REENTRANT -D__LINUX__ -DVERSION=$(version) -DBUILD=$(build) -I. -I./include
10 +CFLAGS = -Wall -Werror -fno-strict-aliasing -O2 -g -D_REENTRANT -D__LINUX__ \
11 + -DVERSION=$(version) -DBUILD=$(build) -I. -I./include -I./rstplib
12
13 all: rstpd rstpctl
14
15 diff --git a/bridge-stp b/bridge-stp
16 index 49d5a41..5e663a9 100755
17 --- a/bridge-stp
18 +++ b/bridge-stp
19 @@ -53,9 +53,9 @@ start() {
20 case $2 in
21 start)
22 daemon
23 - exec /sbin/rstpctl $bridge on ;;
24 + exec /sbin/rstpctl rstp $bridge on ;;
25 stop)
26 - exec /sbin/rstpctl $bridge off ;;
27 + exec /sbin/rstpctl rstp $bridge off ;;
28 *)
29 echo "Unknown action:" $2
30 echo "Usage: bridge-stp <bridge> {start|stop}"
31 diff --git a/bridge_track.c b/bridge_track.c
32 index c685935..f5efa3f 100644
33 --- a/bridge_track.c
34 +++ b/bridge_track.c
35 @@ -449,7 +449,7 @@ void bridge_bpdu_rcv(int if_index, const unsigned char *data, int len)
36 struct ifdata *ifc = find_if(if_index);
37
38 LOG("ifindex %d, len %d", if_index, len);
39 - if (!ifc)
40 + if (!ifc || !ifc->master)
41 return;
42
43 TST(ifc->up,);
44 diff --git a/brmon.c b/brmon.c
45 index d29e7f5..fd4dacd 100644
46 --- a/brmon.c
47 +++ b/brmon.c
48 @@ -30,32 +30,10 @@
49
50 static const char SNAPSHOT[] = "v0.1";
51
52 -
53 -/* RFC 2863 operational status */
54 -enum {
55 - IF_OPER_UNKNOWN,
56 - IF_OPER_NOTPRESENT,
57 - IF_OPER_DOWN,
58 - IF_OPER_LOWERLAYERDOWN,
59 - IF_OPER_TESTING,
60 - IF_OPER_DORMANT,
61 - IF_OPER_UP,
62 -};
63 -
64 -/* link modes */
65 -enum {
66 - IF_LINK_MODE_DEFAULT,
67 - IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
68 -};
69 -
70 -static const char *port_states[] = {
71 - [BR_STATE_DISABLED] = "disabled",
72 - [BR_STATE_LISTENING] = "listening",
73 - [BR_STATE_LEARNING] = "learning",
74 - [BR_STATE_FORWARDING] = "forwarding",
75 - [BR_STATE_BLOCKING] = "blocking",
76 -};
77 -
78 +static int is_up(const struct ifinfomsg *ifi)
79 +{
80 + return (ifi->ifi_flags & IFF_UP) && (ifi->ifi_flags & IFF_RUNNING);
81 +}
82
83 static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
84 void *arg)
85 @@ -64,25 +42,16 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
86 struct ifinfomsg *ifi = NLMSG_DATA(n);
87 struct rtattr * tb[IFLA_MAX+1];
88 int len = n->nlmsg_len;
89 + int master = -1;
90 char b1[IFNAMSIZ];
91 - int af_family = ifi->ifi_family;
92
93 if (n->nlmsg_type == NLMSG_DONE)
94 return 0;
95 -
96 +
97 len -= NLMSG_LENGTH(sizeof(*ifi));
98 - if (len < 0) {
99 + if (len < 0)
100 return -1;
101 - }
102 -
103 -#if 0
104 -
105 - if (filter.ifindex && ifi->ifi_index != filter.ifindex)
106 - return 0;
107
108 - if (filter.up && !(ifi->ifi_flags&IFF_UP))
109 - return 0;
110 -#endif
111 if (ifi->ifi_family != AF_BRIDGE && ifi->ifi_family != AF_UNSPEC)
112 return 0;
113
114 @@ -93,73 +62,41 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
115 parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
116
117 /* Check if we got this from bonding */
118 - if (tb[IFLA_MASTER] && af_family != AF_BRIDGE)
119 - return 0;
120 + if (tb[IFLA_MASTER] && ifi->ifi_family != AF_BRIDGE)
121 + return 0;
122 +
123 + /* Check if hearing our own state changes */
124 + if (n->nlmsg_type == RTM_NEWLINK && tb[IFLA_PROTINFO]) {
125 + uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]);
126 +
127 + if (state != BR_STATE_DISABLED)
128 + return 0;
129 + }
130
131 if (tb[IFLA_IFNAME] == NULL) {
132 - fprintf(stderr, "BUG: nil ifname\n");
133 - return -1;
134 + fprintf(stderr, "BUG: nil ifname\n");
135 + return -1;
136 }
137
138 if (n->nlmsg_type == RTM_DELLINK)
139 - fprintf(fp, "Deleted ");
140 + fprintf(fp, "Deleted ");
141
142 fprintf(fp, "%d: %s ", ifi->ifi_index,
143 - tb[IFLA_IFNAME] ? (char*)RTA_DATA(tb[IFLA_IFNAME]) : "<nil>");
144 -
145 -
146 - if (tb[IFLA_OPERSTATE]) {
147 - int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]);
148 - switch (state) {
149 - case IF_OPER_UNKNOWN:
150 - fprintf(fp, "Unknown "); break;
151 - case IF_OPER_NOTPRESENT:
152 - fprintf(fp, "Not Present "); break;
153 - case IF_OPER_DOWN:
154 - fprintf(fp, "Down "); break;
155 - case IF_OPER_LOWERLAYERDOWN:
156 - fprintf(fp, "Lowerlayerdown "); break;
157 - case IF_OPER_TESTING:
158 - fprintf(fp, "Testing "); break;
159 - case IF_OPER_DORMANT:
160 - fprintf(fp, "Dormant "); break;
161 - case IF_OPER_UP:
162 - fprintf(fp, "Up "); break;
163 - default:
164 - fprintf(fp, "State(%d) ", state);
165 - }
166 - }
167 -
168 - if (tb[IFLA_MTU])
169 - fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
170 + (const char*)RTA_DATA(tb[IFLA_IFNAME]));
171
172 if (tb[IFLA_MASTER]) {
173 - fprintf(fp, "master %s ",
174 - if_indextoname(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
175 - }
176 -
177 - if (tb[IFLA_PROTINFO]) {
178 - uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]);
179 - if (state <= BR_STATE_BLOCKING)
180 - fprintf(fp, "state %s", port_states[state]);
181 - else
182 - fprintf(fp, "state (%d)", state);
183 + master = *(int*)RTA_DATA(tb[IFLA_MASTER]);
184 + fprintf(fp, "master %s ", if_indextoname(master, b1));
185 }
186
187 -
188 fprintf(fp, "\n");
189 fflush(fp);
190 - {
191 - int newlink = (n->nlmsg_type == RTM_NEWLINK);
192 - int up = 0;
193 - if (newlink && tb[IFLA_OPERSTATE]) {
194 - int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]);
195 - up = (state == IF_OPER_UP) || (state == IF_OPER_UNKNOWN);
196 - }
197 -
198 - bridge_notify((tb[IFLA_MASTER]?*(int*)RTA_DATA(tb[IFLA_MASTER]):-1),
199 - ifi->ifi_index, newlink, up);
200 - }
201 +
202 +
203 + bridge_notify(master, ifi->ifi_index,
204 + (n->nlmsg_type == RTM_NEWLINK),
205 + is_up(ifi));
206 +
207 return 0;
208 }
209
210 @@ -252,7 +189,7 @@ int init_bridge_ops(void)
211 fprintf(stderr, "Couldn't open rtnl socket for monitoring\n");
212 return -1;
213 }
214 -
215 +
216 if (rtnl_open(&rth_state, 0) < 0) {
217 fprintf(stderr, "Couldn't open rtnl socket for setting state\n");
218 return -1;
219 @@ -262,7 +199,7 @@ int init_bridge_ops(void)
220 fprintf(stderr, "Cannot send dump request: %m\n");
221 return -1;
222 }
223 -
224 +
225 if (rtnl_dump_filter(&rth, dump_msg, stdout, NULL, NULL) < 0) {
226 fprintf(stderr, "Dump terminated\n");
227 return -1;
228 @@ -276,10 +213,10 @@ int init_bridge_ops(void)
229 br_handler.fd = rth.fd;
230 br_handler.arg = NULL;
231 br_handler.handler = br_ev_handler;
232 -
233 +
234 if (add_epoll(&br_handler) < 0)
235 return -1;
236 -
237 +
238 return 0;
239 }
240
241 diff --git a/include/linux/llc.h b/include/linux/llc.h
242 index 09f2e6d..6bb32fe 100644
243 --- a/include/linux/llc.h
244 +++ b/include/linux/llc.h
245 @@ -49,9 +49,9 @@ enum llc_sockopts {
246
247 /* LLC SAP types. */
248 #define LLC_SAP_NULL 0x00 /* NULL SAP. */
249 -#define LLC_SAP_LLC 0x02 /* LLC Sublayer Managment. */
250 +#define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */
251 #define LLC_SAP_SNA 0x04 /* SNA Path Control. */
252 -#define LLC_SAP_PNM 0x0E /* Proway Network Managment. */
253 +#define LLC_SAP_PNM 0x0E /* Proway Network Management. */
254 #define LLC_SAP_IP 0x06 /* TCP/IP. */
255 #define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
256 #define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
257 @@ -70,11 +70,4 @@ enum llc_sockopts {
258 #define LLC_SAP_RM 0xD4 /* Resource Management */
259 #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
260
261 -#ifdef __KERNEL__
262 -#define LLC_SAP_DYN_START 0xC0
263 -#define LLC_SAP_DYN_STOP 0xDE
264 -#define LLC_SAP_DYN_TRIES 4
265 -
266 -#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
267 -#endif /* __KERNEL__ */
268 #endif /* __LINUX_LLC_H */
269 diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
270 index 5e33a20..ba9e46c 100644
271 --- a/include/linux/rtnetlink.h
272 +++ b/include/linux/rtnetlink.h
273 @@ -1,7 +1,11 @@
274 #ifndef __LINUX_RTNETLINK_H
275 #define __LINUX_RTNETLINK_H
276
277 +#include <linux/types.h>
278 #include <linux/netlink.h>
279 +#include <linux/if_link.h>
280 +#include <linux/if_addr.h>
281 +#include <linux/neighbour.h>
282
283 /****
284 * Routing/neighbour discovery messages.
285 @@ -80,8 +84,6 @@ enum {
286
287 RTM_NEWPREFIX = 52,
288 #define RTM_NEWPREFIX RTM_NEWPREFIX
289 - RTM_GETPREFIX = 54,
290 -#define RTM_GETPREFIX RTM_GETPREFIX
291
292 RTM_GETMULTICAST = 58,
293 #define RTM_GETMULTICAST RTM_GETMULTICAST
294 @@ -96,6 +98,21 @@ enum {
295 RTM_SETNEIGHTBL,
296 #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
297
298 + RTM_NEWNDUSEROPT = 68,
299 +#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
300 +
301 + RTM_NEWADDRLABEL = 72,
302 +#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
303 + RTM_DELADDRLABEL,
304 +#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
305 + RTM_GETADDRLABEL,
306 +#define RTM_GETADDRLABEL RTM_GETADDRLABEL
307 +
308 + RTM_GETDCB = 78,
309 +#define RTM_GETDCB RTM_GETDCB
310 + RTM_SETDCB,
311 +#define RTM_SETDCB RTM_SETDCB
312 +
313 __RTM_MAX,
314 #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
315 };
316 @@ -235,13 +252,12 @@ enum rt_class_t
317 {
318 RT_TABLE_UNSPEC=0,
319 /* User defined values */
320 + RT_TABLE_COMPAT=252,
321 RT_TABLE_DEFAULT=253,
322 RT_TABLE_MAIN=254,
323 RT_TABLE_LOCAL=255,
324 - __RT_TABLE_MAX
325 + RT_TABLE_MAX=0xFFFFFFFF
326 };
327 -#define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
328 -
329
330
331 /* Routing message attributes */
332 @@ -258,11 +274,12 @@ enum rtattr_type_t
333 RTA_PREFSRC,
334 RTA_METRICS,
335 RTA_MULTIPATH,
336 - RTA_PROTOINFO,
337 + RTA_PROTOINFO, /* no longer used */
338 RTA_FLOW,
339 RTA_CACHEINFO,
340 - RTA_SESSION,
341 - RTA_MP_ALGO,
342 + RTA_SESSION, /* no longer used */
343 + RTA_MP_ALGO, /* no longer used */
344 + RTA_TABLE,
345 __RTA_MAX
346 };
347
348 @@ -351,6 +368,8 @@ enum
349 #define RTAX_INITCWND RTAX_INITCWND
350 RTAX_FEATURES,
351 #define RTAX_FEATURES RTAX_FEATURES
352 + RTAX_RTO_MIN,
353 +#define RTAX_RTO_MIN RTAX_RTO_MIN
354 __RTAX_MAX
355 };
356
357 @@ -383,226 +402,6 @@ struct rta_session
358 } u;
359 };
360
361 -
362 -/*********************************************************
363 - * Interface address.
364 - ****/
365 -
366 -struct ifaddrmsg
367 -{
368 - unsigned char ifa_family;
369 - unsigned char ifa_prefixlen; /* The prefix length */
370 - unsigned char ifa_flags; /* Flags */
371 - unsigned char ifa_scope; /* See above */
372 - int ifa_index; /* Link index */
373 -};
374 -
375 -enum
376 -{
377 - IFA_UNSPEC,
378 - IFA_ADDRESS,
379 - IFA_LOCAL,
380 - IFA_LABEL,
381 - IFA_BROADCAST,
382 - IFA_ANYCAST,
383 - IFA_CACHEINFO,
384 - IFA_MULTICAST,
385 - __IFA_MAX
386 -};
387 -
388 -#define IFA_MAX (__IFA_MAX - 1)
389 -
390 -/* ifa_flags */
391 -
392 -#define IFA_F_SECONDARY 0x01
393 -#define IFA_F_TEMPORARY IFA_F_SECONDARY
394 -
395 -#define IFA_F_DEPRECATED 0x20
396 -#define IFA_F_TENTATIVE 0x40
397 -#define IFA_F_PERMANENT 0x80
398 -
399 -struct ifa_cacheinfo
400 -{
401 - __u32 ifa_prefered;
402 - __u32 ifa_valid;
403 - __u32 cstamp; /* created timestamp, hundredths of seconds */
404 - __u32 tstamp; /* updated timestamp, hundredths of seconds */
405 -};
406 -
407 -
408 -#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
409 -#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
410 -
411 -/*
412 - Important comment:
413 - IFA_ADDRESS is prefix address, rather than local interface address.
414 - It makes no difference for normally configured broadcast interfaces,
415 - but for point-to-point IFA_ADDRESS is DESTINATION address,
416 - local address is supplied in IFA_LOCAL attribute.
417 - */
418 -
419 -/**************************************************************
420 - * Neighbour discovery.
421 - ****/
422 -
423 -struct ndmsg
424 -{
425 - unsigned char ndm_family;
426 - unsigned char ndm_pad1;
427 - unsigned short ndm_pad2;
428 - int ndm_ifindex; /* Link index */
429 - __u16 ndm_state;
430 - __u8 ndm_flags;
431 - __u8 ndm_type;
432 -};
433 -
434 -enum
435 -{
436 - NDA_UNSPEC,
437 - NDA_DST,
438 - NDA_LLADDR,
439 - NDA_CACHEINFO,
440 - NDA_PROBES,
441 - __NDA_MAX
442 -};
443 -
444 -#define NDA_MAX (__NDA_MAX - 1)
445 -
446 -#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
447 -#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
448 -
449 -/*
450 - * Neighbor Cache Entry Flags
451 - */
452 -
453 -#define NTF_PROXY 0x08 /* == ATF_PUBL */
454 -#define NTF_ROUTER 0x80
455 -
456 -/*
457 - * Neighbor Cache Entry States.
458 - */
459 -
460 -#define NUD_INCOMPLETE 0x01
461 -#define NUD_REACHABLE 0x02
462 -#define NUD_STALE 0x04
463 -#define NUD_DELAY 0x08
464 -#define NUD_PROBE 0x10
465 -#define NUD_FAILED 0x20
466 -
467 -/* Dummy states */
468 -#define NUD_NOARP 0x40
469 -#define NUD_PERMANENT 0x80
470 -#define NUD_NONE 0x00
471 -
472 -
473 -struct nda_cacheinfo
474 -{
475 - __u32 ndm_confirmed;
476 - __u32 ndm_used;
477 - __u32 ndm_updated;
478 - __u32 ndm_refcnt;
479 -};
480 -
481 -
482 -/*****************************************************************
483 - * Neighbour tables specific messages.
484 - *
485 - * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
486 - * NLM_F_DUMP flag set. Every neighbour table configuration is
487 - * spread over multiple messages to avoid running into message
488 - * size limits on systems with many interfaces. The first message
489 - * in the sequence transports all not device specific data such as
490 - * statistics, configuration, and the default parameter set.
491 - * This message is followed by 0..n messages carrying device
492 - * specific parameter sets.
493 - * Although the ordering should be sufficient, NDTA_NAME can be
494 - * used to identify sequences. The initial message can be identified
495 - * by checking for NDTA_CONFIG. The device specific messages do
496 - * not contain this TLV but have NDTPA_IFINDEX set to the
497 - * corresponding interface index.
498 - *
499 - * To change neighbour table attributes, send RTM_SETNEIGHTBL
500 - * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
501 - * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
502 - * otherwise. Device specific parameter sets can be changed by
503 - * setting NDTPA_IFINDEX to the interface index of the corresponding
504 - * device.
505 - ****/
506 -
507 -struct ndt_stats
508 -{
509 - __u64 ndts_allocs;
510 - __u64 ndts_destroys;
511 - __u64 ndts_hash_grows;
512 - __u64 ndts_res_failed;
513 - __u64 ndts_lookups;
514 - __u64 ndts_hits;
515 - __u64 ndts_rcv_probes_mcast;
516 - __u64 ndts_rcv_probes_ucast;
517 - __u64 ndts_periodic_gc_runs;
518 - __u64 ndts_forced_gc_runs;
519 -};
520 -
521 -enum {
522 - NDTPA_UNSPEC,
523 - NDTPA_IFINDEX, /* u32, unchangeable */
524 - NDTPA_REFCNT, /* u32, read-only */
525 - NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
526 - NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
527 - NDTPA_RETRANS_TIME, /* u64, msecs */
528 - NDTPA_GC_STALETIME, /* u64, msecs */
529 - NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
530 - NDTPA_QUEUE_LEN, /* u32 */
531 - NDTPA_APP_PROBES, /* u32 */
532 - NDTPA_UCAST_PROBES, /* u32 */
533 - NDTPA_MCAST_PROBES, /* u32 */
534 - NDTPA_ANYCAST_DELAY, /* u64, msecs */
535 - NDTPA_PROXY_DELAY, /* u64, msecs */
536 - NDTPA_PROXY_QLEN, /* u32 */
537 - NDTPA_LOCKTIME, /* u64, msecs */
538 - __NDTPA_MAX
539 -};
540 -#define NDTPA_MAX (__NDTPA_MAX - 1)
541 -
542 -struct ndtmsg
543 -{
544 - __u8 ndtm_family;
545 - __u8 ndtm_pad1;
546 - __u16 ndtm_pad2;
547 -};
548 -
549 -struct ndt_config
550 -{
551 - __u16 ndtc_key_len;
552 - __u16 ndtc_entry_size;
553 - __u32 ndtc_entries;
554 - __u32 ndtc_last_flush; /* delta to now in msecs */
555 - __u32 ndtc_last_rand; /* delta to now in msecs */
556 - __u32 ndtc_hash_rnd;
557 - __u32 ndtc_hash_mask;
558 - __u32 ndtc_hash_chain_gc;
559 - __u32 ndtc_proxy_qlen;
560 -};
561 -
562 -enum {
563 - NDTA_UNSPEC,
564 - NDTA_NAME, /* char *, unchangeable */
565 - NDTA_THRESH1, /* u32 */
566 - NDTA_THRESH2, /* u32 */
567 - NDTA_THRESH3, /* u32 */
568 - NDTA_CONFIG, /* struct ndt_config, read-only */
569 - NDTA_PARMS, /* nested TLV NDTPA_* */
570 - NDTA_STATS, /* struct ndt_stats, read-only */
571 - NDTA_GC_INTERVAL, /* u64, msecs */
572 - __NDTA_MAX
573 -};
574 -#define NDTA_MAX (__NDTA_MAX - 1)
575 -
576 -#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
577 - NLMSG_ALIGN(sizeof(struct ndtmsg))))
578 -#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
579 -
580 -
581 /****
582 * General form of address family dependent message.
583 ****/
584 @@ -663,138 +462,6 @@ struct prefix_cacheinfo
585 __u32 valid_time;
586 };
587
588 -/* The struct should be in sync with struct net_device_stats */
589 -struct rtnl_link_stats
590 -{
591 - __u32 rx_packets; /* total packets received */
592 - __u32 tx_packets; /* total packets transmitted */
593 - __u32 rx_bytes; /* total bytes received */
594 - __u32 tx_bytes; /* total bytes transmitted */
595 - __u32 rx_errors; /* bad packets received */
596 - __u32 tx_errors; /* packet transmit problems */
597 - __u32 rx_dropped; /* no space in linux buffers */
598 - __u32 tx_dropped; /* no space available in linux */
599 - __u32 multicast; /* multicast packets received */
600 - __u32 collisions;
601 -
602 - /* detailed rx_errors: */
603 - __u32 rx_length_errors;
604 - __u32 rx_over_errors; /* receiver ring buff overflow */
605 - __u32 rx_crc_errors; /* recved pkt with crc error */
606 - __u32 rx_frame_errors; /* recv'd frame alignment error */
607 - __u32 rx_fifo_errors; /* recv'r fifo overrun */
608 - __u32 rx_missed_errors; /* receiver missed packet */
609 -
610 - /* detailed tx_errors */
611 - __u32 tx_aborted_errors;
612 - __u32 tx_carrier_errors;
613 - __u32 tx_fifo_errors;
614 - __u32 tx_heartbeat_errors;
615 - __u32 tx_window_errors;
616 -
617 - /* for cslip etc */
618 - __u32 rx_compressed;
619 - __u32 tx_compressed;
620 -};
621 -
622 -/* The struct should be in sync with struct ifmap */
623 -struct rtnl_link_ifmap
624 -{
625 - __u64 mem_start;
626 - __u64 mem_end;
627 - __u64 base_addr;
628 - __u16 irq;
629 - __u8 dma;
630 - __u8 port;
631 -};
632 -
633 -enum
634 -{
635 - IFLA_UNSPEC,
636 - IFLA_ADDRESS,
637 - IFLA_BROADCAST,
638 - IFLA_IFNAME,
639 - IFLA_MTU,
640 - IFLA_LINK,
641 - IFLA_QDISC,
642 - IFLA_STATS,
643 - IFLA_COST,
644 -#define IFLA_COST IFLA_COST
645 - IFLA_PRIORITY,
646 -#define IFLA_PRIORITY IFLA_PRIORITY
647 - IFLA_MASTER,
648 -#define IFLA_MASTER IFLA_MASTER
649 - IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
650 -#define IFLA_WIRELESS IFLA_WIRELESS
651 - IFLA_PROTINFO, /* Protocol specific information for a link */
652 -#define IFLA_PROTINFO IFLA_PROTINFO
653 - IFLA_TXQLEN,
654 -#define IFLA_TXQLEN IFLA_TXQLEN
655 - IFLA_MAP,
656 -#define IFLA_MAP IFLA_MAP
657 - IFLA_WEIGHT,
658 -#define IFLA_WEIGHT IFLA_WEIGHT
659 - IFLA_OPERSTATE,
660 - IFLA_LINKMODE,
661 - __IFLA_MAX
662 -};
663 -
664 -
665 -#define IFLA_MAX (__IFLA_MAX - 1)
666 -
667 -#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
668 -#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
669 -
670 -/* ifi_flags.
671 -
672 - IFF_* flags.
673 -
674 - The only change is:
675 - IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
676 - more not changeable by user. They describe link media
677 - characteristics and set by device driver.
678 -
679 - Comments:
680 - - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
681 - - If neither of these three flags are set;
682 - the interface is NBMA.
683 -
684 - - IFF_MULTICAST does not mean anything special:
685 - multicasts can be used on all not-NBMA links.
686 - IFF_MULTICAST means that this media uses special encapsulation
687 - for multicast frames. Apparently, all IFF_POINTOPOINT and
688 - IFF_BROADCAST devices are able to use multicasts too.
689 - */
690 -
691 -/* IFLA_LINK.
692 - For usual devices it is equal ifi_index.
693 - If it is a "virtual interface" (f.e. tunnel), ifi_link
694 - can point to real physical interface (f.e. for bandwidth calculations),
695 - or maybe 0, what means, that real media is unknown (usual
696 - for IPIP tunnels, when route to endpoint is allowed to change)
697 - */
698 -
699 -/* Subtype attributes for IFLA_PROTINFO */
700 -enum
701 -{
702 - IFLA_INET6_UNSPEC,
703 - IFLA_INET6_FLAGS, /* link flags */
704 - IFLA_INET6_CONF, /* sysctl parameters */
705 - IFLA_INET6_STATS, /* statistics */
706 - IFLA_INET6_MCAST, /* MC things. What of them? */
707 - IFLA_INET6_CACHEINFO, /* time values and max reasm size */
708 - __IFLA_INET6_MAX
709 -};
710 -
711 -#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
712 -
713 -struct ifla_cacheinfo
714 -{
715 - __u32 max_reasm_len;
716 - __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
717 - __u32 reachable_time;
718 - __u32 retrans_time;
719 -};
720
721 /*****************************************************************
722 * Traffic control messages.
723 @@ -821,6 +488,7 @@ enum
724 TCA_RATE,
725 TCA_FCNT,
726 TCA_STATS2,
727 + TCA_STAB,
728 __TCA_MAX
729 };
730
731 @@ -829,6 +497,32 @@ enum
732 #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
733 #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
734
735 +/********************************************************************
736 + * Neighbor Discovery userland options
737 + ****/
738 +
739 +struct nduseroptmsg
740 +{
741 + unsigned char nduseropt_family;
742 + unsigned char nduseropt_pad1;
743 + unsigned short nduseropt_opts_len; /* Total length of options */
744 + int nduseropt_ifindex;
745 + __u8 nduseropt_icmp_type;
746 + __u8 nduseropt_icmp_code;
747 + unsigned short nduseropt_pad2;
748 + unsigned int nduseropt_pad3;
749 + /* Followed by one or more ND options */
750 +};
751 +
752 +enum
753 +{
754 + NDUSEROPT_UNSPEC,
755 + NDUSEROPT_SRCADDR,
756 + __NDUSEROPT_MAX
757 +};
758 +
759 +#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
760 +
761 /* RTnetlink multicast groups - backwards compatibility for userspace */
762 #define RTMGRP_LINK 1
763 #define RTMGRP_NOTIFY 2
764 @@ -883,10 +577,19 @@ enum rtnetlink_groups {
765 RTNLGRP_NOP2,
766 RTNLGRP_DECnet_ROUTE,
767 #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
768 - RTNLGRP_NOP3,
769 + RTNLGRP_DECnet_RULE,
770 +#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
771 RTNLGRP_NOP4,
772 RTNLGRP_IPV6_PREFIX,
773 #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
774 + RTNLGRP_IPV6_RULE,
775 +#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
776 + RTNLGRP_ND_USEROPT,
777 +#define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT
778 + RTNLGRP_PHONET_IFADDR,
779 +#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
780 + RTNLGRP_PHONET_ROUTE,
781 +#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
782 __RTNLGRP_MAX
783 };
784 #define RTNLGRP_MAX (__RTNLGRP_MAX - 1)