1 diff -durN -x '*~' iproute2.orig/Makefile iproute2/Makefile
2 --- iproute2.orig/Makefile 2004-12-20 16:30:45.000000000 +0100
3 +++ iproute2/Makefile 2004-12-20 17:51:46.337549648 +0100
7 CCOPTS = -D_GNU_SOURCE $(OPT) -Wstrict-prototypes -Wall -g
8 -CFLAGS = $(CCOPTS) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES)
9 +CFLAGS = $(CCOPTS) -include ../kernel-headers/kernel_headers_fix.h $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES)
11 LDLIBS += -L../lib -lnetlink -lutil
13 diff -durN -x '*~' iproute2.orig/include-glibc/glibc-bugs.h iproute2/include-glibc/glibc-bugs.h
14 --- iproute2.orig/include-glibc/glibc-bugs.h 2004-12-20 16:30:45.000000000 +0100
15 +++ iproute2/include-glibc/glibc-bugs.h 2004-12-20 17:51:01.345389496 +0100
17 #define __KERNEL_STRICT_NAMES 1
20 -#include <linux/types.h>
21 +/*#include <linux/types.h>*/
23 /* typedef __u16 in_port_t; */
24 /* typedef __u32 in_addr_t; */
25 diff -durN -x '*~' iproute2.orig/kernel-headers/kernel_headers_fix.h iproute2/kernel-headers/kernel_headers_fix.h
26 --- iproute2.orig/kernel-headers/kernel_headers_fix.h 1970-01-01 01:00:00.000000000 +0100
27 +++ iproute2/kernel-headers/kernel_headers_fix.h 2004-12-20 17:51:01.345389496 +0100
30 +#define __constant_htons htons
31 +#include <asm/types.h>
33 diff -durN -x '*~' iproute2.orig/kernel-headers/linux/autoconf.h iproute2/kernel-headers/linux/autoconf.h
34 --- iproute2.orig/kernel-headers/linux/autoconf.h 1970-01-01 01:00:00.000000000 +0100
35 +++ iproute2/kernel-headers/linux/autoconf.h 2004-12-20 17:51:01.346389344 +0100
38 + * Automatically generated C config: don't edit
40 +#define AUTOCONF_INCLUDED
41 +#define CONFIG_PROC_FS 1
42 +#define CONFIG_PACKET 1
43 +#define CONFIG_PACKET_MMAP 1
44 +#define CONFIG_NETLINK_DEV_MODULE 1
45 +#define CONFIG_UNIX 1
46 +#define CONFIG_NET_KEY_MODULE 1
47 +#define CONFIG_INET 1
48 +#define CONFIG_IP_MULTICAST 1
49 +#define CONFIG_IP_ADVANCED_ROUTER 1
50 +#define CONFIG_IP_MULTIPLE_TABLES 1
51 +#define CONFIG_IP_ROUTE_FWMARK 1
52 +#define CONFIG_IP_ROUTE_NAT 1
53 +#define CONFIG_IP_ROUTE_MULTIPATH 1
54 +#define CONFIG_IP_ROUTE_TOS 1
55 +#define CONFIG_IP_ROUTE_VERBOSE 1
56 +#define CONFIG_IP_PNP 1
57 +#define CONFIG_IP_PNP_DHCP 1
58 +#define CONFIG_IP_PNP_BOOTP 1
59 +#define CONFIG_IP_PNP_RARP 1
60 +#define CONFIG_NET_IPIP_MODULE 1
61 +#define CONFIG_NET_IPGRE_MODULE 1
62 +#define CONFIG_NET_IPGRE_BROADCAST 1
63 +#define CONFIG_IP_MROUTE 1
64 +#define CONFIG_IP_PIMSM_V1 1
65 +#define CONFIG_IP_PIMSM_V2 1
67 +#undef CONFIG_INET_ECN
68 +#define CONFIG_SYN_COOKIES 1
69 +#define CONFIG_INET_AH_MODULE 1
70 +#define CONFIG_INET_ESP_MODULE 1
71 +#define CONFIG_INET_IPCOMP_MODULE 1
72 +#define CONFIG_NET_SCHED 1
73 +#define CONFIG_NET_SCH_CBQ_MODULE 1
74 +#define CONFIG_NET_SCH_HTB_MODULE 1
75 +#define CONFIG_NET_SCH_CSZ_MODULE 1
76 +#define CONFIG_NET_SCH_ATM_MODULE 1
77 +#define CONFIG_NET_SCH_PRIO_MODULE 1
78 +#define CONFIG_NET_SCH_RED_MODULE 1
79 +#define CONFIG_NET_SCH_SFQ_MODULE 1
80 +#define CONFIG_NET_SCH_TEQL_MODULE 1
81 +#define CONFIG_NET_SCH_TBF_MODULE 1
82 +#define CONFIG_NET_SCH_GRED_MODULE 1
83 +#define CONFIG_NET_SCH_DSMARK_MODULE 1
84 +#define CONFIG_NET_SCH_INGRESS_MODULE 1
85 +#define CONFIG_NET_QOS 1
86 +#define CONFIG_NET_ESTIMATOR 1
87 +#define CONFIG_NET_CLS 1
88 +#define CONFIG_NET_CLS_TCINDEX_MODULE 1
89 +#define CONFIG_NET_CLS_ROUTE4_MODULE 1
90 +#define CONFIG_NET_CLS_ROUTE 1
91 +#define CONFIG_NET_CLS_FW_MODULE 1
92 +#define CONFIG_NET_CLS_U32_MODULE 1
93 +#define CONFIG_NET_CLS_RSVP_MODULE 1
94 +#define CONFIG_NET_CLS_RSVP6_MODULE 1
95 +#define CONFIG_NET_CLS_POLICE 1
96 +#define CONFIG_IPV6_MODULE 1
97 diff -durN -x '*~' iproute2.orig/kernel-headers/linux/config.h iproute2/kernel-headers/linux/config.h
98 --- iproute2.orig/kernel-headers/linux/config.h 1970-01-01 01:00:00.000000000 +0100
99 +++ iproute2/kernel-headers/linux/config.h 2004-12-20 17:51:01.346389344 +0100
101 +#ifndef _LINUX_CONFIG_H
102 +#define _LINUX_CONFIG_H
104 +#include <linux/autoconf.h>
107 diff -durN -x '*~' iproute2.orig/kernel-headers/linux/pkt_sched.h iproute2/kernel-headers/linux/pkt_sched.h
108 --- iproute2.orig/kernel-headers/linux/pkt_sched.h 1970-01-01 01:00:00.000000000 +0100
109 +++ iproute2/kernel-headers/linux/pkt_sched.h 2004-12-20 17:51:01.347389192 +0100
111 +#ifndef __LINUX_PKT_SCHED_H
112 +#define __LINUX_PKT_SCHED_H
114 +/* Logical priority bands not depending on specific packet scheduler.
115 + Every scheduler will map them to real traffic classes, if it has
116 + no more precise mechanism to classify packets.
118 + These numbers have no special meaning, though their coincidence
119 + with obsolete IPv6 values is not occasional :-). New IPv6 drafts
120 + preferred full anarchy inspired by diffserv group.
122 + Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
123 + class, actually, as rule it will be handled with more care than
124 + filler or even bulk.
127 +#define TC_PRIO_BESTEFFORT 0
128 +#define TC_PRIO_FILLER 1
129 +#define TC_PRIO_BULK 2
130 +#define TC_PRIO_INTERACTIVE_BULK 4
131 +#define TC_PRIO_INTERACTIVE 6
132 +#define TC_PRIO_CONTROL 7
134 +#define TC_PRIO_MAX 15
136 +/* Generic queue statistics, available for all the elements.
137 + Particular schedulers may have also their private records.
142 + __u64 bytes; /* NUmber of enqueues bytes */
143 + __u32 packets; /* Number of enqueued packets */
144 + __u32 drops; /* Packets dropped because of lack of resources */
145 + __u32 overlimits; /* Number of throttle events when this
146 + * flow goes out of allocated bandwidth */
147 + __u32 bps; /* Current flow byte rate */
148 + __u32 pps; /* Current flow packet rate */
159 + unsigned char ewma_log;
165 + All the traffic control objects have 32bit identifiers, or "handles".
167 + They can be considered as opaque numbers from user API viewpoint,
168 + but actually they always consist of two fields: major and
169 + minor numbers, which are interpreted by kernel specially,
170 + that may be used by applications, though not recommended.
172 + F.e. qdisc handles always have minor number equal to zero,
173 + classes (or flows) have major equal to parent qdisc major, and
174 + minor uniquely identifying class inside qdisc.
176 + Macros to manipulate handles:
179 +#define TC_H_MAJ_MASK (0xFFFF0000U)
180 +#define TC_H_MIN_MASK (0x0000FFFFU)
181 +#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
182 +#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
183 +#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
185 +#define TC_H_UNSPEC (0U)
186 +#define TC_H_ROOT (0xFFFFFFFFU)
187 +#define TC_H_INGRESS (0xFFFFFFF1U)
191 + unsigned char cell_log;
192 + unsigned char __reserved;
193 + unsigned short feature;
195 + unsigned short mpu;
203 + __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
208 +#define TCQ_PRIO_BANDS 16
212 + int bands; /* Number of bands */
213 + __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
220 + int flows; /* Maximal number of guaranteed flows */
221 + unsigned char R_log; /* Fixed point position for round number */
222 + unsigned char delta_log; /* Log of maximal managed time interval */
223 + __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> CSZ band */
228 + struct tc_ratespec slice;
229 + struct tc_ratespec rate;
230 + struct tc_ratespec peakrate;
248 + struct tc_ratespec rate;
249 + struct tc_ratespec peakrate;
266 +/* TEQL does not require any parameters */
272 + TCA_SFQ_HASH_CLASSIC,
279 + unsigned quantum; /* Bytes per round allocated to flow */
280 + int perturb_period; /* Period of hash perturbation */
281 + __u32 limit; /* Maximal packets in queue */
282 + unsigned divisor; /* Hash divisor */
283 + unsigned flows; /* Maximal number of flows */
284 + unsigned hash_kind; /* Hash function to use for flow identification */
288 + * NOTE: limit, divisor and flows are hardwired to code at the moment.
290 + * limit=flows=128, divisor=1024;
292 + * The only reason for this is efficiency, it is possible
293 + * to change these parameters in compile time.
295 + * If you need to play with this values use esfq.
309 + __u32 limit; /* HARD maximal queue length (bytes) */
310 + __u32 qth_min; /* Min average length threshold (bytes) */
311 + __u32 qth_max; /* Max average length threshold (bytes) */
312 + unsigned char Wlog; /* log(W) */
313 + unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
314 + unsigned char Scell_log; /* cell size for idle damping */
315 + unsigned char flags;
316 +#define TC_RED_ECN 1
319 +struct tc_red_xstats
321 + __u32 early; /* Early drops */
322 + __u32 pdrop; /* Drops due to queue limits */
323 + __u32 other; /* Drops due to drop() calls */
324 + __u32 marked; /* Marked packets */
339 +#define TCA_SET_OFF TCA_GRED_PARMS
342 + __u32 limit; /* HARD maximal queue length (bytes)
344 + __u32 qth_min; /* Min average length threshold (bytes)
346 + __u32 qth_max; /* Max average length threshold (bytes)
348 + __u32 DP; /* upto 2^32 DPs */
356 + unsigned char Wlog; /* log(W) */
357 + unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
358 + unsigned char Scell_log; /* cell size for idle damping */
359 + __u8 prio; /* prio of this VQ */
372 +#define TC_HTB_NUMPRIO 8
373 +#define TC_HTB_MAXDEPTH 8
374 +#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
378 + struct tc_ratespec rate;
379 + struct tc_ratespec ceil;
383 + __u32 level; /* out only */
388 + __u32 version; /* to match HTB/TC */
389 + __u32 rate2quantum; /* bps->quantum divisor */
390 + __u32 defcls; /* default class number */
391 + __u32 debug; /* debug flags */
394 + __u32 direct_pkts; /* count of non shapped packets */
404 +struct tc_htb_xstats
408 + __u32 giants; /* too big packets (rate will not be accurate) */
415 +#define TC_CBQ_MAXPRIO 8
416 +#define TC_CBQ_MAXLEVEL 8
417 +#define TC_CBQ_DEF_EWMA 5
419 +struct tc_cbq_lssopt
421 + unsigned char change;
422 + unsigned char flags;
423 +#define TCF_CBQ_LSS_BOUNDED 1
424 +#define TCF_CBQ_LSS_ISOLATED 2
425 + unsigned char ewma_log;
426 + unsigned char level;
427 +#define TCF_CBQ_LSS_FLAGS 1
428 +#define TCF_CBQ_LSS_EWMA 2
429 +#define TCF_CBQ_LSS_MAXIDLE 4
430 +#define TCF_CBQ_LSS_MINIDLE 8
431 +#define TCF_CBQ_LSS_OFFTIME 0x10
432 +#define TCF_CBQ_LSS_AVPKT 0x20
439 +struct tc_cbq_wrropt
441 + unsigned char flags;
442 + unsigned char priority;
443 + unsigned char cpriority;
444 + unsigned char __reserved;
451 + unsigned char strategy;
452 +#define TC_CBQ_OVL_CLASSIC 0
453 +#define TC_CBQ_OVL_DELAY 1
454 +#define TC_CBQ_OVL_LOWPRIO 2
455 +#define TC_CBQ_OVL_DROP 3
456 +#define TC_CBQ_OVL_RCLASSIC 4
457 + unsigned char priority2;
461 +struct tc_cbq_police
463 + unsigned char police;
464 + unsigned char __res1;
465 + unsigned short __res2;
475 +struct tc_cbq_xstats
489 + TCA_CBQ_OVL_STRATEGY,
495 +#define TCA_CBQ_MAX TCA_CBQ_POLICE
497 +/* dsmark section */
501 + TCA_DSMARK_INDICES,
502 + TCA_DSMARK_DEFAULT_INDEX,
503 + TCA_DSMARK_SET_TC_INDEX,
508 +#define TCA_DSMARK_MAX TCA_DSMARK_VALUE
514 + TCA_ATM_FD, /* file/socket descriptor */
515 + TCA_ATM_PTR, /* pointer to descriptor - later */
516 + TCA_ATM_HDR, /* LL header */
517 + TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
518 + TCA_ATM_ADDR, /* PVC address (for output only) */
519 + TCA_ATM_STATE /* VC state (ATM_VS_*; for output only) */
522 +#define TCA_ATM_MAX TCA_ATM_STATE
526 +/* Other includes */
527 +#include <linux/if_ether.h>
529 +// A sub weight and of a class
530 +// All numbers are represented as parts of (2^64-1).
531 +struct tc_wrr_class_weight {
532 + __u64 val; // Current value (0 is not valid)
533 + __u64 decr; // Value pr bytes (2^64-1 is not valid)
534 + __u64 incr; // Value pr seconds (2^64-1 is not valid)
535 + __u64 min; // Minimal value (0 is not valid)
536 + __u64 max; // Minimal value (0 is not valid)
538 + // The time where the above information was correct:
542 +// Pakcet send when modifying a class:
543 +struct tc_wrr_class_modf {
544 + // Not-valid values are ignored.
545 + struct tc_wrr_class_weight weight1;
546 + struct tc_wrr_class_weight weight2;
549 +// Packet returned when quering a class:
550 +struct tc_wrr_class_stats {
551 + char used; // If this is false the information below is invalid
553 + struct tc_wrr_class_modf class_modf;
555 + unsigned char addr[ETH_ALEN];
556 + char usemac; // True if addr is a MAC address, else it is an IP address
557 + // (this value is only for convience, it is always the same
558 + // value as in the qdisc)
559 + int heappos; // Current heap position or 0 if not in heap
560 + __u64 penal_ls; // Penalty value in heap (ls)
561 + __u64 penal_ms; // Penalty value in heap (ms)
564 +// Qdisc-wide penalty information (boolean values - 2 not valid)
565 +struct tc_wrr_qdisc_weight {
566 + char weight_mode; // 0=No automatic change to weight
567 + // 1=Decrease normally
568 + // 2=Also multiply with number of machines
569 + // 3=Instead multiply with priority divided
570 + // with priority of the other.
574 +// Packet send when modifing a qdisc:
575 +struct tc_wrr_qdisc_modf {
576 + // Not-valid values are ignored:
577 + struct tc_wrr_qdisc_weight weight1;
578 + struct tc_wrr_qdisc_weight weight2;
581 +// Packet send when creating a qdisc:
582 +struct tc_wrr_qdisc_crt {
583 + struct tc_wrr_qdisc_modf qdisc_modf;
585 + char srcaddr; // 1=lookup source, 0=lookup destination
586 + char usemac; // 1=Classify on MAC addresses, 0=classify on IP
587 + char usemasq; // 1=Classify based on masqgrading - only valid
588 + // if usemac is zero
589 + int bands_max; // Maximal number of bands (i.e.: classes)
590 + int proxy_maxconn; // If differnt from 0 then we support proxy remapping
591 + // of packets. And this is the number of maximal
592 + // concurrent proxy connections.
595 +// Packet returned when quering a qdisc:
596 +struct tc_wrr_qdisc_stats {
597 + struct tc_wrr_qdisc_crt qdisc_crt;
599 + int nodes_in_heap; // Current number of bands wanting to send something
600 + int bands_cur; // Current number of bands used (i.e.: MAC/IP addresses seen)
601 + int bands_reused; // Number of times this band has been reused.
602 + int packets_requed; // Number of times packets have been requeued.
603 + __u64 priosum; // Sum of priorities in heap where 1 is 2^32
606 +struct tc_wrr_qdisc_modf_std {
607 + // This indicates which of the tc_wrr_qdisc_modf structers this is:
608 + char proxy; // 0=This struct
610 + // Should we also change a class?
613 + // Only valid if change_class is false
614 + struct tc_wrr_qdisc_modf qdisc_modf;
616 + // Only valid if change_class is true:
617 + unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0)
618 + struct tc_wrr_class_modf class_modf; // The change
621 +// Used for proxyrempping:
622 +struct tc_wrr_qdisc_modf_proxy {
623 + // This indicates which of the tc_wrr_qdisc_modf structers this is:
624 + char proxy; // 1=This struct
626 + // This is 1 if the proxyremap information should be reset
629 + // changec is the number of elements in changes.
632 + // This is an array of type ProxyRemapBlock: