Changeset 10147


Ignore:
Timestamp:
2008-01-08T23:28:35+01:00 (10 years ago)
Author:
pavlov
Message:

updated iproute2 to 2.6.23 + latest debian patches + latest esfq. deleted patches have been merged upstream. note, this also brings in the necessary esfq changes in the kernel

Location:
trunk
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/iproute2/Makefile

    r8659 r10147  
    1010 
    1111PKG_NAME:=iproute2 
    12 PKG_VERSION:=2.6.20-070313 
     12PKG_VERSION:=2.6.23 
    1313PKG_RELEASE:=1 
    1414 
    15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
    1616PKG_SOURCE_URL:=http://developer.osdl.org/dev/iproute2/download/ 
    17 PKG_MD5SUM:=7bc5883aadf740761fa2dd70b661e8cc 
     17PKG_MD5SUM:= 
    1818 
    19 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute-$(PKG_VERSION) 
     19PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION) 
    2020 
    2121include $(INCLUDE_DIR)/package.mk 
  • trunk/package/iproute2/patches/000-debian_patches_3.patch

    r7540 r10147  
    1 Index: iproute-2.6.20-070313/doc/ip-cref.tex 
    2 =================================================================== 
    3 --- iproute-2.6.20-070313.orig/doc/ip-cref.tex  2007-06-09 13:53:56.000000000 +0100 
    4 +++ iproute-2.6.20-070313/doc/ip-cref.tex       2007-06-09 13:53:57.000000000 +0100 
     1--- iproute-20071016.orig/doc/ip-cref.tex 
     2+++ iproute-20071016/doc/ip-cref.tex 
    53@@ -1322,6 +1322,19 @@ 
    64     If it is not given, Linux uses the value selected with \verb|sysctl| 
     
    3331  
    3432  
    35 Index: iproute-2.6.20-070313/doc/Makefile 
    36 =================================================================== 
    37 --- iproute-2.6.20-070313.orig/doc/Makefile     2007-06-09 13:53:56.000000000 +0100 
    38 +++ iproute-2.6.20-070313/doc/Makefile  2007-06-09 13:53:57.000000000 +0100 
     33--- iproute-20071016.orig/doc/Makefile 
     34+++ iproute-20071016/doc/Makefile 
    3935@@ -14,6 +14,7 @@ 
    4036 PAGESPERPAGE=2 
     
    4541  
    4642  
    47 @@ -23,6 +24,8 @@ 
    48   
    49  html: $(HTMLFILES) 
     43@@ -25,6 +26,8 @@ 
     44  
     45 dvi: $(DVIFILES) 
    5046  
    5147+txt: $(TXTFILES) 
    5248+ 
    53  dvi: $(DVIFILES) 
    54   
    5549 print: $(PSFILES) 
    56 @@ -47,9 +50,12 @@ 
     50        $(LPR) $(PSFILES) 
     51  
     52@@ -47,9 +50,13 @@ 
    5753 %.html: %.sgml 
    5854        $(SGML2HTML) $< 
     
    6056+%.txt: %.html 
    6157+       lynx -nolist -dump $< > $@ 
     58+                
    6259+ 
    6360 install: 
     
    6865-       rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html 
    6966+       rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html $(TXTFILES) 
    70 Index: iproute-2.6.20-070313/include/linux/pkt_sched.h 
    71 =================================================================== 
    72 --- iproute-2.6.20-070313.orig/include/linux/pkt_sched.h        2007-06-09 13:53:56.000000000 +0100 
    73 +++ iproute-2.6.20-070313/include/linux/pkt_sched.h     2007-06-09 13:53:57.000000000 +0100 
    74 @@ -1,3 +1,409 @@ 
    75 +#if 0 
    76 +#ifndef __LINUX_PKT_SCHED_H 
    77 +#define __LINUX_PKT_SCHED_H 
    78 + 
    79 +/* Logical priority bands not depending on specific packet scheduler. 
    80 +   Every scheduler will map them to real traffic classes, if it has 
    81 +   no more precise mechanism to classify packets. 
    82 + 
    83 +   These numbers have no special meaning, though their coincidence 
    84 +   with obsolete IPv6 values is not occasional :-). New IPv6 drafts 
    85 +   preferred full anarchy inspired by diffserv group. 
    86 + 
    87 +   Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy 
    88 +   class, actually, as rule it will be handled with more care than 
    89 +   filler or even bulk. 
    90 + */ 
    91 + 
    92 +#define TC_PRIO_BESTEFFORT             0 
    93 +#define TC_PRIO_FILLER                 1 
    94 +#define TC_PRIO_BULK                   2 
    95 +#define TC_PRIO_INTERACTIVE_BULK       4 
    96 +#define TC_PRIO_INTERACTIVE            6 
    97 +#define TC_PRIO_CONTROL                        7 
    98 + 
    99 +#define TC_PRIO_MAX                    15 
    100 + 
    101 +/* Generic queue statistics, available for all the elements. 
    102 +   Particular schedulers may have also their private records. 
    103 + */ 
    104 + 
    105 +struct tc_stats 
     67--- iproute-20071016.orig/misc/Makefile 
     68+++ iproute-20071016/misc/Makefile 
     69@@ -1,7 +1,8 @@ 
     70 SSOBJ=ss.o ssfilter.o 
     71 LNSTATOBJ=lnstat.o lnstat_util.o 
     72  
     73-TARGETS=ss nstat ifstat rtacct arpd lnstat 
     74+#TARGETS=ss nstat ifstat rtacct arpd lnstat 
     75+TARGETS=ss nstat rtacct lnstat arpd 
     76  
     77 include ../Config 
     78  
     79--- iproute-20071016.orig/lib/utils.c 
     80+++ iproute-20071016/lib/utils.c 
     81@@ -47,6 +47,48 @@ 
     82        return 0; 
     83 } 
     84  
     85+/* a valid netmask must be 2^n - 1 */ 
     86+static int is_valid_netmask(const inet_prefix *addr) 
    10687+{ 
    107 +       __u64   bytes;                  /* NUmber of enqueues bytes */ 
    108 +       __u32   packets;                /* Number of enqueued packets   */ 
    109 +       __u32   drops;                  /* Packets dropped because of lack of resources */ 
    110 +       __u32   overlimits;             /* Number of throttle events when this 
    111 +                                        * flow goes out of allocated bandwidth */ 
    112 +       __u32   bps;                    /* Current flow byte rate */ 
    113 +       __u32   pps;                    /* Current flow packet rate */ 
    114 +       __u32   qlen; 
    115 +       __u32   backlog; 
    116 +#ifdef __KERNEL__ 
    117 +       spinlock_t *lock; 
    118 +#endif 
    119 +}; 
    120 + 
    121 +struct tc_estimator 
     88+        uint32_t host; 
     89+ 
     90+        if (addr->family != AF_INET) 
     91+                return 0; 
     92+ 
     93+        host = ~ntohl(addr->data[0]); 
     94+ 
     95+        return (host & (host + 1)) == 0; 
     96+} 
     97+ 
     98+static unsigned cidr(const inet_prefix *addr) 
    12299+{ 
    123 +       char            interval; 
    124 +       unsigned char   ewma_log; 
    125 +}; 
    126 + 
    127 +/* "Handles" 
    128 +   --------- 
    129 + 
    130 +    All the traffic control objects have 32bit identifiers, or "handles". 
    131 + 
    132 +    They can be considered as opaque numbers from user API viewpoint, 
    133 +    but actually they always consist of two fields: major and 
    134 +    minor numbers, which are interpreted by kernel specially, 
    135 +    that may be used by applications, though not recommended. 
    136 + 
    137 +    F.e. qdisc handles always have minor number equal to zero, 
    138 +    classes (or flows) have major equal to parent qdisc major, and 
    139 +    minor uniquely identifying class inside qdisc. 
    140 + 
    141 +    Macros to manipulate handles: 
    142 + */ 
    143 + 
    144 +#define TC_H_MAJ_MASK (0xFFFF0000U) 
    145 +#define TC_H_MIN_MASK (0x0000FFFFU) 
    146 +#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK) 
    147 +#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK) 
    148 +#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) 
    149 + 
    150 +#define TC_H_UNSPEC    (0U) 
    151 +#define TC_H_ROOT      (0xFFFFFFFFU) 
    152 +#define TC_H_INGRESS    (0xFFFFFFF1U) 
    153 + 
    154 +struct tc_ratespec 
     100+       unsigned bits = 0; 
     101+       u_int32_t mask; 
     102+ 
     103+       for (mask = ntohl(addr->data[0]); mask; mask <<= 1) 
     104+               ++bits; 
     105+ 
     106+       return bits; 
     107+} 
     108+ 
     109+static int get_netmask(unsigned *val, const char *arg, int base) 
    155110+{ 
    156 +       unsigned char   cell_log; 
    157 +       unsigned char   __reserved; 
    158 +       unsigned short  feature; 
    159 +       short           addend; 
    160 +       unsigned short  mpu; 
    161 +       __u32           rate; 
    162 +}; 
    163 + 
    164 +/* FIFO section */ 
    165 + 
    166 +struct tc_fifo_qopt 
    167 +{ 
    168 +       __u32   limit;  /* Queue length: bytes for bfifo, packets for pfifo */ 
    169 +}; 
    170 + 
    171 +/* PRIO section */ 
    172 + 
    173 +#define TCQ_PRIO_BANDS 16 
    174 + 
    175 +struct tc_prio_qopt 
    176 +{ 
    177 +       int     bands;                  /* Number of bands */ 
    178 +       __u8    priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 
    179 +}; 
    180 + 
    181 +/* CSZ section */ 
    182 + 
    183 +struct tc_csz_qopt 
    184 +{ 
    185 +       int             flows;          /* Maximal number of guaranteed flows */ 
    186 +       unsigned char   R_log;          /* Fixed point position for round number */ 
    187 +       unsigned char   delta_log;      /* Log of maximal managed time interval */ 
    188 +       __u8            priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> CSZ band */ 
    189 +}; 
    190 + 
    191 +struct tc_csz_copt 
    192 +{ 
    193 +       struct tc_ratespec slice; 
    194 +       struct tc_ratespec rate; 
    195 +       struct tc_ratespec peakrate; 
    196 +       __u32           limit; 
    197 +       __u32           buffer; 
    198 +       __u32           mtu; 
    199 +}; 
    200 + 
    201 +enum 
    202 +{ 
    203 +       TCA_CSZ_UNSPEC, 
    204 +       TCA_CSZ_PARMS, 
    205 +       TCA_CSZ_RTAB, 
    206 +       TCA_CSZ_PTAB, 
    207 +}; 
    208 + 
    209 +/* TBF section */ 
    210 + 
    211 +struct tc_tbf_qopt 
    212 +{ 
    213 +       struct tc_ratespec rate; 
    214 +       struct tc_ratespec peakrate; 
    215 +       __u32           limit; 
    216 +       __u32           buffer; 
    217 +       __u32           mtu; 
    218 +}; 
    219 + 
    220 +enum 
    221 +{ 
    222 +       TCA_TBF_UNSPEC, 
    223 +       TCA_TBF_PARMS, 
    224 +       TCA_TBF_RTAB, 
    225 +       TCA_TBF_PTAB, 
    226 +}; 
    227 + 
    228 + 
    229 +/* TEQL section */ 
    230 + 
    231 +/* TEQL does not require any parameters */ 
    232 + 
    233 +/* SFQ section */ 
    234 + 
    235 +struct tc_sfq_qopt 
    236 +{ 
    237 +       unsigned        quantum;        /* Bytes per round allocated to flow */ 
    238 +       int             perturb_period; /* Period of hash perturbation */ 
    239 +       __u32           limit;          /* Maximal packets in queue */ 
    240 +       unsigned        divisor;        /* Hash divisor  */ 
    241 +       unsigned        flows;          /* Maximal number of flows  */ 
    242 +}; 
    243 + 
    244 +/* 
    245 + *  NOTE: limit, divisor and flows are hardwired to code at the moment. 
    246 + * 
    247 + *     limit=flows=128, divisor=1024; 
    248 + * 
    249 + *     The only reason for this is efficiency, it is possible 
    250 + *     to change these parameters in compile time. 
    251 + */ 
    252 + 
    253 +/* RED section */ 
    254 + 
    255 +enum 
    256 +{ 
    257 +       TCA_RED_UNSPEC, 
    258 +       TCA_RED_PARMS, 
    259 +       TCA_RED_STAB, 
    260 +}; 
    261 + 
    262 +struct tc_red_qopt 
    263 +{ 
    264 +       __u32           limit;          /* HARD maximal queue length (bytes)    */ 
    265 +       __u32           qth_min;        /* Min average length threshold (bytes) */ 
    266 +       __u32           qth_max;        /* Max average length threshold (bytes) */ 
    267 +       unsigned char   Wlog;           /* log(W)               */ 
    268 +       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */ 
    269 +       unsigned char   Scell_log;      /* cell size for idle damping */ 
    270 +       unsigned char   flags; 
    271 +#define TC_RED_ECN     1 
    272 +}; 
    273 + 
    274 +struct tc_red_xstats 
    275 +{ 
    276 +       __u32           early;          /* Early drops */ 
    277 +       __u32           pdrop;          /* Drops due to queue limits */ 
    278 +       __u32           other;          /* Drops due to drop() calls */ 
    279 +       __u32           marked;         /* Marked packets */ 
    280 +}; 
    281 + 
    282 +/* GRED section */ 
    283 + 
    284 +#define MAX_DPs 16 
    285 + 
    286 +enum 
    287 +{ 
    288 +       TCA_GRED_UNSPEC, 
    289 +       TCA_GRED_PARMS, 
    290 +       TCA_GRED_STAB, 
    291 +       TCA_GRED_DPS, 
    292 +}; 
    293 + 
    294 +#define TCA_SET_OFF TCA_GRED_PARMS 
    295 +struct tc_gred_qopt 
    296 +{ 
    297 +       __u32           limit;          /* HARD maximal queue length (bytes)     
    298 +*/ 
    299 +       __u32           qth_min;        /* Min average length threshold (bytes)  
    300 +*/ 
    301 +       __u32           qth_max;        /* Max average length threshold (bytes)  
    302 +*/ 
    303 +       __u32           DP;             /* upto 2^32 DPs */ 
    304 +       __u32           backlog;         
    305 +       __u32           qave;    
    306 +       __u32           forced;  
    307 +       __u32           early;   
    308 +       __u32           other;   
    309 +       __u32           pdrop;   
    310 + 
    311 +       unsigned char   Wlog;           /* log(W)               */ 
    312 +       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */ 
    313 +       unsigned char   Scell_log;      /* cell size for idle damping */ 
    314 +       __u8            prio;           /* prio of this VQ */ 
    315 +       __u32   packets; 
    316 +       __u32   bytesin; 
    317 +}; 
    318 +/* gred setup */ 
    319 +struct tc_gred_sopt 
    320 +{ 
    321 +       __u32           DPs; 
    322 +       __u32           def_DP; 
    323 +       __u8            grio; 
    324 +}; 
    325 + 
    326 +/* HTB section */ 
    327 +#define TC_HTB_NUMPRIO         8 
    328 +#define TC_HTB_MAXDEPTH                8 
    329 +#define TC_HTB_PROTOVER                3 /* the same as HTB and TC's major */ 
    330 + 
    331 +struct tc_htb_opt 
    332 +{ 
    333 +       struct tc_ratespec      rate; 
    334 +       struct tc_ratespec      ceil; 
    335 +       __u32   buffer; 
    336 +       __u32   cbuffer; 
    337 +       __u32   quantum; 
    338 +       __u32   level;          /* out only */ 
    339 +       __u32   prio; 
    340 +}; 
    341 +struct tc_htb_glob 
    342 +{ 
    343 +       __u32 version;          /* to match HTB/TC */ 
    344 +       __u32 rate2quantum;     /* bps->quantum divisor */ 
    345 +       __u32 defcls;           /* default class number */ 
    346 +       __u32 debug;            /* debug flags */ 
    347 + 
    348 +       /* stats */ 
    349 +       __u32 direct_pkts; /* count of non shapped packets */ 
    350 +}; 
    351 +enum 
    352 +{ 
    353 +       TCA_HTB_UNSPEC, 
    354 +       TCA_HTB_PARMS, 
    355 +       TCA_HTB_INIT, 
    356 +       TCA_HTB_CTAB, 
    357 +       TCA_HTB_RTAB, 
    358 +}; 
    359 +struct tc_htb_xstats 
    360 +{ 
    361 +       __u32 lends; 
    362 +       __u32 borrows; 
    363 +       __u32 giants;   /* too big packets (rate will not be accurate) */ 
    364 +       __u32 tokens; 
    365 +       __u32 ctokens; 
    366 +}; 
    367 + 
    368 +/* CBQ section */ 
    369 + 
    370 +#define TC_CBQ_MAXPRIO         8 
    371 +#define TC_CBQ_MAXLEVEL                8 
    372 +#define TC_CBQ_DEF_EWMA                5 
    373 + 
    374 +struct tc_cbq_lssopt 
    375 +{ 
    376 +       unsigned char   change; 
    377 +       unsigned char   flags; 
    378 +#define TCF_CBQ_LSS_BOUNDED    1 
    379 +#define TCF_CBQ_LSS_ISOLATED   2 
    380 +       unsigned char   ewma_log; 
    381 +       unsigned char   level; 
    382 +#define TCF_CBQ_LSS_FLAGS      1 
    383 +#define TCF_CBQ_LSS_EWMA       2 
    384 +#define TCF_CBQ_LSS_MAXIDLE    4 
    385 +#define TCF_CBQ_LSS_MINIDLE    8 
    386 +#define TCF_CBQ_LSS_OFFTIME    0x10 
    387 +#define TCF_CBQ_LSS_AVPKT      0x20 
    388 +       __u32           maxidle; 
    389 +       __u32           minidle; 
    390 +       __u32           offtime; 
    391 +       __u32           avpkt; 
    392 +}; 
    393 + 
    394 +struct tc_cbq_wrropt 
    395 +{ 
    396 +       unsigned char   flags; 
    397 +       unsigned char   priority; 
    398 +       unsigned char   cpriority; 
    399 +       unsigned char   __reserved; 
    400 +       __u32           allot; 
    401 +       __u32           weight; 
    402 +}; 
    403 + 
    404 +struct tc_cbq_ovl 
    405 +{ 
    406 +       unsigned char   strategy; 
    407 +#define        TC_CBQ_OVL_CLASSIC      0 
    408 +#define        TC_CBQ_OVL_DELAY        1 
    409 +#define        TC_CBQ_OVL_LOWPRIO      2 
    410 +#define        TC_CBQ_OVL_DROP         3 
    411 +#define        TC_CBQ_OVL_RCLASSIC     4 
    412 +       unsigned char   priority2; 
    413 +       __u32           penalty; 
    414 +}; 
    415 + 
    416 +struct tc_cbq_police 
    417 +{ 
    418 +       unsigned char   police; 
    419 +       unsigned char   __res1; 
    420 +       unsigned short  __res2; 
    421 +}; 
    422 + 
    423 +struct tc_cbq_fopt 
    424 +{ 
    425 +       __u32           split; 
    426 +       __u32           defmap; 
    427 +       __u32           defchange; 
    428 +}; 
    429 + 
    430 +struct tc_cbq_xstats 
    431 +{ 
    432 +       __u32           borrows; 
    433 +       __u32           overactions; 
    434 +       __s32           avgidle; 
    435 +       __s32           undertime; 
    436 +}; 
    437 + 
    438 +enum 
    439 +{ 
    440 +       TCA_CBQ_UNSPEC, 
    441 +       TCA_CBQ_LSSOPT, 
    442 +       TCA_CBQ_WRROPT, 
    443 +       TCA_CBQ_FOPT, 
    444 +       TCA_CBQ_OVL_STRATEGY, 
    445 +       TCA_CBQ_RATE, 
    446 +       TCA_CBQ_RTAB, 
    447 +       TCA_CBQ_POLICE, 
    448 +}; 
    449 + 
    450 +#define TCA_CBQ_MAX    TCA_CBQ_POLICE 
    451 + 
    452 +/* dsmark section */ 
    453 + 
    454 +enum { 
    455 +       TCA_DSMARK_UNSPEC, 
    456 +       TCA_DSMARK_INDICES, 
    457 +       TCA_DSMARK_DEFAULT_INDEX, 
    458 +       TCA_DSMARK_SET_TC_INDEX, 
    459 +       TCA_DSMARK_MASK, 
    460 +       TCA_DSMARK_VALUE 
    461 +}; 
    462 + 
    463 +#define TCA_DSMARK_MAX TCA_DSMARK_VALUE 
    464 + 
    465 +/* ATM  section */ 
    466 + 
    467 +enum { 
    468 +       TCA_ATM_UNSPEC, 
    469 +       TCA_ATM_FD,             /* file/socket descriptor */ 
    470 +       TCA_ATM_PTR,            /* pointer to descriptor - later */ 
    471 +       TCA_ATM_HDR,            /* LL header */ 
    472 +       TCA_ATM_EXCESS,         /* excess traffic class (0 for CLP)  */ 
    473 +       TCA_ATM_ADDR,           /* PVC address (for output only) */ 
    474 +       TCA_ATM_STATE           /* VC state (ATM_VS_*; for output only) */ 
    475 +}; 
    476 + 
    477 +#define TCA_ATM_MAX    TCA_ATM_STATE 
    478 + 
    479 +#endif 
    480 +#endif 
    481  #ifndef __LINUX_PKT_SCHED_H 
    482  #define __LINUX_PKT_SCHED_H 
    483   
    484 @@ -466,4 +872,116 @@ 
    485   
    486  #define NETEM_DIST_SCALE       8192 
    487   
    488 +/* WRR section */ 
    489 + 
    490 +/* Other includes */ 
    491 +#include <linux/if_ether.h> 
    492 + 
    493 +// A sub weight and of a class 
    494 +// All numbers are represented as parts of (2^64-1). 
    495 +struct tc_wrr_class_weight { 
    496 +       __u64 val;      // Current value                        (0 is not valid) 
    497 +       __u64 decr;     // Value pr bytes                       (2^64-1 is not valid) 
    498 +       __u64 incr;     // Value pr seconds                     (2^64-1 is not valid) 
    499 +       __u64 min;      // Minimal value                        (0 is not valid) 
    500 +       __u64 max;      // Minimal value                        (0 is not valid) 
    501 + 
    502 +// The time where the above information was correct: 
    503 +       time_t tim; 
    504 +}; 
    505 + 
    506 +// Packet send when modifying a class: 
    507 +struct tc_wrr_class_modf { 
    508 +       // Not-valid values are ignored. 
    509 +       struct tc_wrr_class_weight weight1; 
    510 +       struct tc_wrr_class_weight weight2; 
    511 +}; 
    512 + 
    513 +// Packet returned when quering a class: 
    514 +struct tc_wrr_class_stats { 
    515 +       char used;      // If this is false the information below is invalid 
    516 + 
    517 +       struct tc_wrr_class_modf class_modf; 
    518 + 
    519 +       unsigned char addr[ETH_ALEN]; 
    520 +       char usemac;    // True if addr is a MAC address, else it is an IP address 
    521 +                       // (this value is only for convience, it is always the same 
    522 +                       //  value as in the qdisc) 
    523 +       int heappos;    // Current heap position or 0 if not in heap 
    524 +       __u64 penal_ls; // Penalty value in heap (ls) 
    525 +       __u64 penal_ms; // Penalty value in heap (ms) 
    526 +}; 
    527 + 
    528 +// Qdisc-wide penalty information (boolean values - 2 not valid) 
    529 +struct tc_wrr_qdisc_weight { 
    530 +       char weight_mode;       // 0=No automatic change to weight 
    531 +                               // 1=Decrease normally 
    532 +                               // 2=Also multiply with number of machines 
    533 +                               // 3=Instead multiply with priority divided 
    534 +                               //   with priority of the other. 
    535 +                               // -1=no change 
    536 +}; 
    537 + 
    538 +// Packet send when modifing a qdisc: 
    539 +struct tc_wrr_qdisc_modf { 
    540 +       // Not-valid values are ignored: 
    541 +       struct tc_wrr_qdisc_weight weight1; 
    542 +       struct tc_wrr_qdisc_weight weight2; 
    543 +}; 
    544 + 
    545 +// Packet send when creating a qdisc: 
    546 +struct tc_wrr_qdisc_crt { 
    547 +       struct tc_wrr_qdisc_modf qdisc_modf; 
    548 + 
    549 +       char srcaddr;   // 1=lookup source, 0=lookup destination 
    550 +       char usemac;    // 1=Classify on MAC addresses, 0=classify on IP 
    551 +       char usemasq;   // 1=Classify based on masqgrading - only valid 
    552 +                       //   if usemac is zero 
    553 +       int bands_max;  // Maximal number of bands (i.e.: classes) 
    554 +       int proxy_maxconn;// If differnt from 0 then we support proxy remapping 
    555 +                       // of packets. And this is the number of maximal 
    556 +                       // concurrent proxy connections. 
    557 +}; 
    558 + 
    559 +// Packet returned when quering a qdisc: 
    560 +struct tc_wrr_qdisc_stats { 
    561 +       struct tc_wrr_qdisc_crt qdisc_crt; 
    562 +       int proxy_curconn; 
    563 +       int nodes_in_heap;      // Current number of bands wanting to send something 
    564 +       int bands_cur;          // Current number of bands used (i.e.: MAC/IP addresses seen) 
    565 +       int bands_reused;       // Number of times this band has been reused. 
    566 +       int packets_requed;     // Number of times packets have been requeued. 
    567 +       __u64 priosum;          // Sum of priorities in heap where 1 is 2^32 
    568 +}; 
    569 + 
    570 +struct tc_wrr_qdisc_modf_std { 
    571 +       // This indicates which of the tc_wrr_qdisc_modf structers this is: 
    572 +       char proxy; // 0=This struct 
    573 + 
    574 +       // Should we also change a class? 
    575 +       char change_class; 
    576 + 
    577 +       // Only valid if change_class is false 
    578 +       struct tc_wrr_qdisc_modf qdisc_modf; 
    579 + 
    580 +       // Only valid if change_class is true: 
    581 +       unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0) 
    582 +       struct tc_wrr_class_modf class_modf; // The change 
    583 +}; 
    584 + 
    585 +// Used for proxyrempping: 
    586 +struct tc_wrr_qdisc_modf_proxy { 
    587 +       // This indicates which of the tc_wrr_qdisc_modf structers this is: 
    588 +       char proxy;     // 1=This struct 
    589 + 
    590 +       // This is 1 if the proxyremap information should be reset 
    591 +       char reset; 
    592 + 
    593 +       // changec is the number of elements in changes. 
    594 +       int changec; 
    595 + 
    596 +       // This is an array of type ProxyRemapBlock: 
    597 +       long changes[0]; 
    598 +}; 
    599 + 
    600  #endif 
    601 Index: iproute-2.6.20-070313/ip/iproute.c 
    602 =================================================================== 
    603 --- iproute-2.6.20-070313.orig/ip/iproute.c     2007-06-09 13:53:56.000000000 +0100 
    604 +++ iproute-2.6.20-070313/ip/iproute.c  2007-06-09 13:53:57.000000000 +0100 
    605 @@ -73,7 +73,7 @@ 
    606         fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n"); 
    607         fprintf(stderr, "           [ rtt NUMBER ] [ rttvar NUMBER ]\n"); 
    608         fprintf(stderr, "           [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); 
    609 -       fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ]\n"); 
    610 +       fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ] [ hoplimit NUMBER ]\n"); 
    611         fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); 
    612         fprintf(stderr, "          unreachable | prohibit | blackhole | nat ]\n"); 
    613         fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); 
    614 @@ -789,6 +789,30 @@ 
     111+       inet_prefix addr; 
     112+ 
     113+       if (!get_unsigned(val, arg, base)) 
     114+               return 0; 
     115+ 
     116+       /* try coverting dotted quad to CIDR */ 
     117+       if (!get_addr_1(&addr, arg, AF_INET)) { 
     118+               if (is_valid_netmask(&addr)) 
     119+                       return 0; 
     120+ 
     121+               *val = cidr(&addr); 
     122+       } 
     123+ 
     124+       return -1; 
     125+} 
     126+ 
     127 int get_unsigned(unsigned *val, const char *arg, int base) 
     128 { 
     129        unsigned long res; 
     130@@ -304,7 +346,8 @@ 
     131                                dst->bitlen = 32; 
     132                } 
     133                if (slash) { 
     134-                       if (get_unsigned(&plen, slash+1, 0) || plen > dst->bitlen) { 
     135+                       if (get_netmask(&plen, slash+1, 0) 
     136+                                       || plen > dst->bitlen) { 
     137                                err = -1; 
     138                                goto done; 
     139                        } 
     140@@ -642,9 +685,9 @@ 
     141 int cmdlineno; 
     142  
     143 /* Like glibc getline but handle continuation lines and comments */ 
     144-size_t getcmdline(char **linep, size_t *lenp, FILE *in) 
     145+ssize_t getcmdline(char **linep, size_t *lenp, FILE *in) 
     146 { 
     147-       size_t cc; 
     148+       ssize_t cc; 
     149        char *cp; 
     150  
     151        if ((cc = getline(linep, lenp, in)) < 0) 
     152@@ -672,9 +715,11 @@ 
     153                if (cp) 
     154                        *cp = '\0'; 
     155  
     156-               *linep = realloc(*linep, strlen(*linep) + strlen(line1) + 1); 
     157+               *lenp = strlen(*linep) + strlen(line1) + 1; 
     158+               *linep = realloc(*linep, *lenp); 
     159                if (!*linep) { 
     160                        fprintf(stderr, "Out of memory\n"); 
     161+                       *lenp = 0; 
     162                        return -1; 
     163                } 
     164                cc += cc1 - 2; 
     165--- iproute-20071016.orig/include/utils.h 
     166+++ iproute-20071016/include/utils.h 
     167@@ -144,7 +144,7 @@ 
     168 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 
     169  
     170 extern int cmdlineno; 
     171-extern size_t getcmdline(char **line, size_t *len, FILE *in); 
     172+extern ssize_t getcmdline(char **line, size_t *len, FILE *in); 
     173 extern int makeargs(char *line, char *argv[], int maxargs); 
     174  
     175 #endif /* __UTILS_H__ */ 
     176--- iproute-20071016.orig/tc/m_police.c 
     177+++ iproute-20071016/tc/m_police.c 
     178@@ -37,7 +37,7 @@ 
     179        fprintf(stderr, "Usage: ... police rate BPS burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ]\n"); 
     180        fprintf(stderr, "                [ peakrate BPS ] [ avrate BPS ]\n"); 
     181        fprintf(stderr, "                [ ACTIONTERM ]\n"); 
     182-       fprintf(stderr, "Old Syntax ACTIONTERM := <EXCEEDACT>[/NOTEXCEEDACT] \n"); 
     183+       fprintf(stderr, "Old Syntax ACTIONTERM := action <EXCEEDACT>[/NOTEXCEEDACT] \n"); 
     184        fprintf(stderr, "New Syntax ACTIONTERM := conform-exceed <EXCEEDACT>[/NOTEXCEEDACT] \n"); 
     185        fprintf(stderr, "Where: *EXCEEDACT := pipe | ok | reclassify | drop | continue \n"); 
     186        fprintf(stderr, "Where:  pipe is only valid for new syntax \n"); 
     187@@ -237,8 +237,7 @@ 
     188                } else if (strcmp(*argv, "help") == 0) { 
     189                        usage(); 
     190                } else { 
     191-                       fprintf(stderr, "What is \"%s\"?\n", *argv); 
     192-                       return -1; 
     193+                       break; 
     194                } 
     195                ok++; 
     196                argc--; argv++; 
     197--- iproute-20071016.orig/debian/doc/htb/htbfaq.htm 
     198+++ iproute-20071016/debian/doc/htb/htbfaq.htm 
     199@@ -0,0 +1,141 @@ 
     200+<html><head><title>HTB FAQ</title></head> 
     201+<body> 
     202+<h1><center>HTB FAQ</center></h1> 
     203+<center><address> 
     204+Martin Devera aka devik (devik@cdi.cz)<br> 
     205+Last updated: 7.7.2003 
     206+</address></center> 
     207+<br> 
     208+<b>How to set single HTB up for more interfaces or for incoming packets</b> 
     209+<p> 
     210+You need IMQ for this because all qdisc can handle only outgoing 
     211+traffic on single interface. See  
     212+<a href="http://www.linuximq.net/">http://www.linuximq.net/</a>. 
     213+<p> 
     214+<b>When HTB is used on machine with Apache (FTP, Samba, ...) server running 
     215+   then downloading from it can't be limited precisely</b> 
     216+<p> 
     217+Try to add PFIFO with limit 10 under HTB classes. When you use default 
     218+(much larger PFIFO) or SFQ then TCP stack will back off itself as it 
     219+see too large memory used for outgoing packets. You can also play 
     220+with /proc/sys/net/ipv4/tcp_wmem. 
     221+<p> 
     222+<b>"HTB: mindelay=500, report it please !" messages in syslog</b> 
     223+<p> 
     224+This means that all indicated that some class should be ready 
     225+soon but when we looked for it we haven't found one which will 
     226+be ready in 5 seconds. 
     227+<br> 
     228+After this message you can see lines like 
     229+<pre> 
     230+kernel: htb*g j=154480191 
     231+kernel: htb*r7 m=0 
     232+kernel: htb*r6 m=0 
     233+kernel: htb*r5 m=0 
     234+kernel: htb*r4 m=0 
     235+kernel: htb*r3 m=0 
     236+kernel: htb*r2 m=0 
     237+kernel: htb*r1 m=0 
     238+kernel: htb*r0 m=0 
     239+kernel: htb*c20110 m=2 t=636487 c=17888 pq=0 df=483328 ql=0 pa=0 f: 
     240+kernel: htb*c20220 m=1 t=-59999999 c=42404 pq=154487461 df=450560 ql=14 pa=40 f: 
     241+kernel: htb*c20001 m=2 t=5131 c=6439 pq=0 df=8192 ql=0 pa=0 f: 
     242+</pre> 
     243+If you decide to treat is as real bug then I'll need all of these. They 
     244+are logged under kernel.debug facility so often you need to add it so 
     245+your syslog.conf. These "htb*" are dump of internal state of all classes. 
     246+c20110 means class 2:110. *r lines are states of row activity bitsmasks. 
     247+*c indicates stet of all classes. You are interested in classes 
     248+with m=1 resp. m=0. These will become ready after time -c resp. -t whatever 
     249+is negative and smaller. 
     250+It is 59999999 us for class 2:110 above which is 59sec. It is way too much 
     251+and HTB will spill that error because it is &gt; 5 sec. 
     252+<p> 
     253+<i>So what is the problem ?</i> Probably you have too small rate or ceil 
     254+for such class - you should use at least 4kbit for realiable operation 
     255+of HTB - it leads to max 3sec of delay for 1500 byte packets which seems 
     256+as reasonable value. 
     257+<br> 
     258+Also try <a href=v3/htb_3.7_delay_bug.patch>this</a> patch against 2.4.20. 
     259+(works against older too with one reject). It increases timeout to 
     260+10secs and makes errors more readable.  
     261+<i>I'm interested in your experiences (good or bad) with the patch !</i> 
     262+<br> 
     263+If you think it is not the case and you still get weird errors, contact 
     264+me with syslog data above and output of commands 
     265+<pre> 
     266+tc -s -d qdisc 
     267+tc -s -d class show dev your_htb_device1_here 
     268+tc -s -d class show dev your_htb_device2_here 
     269+... 
     270+</pre> 
     271+ 
     272+<p> 
     273+<b>Why HTB sharing setup works with eth0 but on lo (loopback)  
     274+       it exhibits weird rates ? 
     275+</b> 
     276+<p>Try to execute  
     277+<pre> 
     278+ifconfig lo mtu 1500 
     279+</pre> 
     280+or use parameter mtu 16400 on "tc qdisc add" line. It is because 
     281+HTB reserves rate table for 1500 bytes long packets and loopback 
     282+uses 16384 as default. 
     283+<p> 
     284+<b>What's difference between kbps and kbit ? 
     285+</b> 
     286+<p> 
     287+1kbps=8kbit. Don't forget it ! 
     288+<p> 
     289+<b>What if sum of child rates is smaller than parent rate ? 
     290+</b> 
     291+<p> 
     292+It is like if you create unused child with remaining rate - the 
     293+rate difference is divided between other children. 
     294+<p> 
     295+<b>What if sum of child rates is greater than parent rate ? 
     296+</b> 
     297+<p> 
     298+Then interesting things can happen. Total rate delivered 
     299+by children can be higher that parent's rate (thus its rate 
     300+is not respected). However when sum of actual child rates are 
     301+under parent's rate then borrowing will occur like in regular case. 
     302+<p> 
     303+I use setup with 4 classes, parent has rate=ceil=6kbps, child 
     304+"mail" has rate=1kbps ceil=4kbps, "web" has rate=ceil=15kbps 
     305+and "other" has rate=2kbps ceil=4kbps. 
     306+HTB is attached to an PPP interface with compressed multilink pair 
     307+of modems which can go from 6kbps to cca 16kbps (depends on compresability 
     308+of data). When "web" traffic is present it can go as high as compression 
     309+allows while still allowing mail 1kbps and other 2kbps. 
     310+<br> 
     311+When "web" traffic is smaller than 6kbps then "mail" and "other"  
     312+can borrow more bw up to 4k each. 
     313+Parent's class it not set to 18k because then "mail" and "other" 
     314+could get as much as 8k which is more that link's minimum and 
     315+would saturate the link. Thus I set parent to 6k so that  
     316+"mail"+"other" are limited to 6k while "web" can go over. 
     317+<p> 
     318+You can do similar setup by using one more class and deeper hierarchy 
     319+but this is just to show you the possibility. 
     320+<p> 
     321+<b>"RTNETLINK answers: Invalid argument" and tc parameters are correct 
     322+</b> 
     323+<p> 
     324+Probably you use tc tool not suited for HTB in kernel. Reread 
     325+main HTB page section Downloads. 
     326+<p> 
     327+<b>All packets are dropped when "default" is set to nonleaf 
     328+</b> 
     329+<p> 
     330+Yes. Default kwyword must point to leaf or be 0 (so unclassified 
     331+packets go thru directly). If you want to "direct" other packets 
     332+to non-leaf do it by catch all filter with the largest "pref". 
     333+<p> 
     334+<b>What tool was used to create graphs in HTB manual ? 
     335+</b> 
     336+<p> 
     337+It is proprietary tool called ethloop  
     338+(<a href=http://luxik.cdi.cz/~devik/qos/ethloop/>luxik.cdi.cz/~devik/qos/ethloop/</a>). 
     339+ 
     340+</body></html> 
     341--- iproute-20071016.orig/debian/doc/htb/userg.htm 
     342+++ iproute-20071016/debian/doc/htb/userg.htm 
     343@@ -0,0 +1,449 @@ 
     344+<html><head><title>HTB manual - user guide</title></head> 
     345+<body> 
     346+<h1><center>HTB Linux queuing discipline manual - user guide</center></h1> 
     347+<center><address> 
     348+Martin Devera aka devik (devik@cdi.cz)<br> 
     349+Manual: devik and Don Cohen<br> 
     350+Last updated: 5.5.2002 
     351+</address></center> 
     352+<br> 
     353+New text is in red color. Coloring is removed on new text 
     354+after 3 months. Currently they depicts HTB3 changes<p> 
     355+<p> 
     356+<ul> 
     357+<li><a href=#intro>1. Introduction</a> 
     358+<li><a href=#sharing>2. Link sharing</a> 
     359+<li><a href=#hsharing>3. Sharing hierarchy</a> 
     360+<li><a href=#ceiling>4. Rate ceiling</a> 
     361+<li><a href=#burst>5. Burst</a> 
     362+<li><a href=#prio>6. Priorizing bandwidth share</a> 
     363+<li><a href=#stats>7. Understanding statistics</a> 
     364+<li><a href=#err>8. Making, debugging and sending error reports</a> 
     365+</ul> 
     366+<a name=intro><h2>1. Introduction</h2> 
     367+ 
     368+HTB is meant as a more understandable, intuitive and faster replacement for the 
     369+CBQ qdisc in Linux.  Both CBQ and HTB help you to control the 
     370+use of the outbound bandwidth on a given link.  Both allow you to use 
     371+one physical link to simulate several slower links and to send different  
     372+kinds of traffic on different simulated links.  In both cases, you have 
     373+to specify how to divide the physical link into simulated links and how 
     374+to decide which simulated link to use for a given packet to be sent. 
     375+<p> 
     376+This document shows you how to use HTB.  
     377+Most sections have examples, charts (with measured data) and 
     378+discussion of particular problems. 
     379+<p> 
     380+This release of HTB should be also much more scalable. See 
     381+comparison at HTB home page. 
     382+<p> 
     383+<b>Please read:</b> tc tool (not only HTB) uses shortcuts to denote units 
     384+of rate. <b>kbps</b> means kilo<b>bytes</b> and <b>kbit</b> means  
     385+<b>kilobits</b> ! This is the most FAQ about tc in linux. 
     386+<p> 
     387+ 
     388+<a name=sharing><h2>2. Link sharing</h2> 
     389+<img src=Ag2Leaf3flat.gif align=right> 
     390+ 
     391+<i>Problem: We have two customers, A and B, both connected to the 
     392+internet via eth0.  We want to allocate 60 kbps to B and 40 kbps to A. 
     393+Next we want to subdivide A's bandwidth 30kbps for WWW and 10kbps 
     394+for everything else.  Any unused bandwidth can be used by any class  
     395+which needs it (in proportion of its allocated share).</i> 
     396+<p> 
     397+HTB ensures that <b> the amount of service provided to each class is 
     398+at least the minimum of the amount it requests and the amount assigned 
     399+to it</b>.  When a class requests less than the amount assigned, the  
     400+remaining (excess) bandwidth is distributed to other classes which request  
     401+service.<p> 
     402+Also see document about HTB internals - it 
     403+describes goal above in greater details. 
     404+<p> 
     405+<i>Note: In the literature this is called "borrowing" the excess bandwidth. 
     406+We use that term below to conform with the literature.  We mention, however, 
     407+that this seems like a bad term since there is no obligation to repay the 
     408+resource that was "borrowed". 
     409+</i> 
     410+<p> 
     411+The different kinds of traffic above are represented by classes in 
     412+HTB.  The simplest approach is shown in the picture at the right.  
     413+<br> 
     414+Let's see what commands to use: 
     415+<pre> 
     416+tc qdisc add dev eth0 root handle 1: htb default 12 
     417+</pre> 
     418+This command attaches queue discipline HTB to eth0 and gives it the  
     419+"handle" <b>1:</b>. 
     420+This is just a name or identifier with which to refer to it below.  
     421+The <b>default 12</b> 
     422+means that any traffic that is not otherwise classified will be assigned  
     423+to class 1:12.  
     424+<p> 
     425+<i>Note:  
     426+In general (not just for HTB but for all qdiscs and classes in tc), 
     427+handles are written x:y where x is an integer identifying a qdisc and 
     428+y is an integer identifying a class belonging to that qdisc.  The handle  
     429+for a qdisc must have zero for its y value and the handle for a class 
     430+must have a non-zero value for its y value.  The "1:" above is treated 
     431+as "1:0". 
     432+</i> 
     433+<p> 
     434+<pre> 
     435+tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil 100kbps  
     436+tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil 100kbps 
     437+tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil 100kbps 
     438+tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil 100kbps 
     439+</pre> 
     440+<p> 
     441+The first line creates a "root" class, 1:1 under the qdisc 1:.  
     442+The definition of a root class is one with the htb qdisc as its parent. 
     443+A root class, like other classes under an htb qdisc allows its children 
     444+to borrow from each other, but one root class cannot borrow from another.   
     445+We could have created the other three classes directly under the htb qdisc,  
     446+but then the excess bandwidth from one would not be available to the others. 
     447+In this case we do want to allow borrowing, so we have to create an extra 
     448+class to serve as the root and put the classes that will carry the real data 
     449+under that.  These are defined by the next three lines. 
     450+The <b>ceil</b> parameter is described below.  
     451+<p><i>Note: Sometimes people ask me why they have to repeat <b>dev eth0</b>  
     452+when they have already used <b>handle</b> or <b>parent</b>.  The reason  
     453+is that handles are local to an interface, e.g., eth0 and eth1 could each  
     454+have classes with handle 1:1.</i> 
     455+<p> 
     456+We also have to describe which packets belong in which class. 
     457+This is really not related to the HTB qdisc.  See the tc filter 
     458+documentation for details.  The commands will look something like this: 
     459+<pre> 
     460+tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ 
     461+   match ip src 1.2.3.4 match ip dport 80 0xffff flowid 1:10 
     462+tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \ 
     463+   match ip src 1.2.3.4 flowid 1:11 
     464+</pre> 
     465+(We identify A by its IP address which we imagine here to be 1.2.3.4.) 
     466+<p><i>Note: The U32 classifier has an undocumented design bug which causes  
     467+duplicate entries to be listed by "tc filter show" when you use U32  
     468+classifiers with different prio values.</i> 
     469+<img src=flatnp.gif align=right> 
     470+<p> 
     471+You may notice that we didn't create a filter for the 1:12 class.  
     472+It might be more clear to do so, but this illustrates the use of the default. 
     473+Any packet not classified by the two rules above (any packet 
     474+not from source address 1.2.3.4) will be put in class 1:12. 
     475+<p> 
     476+Now we can optionally attach queuing disciplines to the leaf classes. 
     477+If none is specified the default is pfifo. 
     478+<pre> 
     479+tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5 
     480+tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5 
     481+tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10 
     482+</pre> 
     483+That's all the commands we need.  Let's see what happens if we send 
     484+packets of each class at 90kbps and then stop sending packets of one 
     485+class at a time.  Along the bottom of the graph are annotations  
     486+like "0:90k".  The horizontal position at the center of the label  
     487+(in this case near the 9, also marked with a red "1") indicates the 
     488+time at which the rate of some traffic class changes.   
     489+Before the colon is an identifier for 
     490+the class (0 for class 1:10, 1 for class 1:11, 2 for class 1:12) and 
     491+after the colon is the new rate starting at the time where the  
     492+annotation appears.  For example, the rate of class 0 is changed to 
     493+90k at time 0, 0 (= 0k) at time 3, and back to 90k at time 6. 
     494+<p> 
     495+Initially all classes generate 90kb.  Since this is higher than any 
     496+of the rates specified, each class is limited to its  
     497+specified rate.  At time 3 when we stop sending class 0 packets, the 
     498+rate allocated to class 0 is reallocated to the other two 
     499+classes in proportion to their allocations, 1 part class 1 to 6 parts class 2. 
     500+(The increase in class 1 is hard to see because it's only 4 kbps.) 
     501+Similarly at time 9 when class 1 traffic stops its bandwidth is 
     502+reallocated to the other two (and the increase in class 0 is similarly hard 
     503+to see.)  At time 15 it's easier to see that the allocation to class 2 is 
     504+divided 3 parts for class 0 to 1 part for class 1.  At time 18 both class 1 and 
     505+class 2 stop so class 0 gets all 90 kbps it requests. 
     506+<p> 
     507+It might be good time to touch concept of <b>quantums</b> now. In fact when 
     508+more classes want to borrow bandwidth they are each given some number of 
     509+bytes before serving other competing class. This number is called quantum. 
     510+You should see that if several classes are competing for parent's bandwidth 
     511+then they get it in proportion of their quantums. It is important to know 
     512+that for precise operation quantums need to be as small as possible and 
     513+larger than MTU. 
     514+<br> 
     515+Normaly you don't need to specify quantums manualy as HTB chooses precomputed 
     516+values. It computes classe's quantum (when you add or change it) as its 
     517+rate divided by <b>r2q</b> global parameter. Its default value is 10 
     518+and because typical MTU is 1500 the default is good for rates from 
     519+15 kBps (120 kbit). For smaller minimal rates specify r2q 1 when 
     520+creating qdisc - it is good from 12 kbit which should be enough. If 
     521+you will need you can specify quantum manualy when adding or changing 
     522+the class. You can avoid warnings in log if precomputed value would be 
     523+bad. When you specify quantum on command line the r2q is ignored for 
     524+that class. 
     525+<p> 
     526+This might seem like a good solution if A and B were not different 
     527+customers.  However, if A is paying for 40kbps then he would probably 
     528+prefer his unused WWW bandwidth to go to his own other service rather  
     529+than to B.  This requirement is represented in HTB by the class hierarchy. 
     530+ 
     531+<img src=Ag2Leaf3hier.gif align=right> 
     532+<a name=hsharing><h2>3. Sharing hierarchy</h2> 
     533+The problem from the previous chapter is solved by the class hierarchy 
     534+in this picture.  Customer A is now explicitly represented by its own 
     535+class.  Recall from above that 
     536+<b> the amount of service provided to each class is at least the  
     537+minimum of the amount it requests and the amount assigned to it</b>.   
     538+This applies to htb classes that are not parents of other htb classes. 
     539+We call these leaf classes. 
     540+For htb classes that are parents of other htb classes, which we call 
     541+interior classes, the rule is that 
     542+<b> the amount of service is at least the minumum of the amount assigned  
     543+to it and the sum of the amount requested by its children</b>. 
     544+In this case we assign 40kbps to customer A.  That means that if A  
     545+requests less than the allocated rate for WWW, the excess will be used  
     546+for A's other traffic (if there is demand for it), at least until the sum is 
     547+40kbps. 
     548+<p> 
     549+<i>Notes: Packet classification rules can assign to inner nodes too. Then 
     550+you have to attach other filter list to inner node. Finally you should 
     551+reach leaf or special 1:0 class. The rate supplied for a parent should be the sum 
     552+of the rates of its children. </i> 
     553+<p>The commands are now as follows: 
     554+<pre> 
     555+tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil 100kbps 
     556+tc class add dev eth0 parent 1:1 classid 1:2 htb rate 40kbps ceil 100kbps 
     557+tc class add dev eth0 parent 1:2 classid 1:10 htb rate 30kbps ceil 100kbps 
     558+tc class add dev eth0 parent 1:2 classid 1:11 htb rate 10kbps ceil 100kbps 
     559+tc class add dev eth0 parent 1:1 classid 1:12 htb rate 60kbps ceil 100kbps 
     560+</pre> 
     561+<img src=hiernp.gif align=right> 
     562+<p> 
     563+We now turn to the graph showing the results of the hierarchical solution. 
     564+When A's WWW traffic stops, its assigned bandwidth is reallocated to A's  
     565+other traffic so that A's total bandwidth is still the assigned 40kbps.<br> 
     566+If A were to request less than 40kbs in total then the excess would be given to B. 
     567+ 
     568+<a name=ceiling><h2>4. Rate ceiling</h2> 
     569+The <b>ceil</b> argument specifies the maximum bandwidth that a class 
     570+can use.  This limits how much bandwidth that class can borrow. 
     571+The default ceil is the same as the rate.  (That's why we had to specify  
     572+it in the examples above to show borrowing.) 
     573+We now change the <b>ceil 100kbps</b> for classes 1:2 (A) and 1:11  
     574+(A's other) from the previous chapter to <b>ceil 60kbps</b> and  
     575+<b>ceil 20kbps</b>. 
     576+<p> 
     577+The graph at right differs from the previous one at time 3 (when WWW  
     578+traffic stops) because A/other is limited to 20kbps.  Therefore customer  
     579+A gets only 20kbps in total and the unused 20kbps is allocated to B.<br>   
     580+The second difference is at time 15 when B stops.  Without the ceil,  
     581+all of its bandwidth was given to A, but now A is only allowed to use  
     582+60kbps, so the remaining 40kbps goes unused. 
     583+<img src=hiernpceil.gif align=right> 
     584+<p> 
     585+This feature should be useful for ISPs because they probably want to 
     586+limit the amount of service a given customer gets even when other  
     587+customers are not requesting service.  (ISPs probably want customers  
     588+to pay more money for better service.) 
     589+Note that root classes are not allowed to borrow, so there's really no 
     590+point in specifying a ceil for them. 
     591+<p> 
     592+<i>Notes: The ceil for a class should always be at least as high as the rate.  
     593+Also, the ceil for a class should always be at least as high as the ceil of 
     594+any of its children.</i> 
     595+ 
     596+<a name=burst><h2>5. Burst</h2> 
     597+ 
     598+Networking hardware can only send one packet at a time and only at  
     599+a hardware dependent rate.  Link sharing software can only use this 
     600+ability to approximate the effects of multiple links running at  
     601+different (lower) speeds.  Therefore the rate and ceil are not really  
     602+instantaneous measures but averages over the time that it takes to send  
     603+many packets.  What really happens is that the traffic from one class 
     604+is sent a few packets at a time at the maximum speed and then other 
     605+classes are served for a while. 
     606+ 
     607+The <b>burst</b> and <b>cburst</b> parameters control the amount of data 
     608+that can be sent at the maximum (hardware) speed without trying to serve 
     609+another class. 
     610+<p> 
     611+If <b>cburst</b> is smaller (ideally one packet size) it shapes bursts to not exceed  
     612+<b>ceil</b> rate in the same way as TBF's peakrate does.<p> 
     613+When you set <b>burst</b> for parent class smaller than for some child 
     614+then you should expect the parent class to get stuck sometimes (because 
     615+child will drain more than parent can handle). HTB will remember these 
     616+negative bursts up to 1 minute. 
     617+<p> 
     618+You can ask <b>why I want bursts</b>. Well it is cheap and simple way 
     619+how to improve response times on congested link. For example www traffic 
     620+is bursty. You ask for page, get it in burst and then read it. During 
     621+that idle period burst will "charge" again.  
     622+<p> 
     623+<i>Note: The burst and cburst of a class should always be at least 
     624+as high as that of any of it children.</i> 
     625+<p> 
     626+<img src=hiernpburst.gif align=right> 
     627+On graph you can see case from previous chapter where I changed burst 
     628+for red and yellow (agency A) class to 20kb but cburst remained 
     629+default (cca 2 kb).<br> 
     630+Green hill is at time 13 due to burst setting on SMTP class. 
     631+A class. It has underlimit since time 9 and accumulated 20 kb of burst. 
     632+The hill is high up to 20 kbps (limited by ceil because it has cburst 
     633+near packet size).<br> 
     634+Clever reader can think why there is not red and yellow hill at time 
     635+7. It is because yellow is already at ceil limit so it has no space 
     636+for furtner bursts.<br> 
     637+There is at least one unwanted artifact - magenta crater at time 4. It 
     638+is because I intentionaly "forgot" to add burst to root link (1:1) class. 
     639+It remembered hill from time 1 and when at time 4 blue class wanted to  
     640+borrow yellow's rate it denied it and compensated itself. 
     641+<p> 
     642+<b>Limitation:</b> when you operate with high rates on computer with low 
     643+resolution timer you need some minimal <b>burst</b> and <b>cburst</b> to  
     644+be set for all classes. Timer resolution on i386 systems is 10ms and 
     645+1ms on Alphas. 
     646+The minimal burst can be computed as max_rate*timer_resolution. So that 
     647+for 10Mbit on plain i386 you needs burst 12kb.<p> 
     648+If you set too small burst you will encounter smaller rate than you set. 
     649+Latest tc tool will compute and set the smallest possible burst when it 
     650+is not specified. 
     651+ 
     652+<img src=hierprio.gif align=right> 
     653+<a name=prio><h2>6. Priorizing bandwidth share</h2> 
     654+Priorizing traffic has two sides. First it affects how the excess bandwidth 
     655+is distributed among siblings. Up to now we have seen that excess bandwidth 
     656+was distibuted according to rate ratios. Now I used basic configuration from 
     657+chapter 3 (hierarchy without ceiling and bursts) and changed priority of all 
     658+classes to 1 except SMTP (green) which I set to 0 (higher).<br> 
     659+From sharing view you see that the class got all the excess bandwidth. The 
     660+rule is that <b>classes with higher priority are offered excess bandwidth 
     661+first</b>. But rules about guaranted <b>rate</b> and <b>ceil</b> are still 
     662+met.<p> 
     663+There is also second face of problem. It is total delay of packet. It is relatively 
     664+hard to measure on ethernet which is too fast (delay is so neligible). But 
     665+there is simple help. We can add simple HTB with one class rate limiting to 
     666+less then 100 kbps and add second HTB (the one we are measuring) as child. Then we 
     667+can simulate slower link with larger delays.<br> 
     668+For simplicity sake I use simple two class scenario: 
     669+<pre> 
     670+# qdisc for delay simulation 
     671+tc qdisc add dev eth0 root handle 100: htb 
     672+tc class add dev eth0 parent 100: classid 100:1 htb rate 90kbps 
     673+ 
     674+# real measured qdisc 
     675+tc qdisc add dev eth0 parent 100:1 handle 1: htb 
     676+AC="tc class add dev eth0 parent" 
     677+$AC 1: classid 1:1 htb rate 100kbps 
     678+$AC 1:2 classid 1:10 htb rate 50kbps ceil 100kbps prio 1 
     679+$AC 1:2 classid 1:11 htb rate 50kbps ceil 100kbps prio 1 
     680+tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 2 
     681+tc qdisc add dev eth0 parent 1:11 handle 21: pfifo limit 2 
     682+</pre> 
     683+<img src=priotime.gif align=right> 
     684+<i>Note: HTB as child of another HTB is NOT the same as class under 
     685+another class within the same HTB. It is because when class in HTB can send 
     686+it will send as soon as hardware equipment can. So that delay of underlimit 
     687+class is limited only by equipment and not by ancestors.<br> 
     688+In HTB under HTB case the outer HTB simulates new hardware equipment with 
     689+all consequences (larger delay)</i> 
     690+<p> 
     691+Simulator is set to generate 50 kbps for both classes and at time 3s it 
     692+executes command: 
     693+<pre> 
     694+tc class change dev eth0 parent 1:2 classid 1:10 htb \ 
     695+ rate 50kbps ceil 100kbps burst 2k prio 0 
     696+</pre> 
     697+As you see the delay of WWW class dropped nearly to the zero while 
     698+SMTP's delay increased. When you priorize to get better delay it always 
     699+makes other class delays worse.<br> 
     700+Later (time 7s) the simulator starts to generate WWW at 60 kbps and SMTP at 40 kbps. 
     701+There you can observe next interesting behaviour. When class is overlimit 
     702+(WWW) then HTB priorizes underlimit part of bandwidth first.<p> 
     703+<b>What class should you priorize ?</b> Generaly those classes where 
     704+you really need low delays. The example could be video or audio 
     705+traffic (and you will really need to use correct <b>rate</b> here 
     706+to prevent traffic to kill other ones) or interactive (telnet, SSH) 
     707+traffic which is bursty in nature and will not negatively affect 
     708+other flows.<br> 
     709+Common trick is to priorize ICMP to get nice ping delays even on fully 
     710+utilized links (but from technical point of view it is not what you want when 
     711+measuring connectivity). 
     712+ 
     713+<a name=stats><h2>7. Understanding statistics</h2> 
     714+The <b>tc</b> tool allows you to gather statistics of queuing disciplines in Linux. 
     715+Unfortunately statistic results are not explained by authors so that you often can't 
     716+use them. Here I try to help you to understand HTB's stats.<br> 
     717+First whole HTB stats. The snippet bellow is taken during simulation from chapter 3. 
     718+<pre> 
     719+# tc -s -d qdisc show dev eth0 
     720+ qdisc pfifo 22: limit 5p 
     721+ Sent 0 bytes 0 pkts (dropped 0, overlimits 0)  
     722+ 
     723+ qdisc pfifo 21: limit 5p 
     724+ Sent 2891500 bytes 5783 pkts (dropped 820, overlimits 0)  
     725+ 
     726+ qdisc pfifo 20: limit 5p 
     727+ Sent 1760000 bytes 3520 pkts (dropped 3320, overlimits 0)  
     728+ 
     729+ qdisc htb 1: r2q 10 default 1 direct_packets_stat 0 
     730+ Sent 4651500 bytes 9303 pkts (dropped 4140, overlimits 34251)  
     731+</pre> 
     732+First three disciplines are HTB's children. Let's ignore them as PFIFO 
     733+stats are self explanatory.<br> 
     734+<i>overlimits</i> tells you how many times the discipline delayed a packet. 
     735+<i>direct_packets_stat</i> tells you how many packets was sent thru direct queue. 
     736+Other stats are sefl explanatory. Let's look at class' stats: 
     737+<pre> 
     738+tc -s -d class show dev eth0 
     739+class htb 1:1 root prio 0 rate 800Kbit ceil 800Kbit burst 2Kb/8 mpu 0b  
     740+    cburst 2Kb/8 mpu 0b quantum 10240 level 3  
     741+ Sent 5914000 bytes 11828 pkts (dropped 0, overlimits 0)  
     742+ rate 70196bps 141pps  
     743+ lended: 6872 borrowed: 0 giants: 0 
     744+ 
     745+class htb 1:2 parent 1:1 prio 0 rate 320Kbit ceil 4000Kbit burst 2Kb/8 mpu 0b  
     746+    cburst 2Kb/8 mpu 0b quantum 4096 level 2  
     747+ Sent 5914000 bytes 11828 pkts (dropped 0, overlimits 0)  
     748+ rate 70196bps 141pps  
     749+ lended: 1017 borrowed: 6872 giants: 0 
     750+ 
     751+class htb 1:10 parent 1:2 leaf 20: prio 1 rate 224Kbit ceil 800Kbit burst 2Kb/8 mpu 0b  
     752+    cburst 2Kb/8 mpu 0b quantum 2867 level 0  
     753+ Sent 2269000 bytes 4538 pkts (dropped 4400, overlimits 36358)  
     754+ rate 14635bps 29pps  
     755+ lended: 2939 borrowed: 1599 giants: 0 
     756+</pre> 
     757+I deleted 1:11 and 1:12 class to make output shorter. As you see there 
     758+are parameters we set. Also there are <i>level</i> and DRR <i>quantum</i> 
     759+informations.<br> 
     760+<i>overlimits</i> shows how many times class was asked to send packet 
     761+but he can't due to rate/ceil constraints (currently counted for leaves only).<br> 
     762+<i>rate, pps</i> tells you actual (10 sec averaged) rate going thru class. It 
     763+is the same rate as used by gating.<br> 
     764+<i>lended</i> is # of packets donated by this class (from its <b>rate</b>) and 
     765+<i>borrowed</i> are packets for whose we borrowed from parent. Lends are always 
     766+computed class-local while borrows are transitive (when 1:10 borrows from 1:2 which 
     767+in turn borrows from 1:1 both 1:10 and 1:2 borrow counters are incremented).<br> 
     768+<i>giants</i> is number of packets larger than mtu set in tc command. HTB will 
     769+work with these but rates will not be accurate at all. Add mtu to your tc (defaults 
     770+to 1600 bytes).<br> 
     771+ 
     772+<a name=err><h2>8. Making, debugging and sending error reports</h2> 
     773+<font color=red date=30.12.2002> 
     774+If you have kernel 2.4.20 or newer you don't need to patch it - all 
     775+is in vanilla tarball. The only thing you need is <b>tc</b> tool. 
     776+Download HTB 3.6 tarball and use tc from it. 
     777+</font><p> 
     778+You have to patch to make it work with older kernels. Download kernel source and 
     779+use <b>patch -p1 -i htb3_2.X.X.diff</b> to apply the patch. Then use 
     780+<b>make menuconfig;make bzImage</b> as before. Don't forget to enable QoS and HTB.<br> 
     781+Also you will have to use patched <b>tc</b> tool. The patch is also 
     782+in downloads or you can download precompiled binary.<p> 
     783+If you think that you found an error I will appreciate error report. 
     784+For oopses I need ksymoops output. For weird qdisc behaviour add 
     785+parameter <b>debug 3333333</b> to your <b>tc qdisc add .... htb</b>. 
     786+It will log many megabytes to syslog facility kern level debug. You 
     787+will probably want to add line like:<br> 
     788+<b>kern.debug       -/var/log/debug</b><br> 
     789+to your /etc/syslog.conf. Then bzip and send me the log via email 
     790+(up to 10MB after bzipping) along with description of problem and 
     791+its time. 
     792+</body></html> 
     793--- iproute-20071016.orig/debian/copyright 
     794+++ iproute-20071016/debian/copyright 
     795@@ -0,0 +1,44 @@ 
     796+This is the Debian GNU/Linux's prepackaged version of the 
     797+Linux Traffic Control engine and related utils, "iproute" 
     798+ 
     799+The source code was obtained from 
     800+  http://developer.osdl.org/dev/iproute2 
     801+The former upstream was 
     802+  ftp://ftp.inr.ac.ru/ip-routing/iproute2-2.4.7-now-ss010824.tar.gz 
     803+ 
     804+Copyrights 
     805+---------- 
     806+Copyright (C) 1996-2001 Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> 
     807+Copyright (C)           Stephen Hemminger <shemminger@osdl.org> 
     808+and others, including, but not limited to 
     809+  Copyright (C) 2004    USAGI/WIDE Project 
     810+  Copyright (C)         J Hadi Salim (hadi@cyberus.ca) 
     811+ 
     812+Modifications for Debian: 
     813+  Copyright (C) 1996 Tom Lees <tom@lpsg.demon.co.uk> 
     814+  Copyright (C) 1998 Christoph Lameter <christoph@lameter.com> 
     815+  Copyright (C) 1998-1999 Roberto Lumbreras <rover@debian.org> 
     816+  Copyright (C) 1999-2003 Juan Cespedes <cespedes@debian.org> 
     817+  Copyright (C) 2005- Alexander Wirt <formorer@debian.org> 
     818+ 
     819+ 
     820+License 
     821+------- 
     822+ 
     823+This program is free software; you can redistribute it and/or modify 
     824+it under the terms of the GNU General Public License as published by 
     825+the Free Software Foundation; either version 2, or (at your option) 
     826+any later version. 
     827+ 
     828+This program is distributed in the hope that it will be useful, but 
     829+WITHOUT ANY WARRANTY; without even the implied warranty of 
     830+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     831+General Public License for more details. 
     832+ 
     833+A copy of the GNU General Public License is available as 
     834+`/usr/share/common-licenses/GPL' in the Debian GNU/Linux distribution 
     835+or on the World Wide Web at `http://www.gnu.org/copyleft/gpl.html'. 
     836+You can also obtain it by writing to the Free Software Foundation, 
     837+Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 
     838+MA 02110-1301, USA. 
     839+ 
     840--- iproute-20071016.orig/debian/iproute.links 
     841+++ iproute-20071016/debian/iproute.links 
     842@@ -0,0 +1,9 @@ 
     843+/usr/bin/lnstat usr/bin/rtstat 
     844+/usr/bin/lnstat usr/bin/ctstat 
     845+bin/ip sbin/ip 
     846+/usr/share/man/man8/tc-pfifo.8.gz /usr/share/man/man8/tc-bfifo.8.gz 
     847+/usr/share/man/man8/lnstat.8.gz /usr/share/man/man8/rtstat.8.gz 
     848+/usr/share/man/man8/lnstat.8.gz /usr/share/man/man8/ctstat.8.gz 
     849+/usr/share/man/man8/rtacct.8.gz /usr/share/man/man8/nstat.8.gz 
     850+/usr/share/man/man8/routel.8.gz /usr/share/man/man8/routef.8.gz 
     851+ 
     852--- iproute-20071016.orig/debian/README.Debian 
     853+++ iproute-20071016/debian/README.Debian 
     854@@ -0,0 +1,6 @@ 
     855+iproute for Debian 
     856+------------------ 
     857+ 
     858+If you want use tc with the atm based queue you have to install libatm1 first.  
     859+ 
     860+ -- Alexander Wirt <formorer@debian.org>  Fri, 28 Dec 2007 11:56:28 +0100 
     861--- iproute-20071016.orig/debian/changelog 
     862+++ iproute-20071016/debian/changelog 
     863@@ -0,0 +1,472 @@ 
     864+iproute (20071016-3) unstable; urgency=low 
     865+ 
     866+  [ Alexander Wirt ] 
     867+  * Prevent q_atm from being scanned by dh_shlibdeps 
     868+  * Bump priority to important (Closes: #414086) 
     869+  * Make iproute-doc architecture all 
     870+ 
     871+  [ Andreas Henriksson ] 
     872+  * Revert "fix dotted-quad support patch to work on big-endian", 
     873+    and cherry-pick official upstream fix. 
     874+  * Revert "TC action parsing bug fix" (Closes: #458539) 
     875+  * Add synonyms for ip rule options to ip(8) manpage, 
     876+    and drop ip_rule_usage.dpatch (Closes: #433507) 
     877+  * Add routel and routef man page. (Closes: #325290) 
     878+ 
     879+ -- Alexander Wirt <formorer@debian.org>  Fri, 04 Jan 2008 23:04:36 +0100 
     880+ 
     881+iproute (20071016-2) unstable; urgency=low 
     882+ 
     883+  [ Andreas Henriksson ] 
     884+  * fix incompatibility with older kernels (Closes: #457161) 
     885+    (Cherry picked from upstream) 
     886+ 
     887+ -- Alexander Wirt <formorer@debian.org>  Thu, 20 Dec 2007 23:05:25 +0100 
     888+ 
     889+iproute (20071016-1) unstable; urgency=low 
     890+ 
     891+  [ Andreas Henriksson ] 
     892+  * New upstream release (v2.6.23 aka snapshot 071016) (Closes: #445944) 
     893+    - time2tick overflow patch applied upstream (Closes: #175462) 
     894+    - tc ematch cmp/nbyte help patch applied upstream (Closes: #438653) 
     895+    - mpath support dropped upstream (Closes: #428440, #428442) 
     896+    - new manpages included upstream (Closes: #438994) 
     897+    - linux header files updated to v2.6.23 (Closes: #409047) 
     898+  * Drop patches which has been applied upstream or deprecated by 
     899+    upstream changes. 
     900+    - debian/patches/lartc applied upstream. 
     901+    - debian/patches/netbug_fix deprecated, upstream dropped netbug script. 
     902+    - debian/patches/empty_linkname.dpatch deprecated, fixed upstream. 
     903+  * Add .dpatch suffix to wrr-qdisc patch to make dpatch-edit-patch work. 
     904+  * Update patches to apply: 
     905+    - wrr-qdisc, moo, ip_route_usage 
     906+  * Don't install removed netbug script. 
     907+  * Fix corruption when using batch files with comments and broken 
     908+    lines. (cherry-picked from upstream. Closes: #398912) 
     909+  * Update build-dependencies: 
     910+    - libdb4.3-dev -> libdb-dev. (Closes: #442653) 
     911+    - linux-kernel-headers -> linux-libc-dev. 
     912+  * Drop debian/patches/ip_address_flush_loop.dpatch, 
     913+    instead we'll use Daniel Silverstones patch imported from Ubuntu. 
     914+  * Add Homepage and Vcs-{Browser,Git} fields to debian/control. 
     915+  * Remove dead/leftover code from tc/q_htb.c, include/linux/pkt_sched.h 
     916+  * Remove outdated README.Debian. 
     917+  * Drop our own (buggy) RTAX_INITCWND support, in favor of upstreams. 
     918+  * fix dotted-quad support patch to work on big-endian. 
     919+    (upstream applied a broken patch, which we cherry-picked for #357172) 
     920+ 
     921+  [ Ben Finney ] 
     922+  * Add dh_md5sums to generate md5sums control file (Closes: #439439) 
     923+ 
     924+  [ Justin Pryzby ] 
     925+  * ss(8) manpage formatting breaks EXAMPLE (Closes: #443071) 
     926+ 
     927+  [ Daniel Silverstone ] 
     928+  * Avoid infinite loop in ip addr flush. 
     929+ 
     930+  [ Alexander Wirt ] 
     931+  * Add Andreas Henriksson to uploaders 
     932+  * Bump standards version 
     933+  * Support dotted-quad netmasks in iproute (Closes: #357172) (Cherry picked 
     934+    from upstream) 
     935+ 
     936+ -- Alexander Wirt <formorer@debian.org>  Sun, 16 Dec 2007 14:30:31 +0100 
     937+ 
     938+iproute (20070313-1) unstable; urgency=low 
     939+ 
     940+  * New upstream release 
     941+  * Make iproute-doc a suggest (Closes: #424967) 
     942+  * Add tc_cbq_details_typo.dpatch (Closes: #387083) 
     943+  * Add libnetlink_typo.dpatch (Closes: #396124) 
     944+  * Add tcb_htb_typo.dpatch (Closes: #396317) 
     945+  * Remove references to non-existing tc-filters manpage (Closes: 
     946+    #298715) 
     947+  * Fix bad phrased sentence in ss manpage (Closes: #401552) 
     948+ 
     949+ -- Alexander Wirt <formorer@debian.org>  Sun, 10 Jun 2007 19:36:48 +0200 
     950+ 
     951+iproute (20061002-4) unstable; urgency=low 
     952+ 
     953+  * Add distribution tables (used by netem).  
     954+    (Closes: #408313) 
     955+ 
     956+ -- Alexander Wirt <formorer@debian.org>  Wed, 24 Jan 2007 22:55:26 +0100 
     957+ 
     958+iproute (20061002-3) unstable; urgency=low 
     959+ 
     960+  * Added a patch from Nikolai Kondrashov that fixes unknown 
     961+    symbols in ip_common.h. (Closes: #397584) 
     962+ 
     963+ -- Alexander Wirt <formorer@debian.org>  Thu, 14 Dec 2006 20:11:55 +0100 
     964+ 
     965+iproute (20061002-2) unstable; urgency=medium 
     966+ 
     967+  * Add manpage for ss, rtmon  and lnstat (Thanks to Michael Prokop for that)  
     968+  * Fix metric output of iproute (backported from git) 
     969+    (http://bugs.archlinux.org/task/5669) 
     970+  * medium as this bug breaks other packages such as vpnc 
     971+ 
     972+ -- Alexander Wirt <formorer@debian.org>  Thu, 19 Oct 2006 06:39:05 +0200 
     973+ 
     974+iproute (20061002-1) unstable; urgency=low 
     975+ 
     976+  * New upstream release 
     977+    - This fixes the xfrm monitor mode (Closes: #383133) 
     978+  * Fix typos in manpages (Closes: #387082, #387083) 
     979+  * Split docs in a seperate package  
     980+ 
     981+ -- Alexander Wirt <formorer@debian.org>  Sun, 15 Oct 2006 16:40:34 +0200 
     982+ 
     983+iproute (20060323-1) unstable; urgency=low 
     984+ 
     985+  * New upstream release (Closes: #370699) 
     986+  * Removed reenable_short_matches, tc_sample_fix, f_u32 patches (included 
     987+    upstream) 
     988+  * Add manpage for pfifo (Closes: #359971) 
     989+  * Add moo object (Closes: #312843) 
     990+  * Add src option to ip_route usage (Closes: #226142) 
     991+  * Prevent users from renaming an interface to "" (Closes: #241904) 
     992+  * Added timout for ip a f (Closes: #386288) 
     993 
     994+ -- Alexander Wirt <formorer@debian.org>  Fri,  8 Sep 2006 16:43:20 +0200 
     995+ 
     996+iproute (20051007-4) unstable; urgency=low 
     997+ 
     998+  * Moved *stat binaries to /usr/bin/ (Closes: #350703) 
     999+  * Fixed some manpage typos  
     1000+    (Closes: #350671, #350672, #350673, #350674, #350675) 
     1001+  * Conflicts with arpd 
     1002+  * Fixes u32 bucket hashing calucation. (Closes: #351751) 
     1003+    Thanks to Russel Stuart for the patch 
     1004+  * Moved to libdb4.3 
     1005+  * Fixed ip help output (Closes: #354909) 
     1006+  * Fixed hardcoded module paths for tc (Closes: #290315) 
     1007+ 
     1008+ -- Alexander Wirt <formorer@debian.org>  Sun,  5 Feb 2006 09:47:36 +0100 
     1009+ 
     1010+iproute (20051007-3) unstable; urgency=low 
     1011+ 
     1012+  * New upstream release (Closes: #333643) 
     1013+  * Added a patch for tc that add u32 get parsed correct 
     1014+    Thanks Russell Stuart for the patch (Closes: #347699) 
     1015+  * We now have a manpage for tc-bfifo (Closes: #319871) 
     1016+  * "get" is no longer mentioned in tc's usage (Closes: #167314) 
     1017+  * We now build arpd (Closes: #296200) 
     1018+  * Include htb docs (Closes: #204629) 
     1019+  * Added flex to build-deps (Closes: #340004, #339119) 
     1020+  * Added symlinks for lnstat (Closes: #302589) 
     1021+  * Acknowledge heap correction nmu (Closes: #326961) 
     1022+  * Acknowledge douple free fix nmu (Closes: #338575) 
     1023+  * Fixed allmulticast mention in ip manpage (Closes: #305338) 
     1024+  * Add [ prio NUMBER ] to ip_rule.c (Closes: #213673) 
     1025+ 
     1026+ -- Alexander Wirt <formorer@debian.org>  Sun,  5 Feb 2006 09:37:01 +0100 
     1027+ 
     1028+iproute (20051007-2) experimental; urgency=low 
     1029+ 
     1030+  * Added flex to build-deps  
     1031+ 
     1032+ -- Alexander Wirt <formorer@debian.org>  Sun, 20 Nov 2005 10:46:39 +0100 
     1033+ 
     1034+iproute (20051007-1) experimental; urgency=low 
     1035+ 
     1036+  * The "lets break other peoples networking release" 
     1037+    + New upstream release 
     1038+    + New maintainer 
     1039+    + Fix netbug script 
     1040+    + Reenable short iproute commands  
     1041+ 
     1042+ -- Alexander Wirt <formorer@debian.org>  Tue,  1 Nov 2005 10:22:05 +0100 
     1043+ 
     1044+iproute (20041019-4.1) unstable; urgency=low 
     1045+ 
     1046+  * Non-maintainer upload. 
     1047+  * Fix size of table allocation (closes: #326961, #338575) 
     1048+ 
     1049+ -- Blars Blarson <blarson@blars.org>  Sat, 14 Jan 2006 02:07:18 +0000 
     1050+ 
     1051+iproute (20041019-4) unstable; urgency=low 
     1052+ 
     1053+  * New maintainer, closes: #295122. 
     1054+  * Included iproute2 homepage in debian/control and updated it in 
     1055+    debian/copyright. 
     1056+  * Updated FSF mail address in debian/copyright. 
     1057+  * Set Standards-Version to 3.6.2 in debian/control. 
     1058+  * Fixed "FTBFS: normal.c heap corrution due to table overflow", 
     1059+    closes: #326961. Patch by LaMont Jones <lamont@debian.org>. 
     1060+  * Fixed "Netbug script gives syntax error", closes: #313540. 
     1061+    Patch by Allard Hoeve <allard@byte.nl>. 
     1062+  * Fixed "Netbug creates uuencoded file with wrong suffix", closes: 
     1063+    #313541. Patch by Allard Hoeve <allard@byte.nl>. 
     1064+  * Fixed "Netbug warns about intended stripping of trailing '/'", 
     1065+    closes: #313544. Patch by Allard Hoeve <allard@byte.nl>. 
     1066+ 
     1067+ -- Anibal Monsalve Salazar <anibal@debian.org>  Fri, 11 Nov 2005 13:22:15 +1100 
     1068+ 
     1069+iproute (20041019-3) unstable; urgency=medium 
     1070+ 
     1071+  * fix insecure file creation in netbug. Closes: #289541 
     1072+  * remove bogus reference to tc-filters from tc's manpage. Closes: #289225 
     1073+  * add support for "hoplimit" and "initcwnd" route metrics. Closes: #221893 
     1074+  * ikey for GRE works. Closes: #200714 
     1075+  * include wrr qdisc. Closes: #198414 
     1076+ 
     1077+ -- Andreas Barth <aba@not.so.argh.org>  Sun,  9 Jan 2005 11:51:09 +0000 
     1078+ 
     1079+iproute (20041019-2) unstable; urgency=low 
     1080+ 
     1081+  * build fails if subdir fails. Closes: #283797 
     1082+  * include q_netem.so. Closes: #283968 
     1083+  * fix typo in man page. Closes: #285507 
     1084+  * removed the 2. and 3. copy of the man pages. 
     1085+  * start using dpatch. 
     1086+  * add reference to Advanced Routing HOWTO. Closes: #150087 
     1087+ 
     1088+ -- Andreas Barth <aba@not.so.argh.org>  Wed,  5 Jan 2005 21:20:44 +0000 
     1089+ 
     1090+iproute (20041019-1) unstable; urgency=low 
     1091+ 
     1092+  * New maintainer. 
     1093+  * packaging changes: 
     1094+    + using debhelper 
     1095+    + add all manpages. Closes: #57829, #138432, #203797, #246521 
     1096+    + add documentation text and html doc, and adding lynx as build-dep. 
     1097+      Closes: #121978, #57828 
     1098+    + include all tex-files in the doc. Closes: #107117 
     1099+  * get straight with the kernel. Closes: #186808 
     1100+  * add header files and libnetlink to new development package. 
     1101+    Closes: #128162, #139309 
     1102+  * build-depend on libatm1-dev | atm-dev instead of atm-dev 
     1103+ 
     1104+ -- Andreas Barth <aba@not.so.argh.org>  Sun, 28 Nov 2004 01:07:30 +0000 
     1105+ 
     1106+iproute (20041019-0.2) unstable; urgency=low 
     1107+ 
     1108+  * NMU, uploading to unstable. 
     1109+ 
     1110+ -- Andreas Barth <aba@not.so.argh.org>  Mon, 22 Nov 2004 19:43:17 +0200 
     1111+ 
     1112+iproute (20041019-0.1) experimental; urgency=low 
     1113+ 
     1114+  * NMU, fixing only most urgent issues. 
     1115+  * New upstream package, fixes: 
     1116+    + compatibility with 2.6.7 and above. Closes: #262698 
     1117+    + no longer with netinet/in.h. Closes: #221877 
     1118+ 
     1119+ -- Andreas Barth <aba@not.so.argh.org>  Mon,  8 Nov 2004 07:50:35 +0100 
     1120+ 
     1121+iproute (20010824-13.1) unstable; urgency=high 
     1122+ 
     1123+  * NMU for a security fix. 
     1124+  * [CAN-2003-0856] Fix a local denial of service vulnerability via 
     1125+    spoofed messages to the kernel's Netlink interface. (Closes: #242994) 
     1126+ 
     1127+ -- Joshua Kwan <joshk@triplehelix.org>  Sun, 16 May 2004 20:28:43 -0700 
     1128+ 
     1129+iproute (20010824-13) unstable; urgency=low 
     1130+ 
     1131+  * debian/rules: Run dpkg-shlibdeps with all the executables, 
     1132+    to fix dependency problem                      (closes: Bug#224063) 
     1133+  * Really removed references to obsolete include files 
     1134+    (Bug#223165 was not fixed properly) 
     1135+ 
     1136+ -- Juan Cespedes <cespedes@debian.org>  Sun, 25 Jan 2004 23:04:20 +0100 
     1137+ 
     1138+iproute (20010824-12) unstable; urgency=low 
     1139+ 
     1140+  * Updated README.Debian and copyright file 
     1141+  * Added two new manpages from http://lartc.org/manpages/: 
     1142+    ip(8) and tc-cbq-details(8). 
     1143+  * Removed references to obsolete include files which made 
     1144+    compilation fail (closes: Bug#223165) 
     1145+ 
     1146+ -- Juan Cespedes <cespedes@debian.org>  Sun, 14 Dec 2003 00:40:10 +0100 
     1147+ 
     1148+iproute (20010824-11) unstable; urgency=low 
     1149+ 
     1150+  * Changed priority to "optional" 
     1151+  * Fixed "tc -s qdisc" on sparc (patch by "Nicolas S. Dade" 
     1152+    <ndade@nsd.dyndns.org>) (closes: Bug#194128) 
     1153+ 
     1154+ -- Juan Cespedes <cespedes@debian.org>  Sun, 17 Aug 2003 00:22:47 +0200 
     1155+ 
     1156+iproute (20010824-10) unstable; urgency=low 
     1157+ 
     1158+  * Updated manual pages from http://www.lartc.org/manpages/ 
     1159+                (closes: Bug#156353, Bug#175313, Bug#176989, Bug#189095) 
     1160+  * New Standards-Version 
     1161+  * Don't "rm -rf /etc/iproute2" on purge (closes: Bug#202862) 
     1162+  * Include "iproute2" in the description (closes: Bug#182999) 
     1163+ 
     1164+ -- Juan Cespedes <cespedes@debian.org>  Sat, 16 Aug 2003 18:29:27 +0200 
     1165+ 
     1166+iproute (20010824-9) unstable; urgency=medium 
     1167+ 
     1168+  * Added patch for HTB v3.6 to be able to work with kernel 2.4.20 
     1169+    (from http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz) 
     1170+                (closes: Bug#147550, Bug#167149, Bug#167597, Bug#171277) 
     1171+ 
     1172+ -- Juan Cespedes <cespedes@debian.org>  Thu, 05 Dec 2002 13:44:10 +0100 
     1173+ 
     1174+iproute (20010824-8) unstable; urgency=medium 
     1175+ 
     1176+  * Added support for HTB queuing discipline        (closes: Bug#133381) 
     1177+    NOTE: you need a patched kernel in order to use it 
     1178+ 
     1179+ -- Juan Cespedes <cespedes@debian.org>  Tue,  2 Apr 2002 20:29:40 +0200 
     1180+ 
     1181+iproute (20010824-7) unstable; urgency=medium 
     1182+ 
     1183+  * Move `ip' binary to /bin to fix FHS violation   (closes: Bug#134812) 
     1184+ 
     1185+ -- Juan Cespedes <cespedes@debian.org>  Mon,  4 Mar 2002 00:20:30 +0100 
     1186+ 
     1187+iproute (20010824-6) unstable; urgency=low 
     1188+ 
     1189+  * Added a couple of #ifdef's to be able to compile with older 
     1190+    kernel headers (needed for arm)                 (closes: Bug#131695) 
     1191+ 
     1192+ -- Juan Cespedes <cespedes@debian.org>  Sat, 16 Feb 2002 19:27:15 +0100 
     1193+ 
     1194+iproute (20010824-5) unstable; urgency=low 
     1195+ 
     1196+  * Really fix Bug#121589 (dead gateway bug); apparently I 
     1197+    forgot to include the patch in 20010824-2 
     1198+ 
     1199+ -- Juan Cespedes <cespedes@debian.org>  Tue, 29 Jan 2002 23:22:24 +0100 
     1200+ 
     1201+iproute (20010824-4) unstable; urgency=low 
     1202+ 
     1203+  * Added support for DIFFSERV and ATM in tc 
     1204+ 
     1205+ -- Juan Cespedes <cespedes@debian.org>  Sun, 13 Jan 2002 03:01:47 +0100 
     1206+ 
     1207+iproute (20010824-3) unstable; urgency=low 
     1208+ 
     1209+  * Updated tc* man pages (thanks to bert hubert <ahu@ds9a.nl>) 
     1210+  * Fixed spurious space in `tc -s qdisc' output (closes: Bug#128501) 
     1211+ 
     1212+ -- Juan Cespedes <cespedes@debian.org>  Thu, 10 Jan 2002 22:18:25 +0100 
     1213+ 
     1214+iproute (20010824-2) unstable; urgency=low 
     1215+ 
     1216+  * Fixed the following important and serious bugs: 
     1217+    + iproute doesn't compile on Alpha (closes: Bug#118113, Bug#123224) 
     1218+    + iproute doesn't compile on MIPS (closes: Bug#118424) 
     1219+    + iproute doesn't compile on powerpc (closes: Bug#119601) 
     1220+  * Added man pages for tc (closes: Bug#124230), tc-cbq, tc-red, tc-tbf, 
     1221+    tc-prio and tc-sfq 
     1222+  * Removed references to old programs from iproute(7) (closes: Bug#99536) 
     1223+  * Fixed bug which presented first hop as dead in equal cost multipath 
     1224+                                                      (closes: Bug#121589) 
     1225+  * Do not process .ps with through `psnup' (closes: Bug#119820) 
     1226+ 
     1227+ -- Juan Cespedes <cespedes@debian.org>  Tue,  8 Jan 2002 16:07:27 +0100 
     1228+ 
     1229+iproute (20010824-1) unstable; urgency=low 
     1230+ 
     1231+  * New upstream version 
     1232+  * Make ingress qdisc work again with tc           (closes: Bug#84444) 
     1233+  * Make it compile properly with new include files (closes: Bug#113112) 
     1234+ 
     1235+ -- Juan Cespedes <cespedes@debian.org>  Sun, 28 Oct 2001 16:38:00 +0100 
     1236+ 
     1237+iproute (20001007-1) unstable; urgency=low 
     1238+ 
     1239+  * New upstream version                             (closes: Bug#63701) 
     1240+  * Remove /etc/iproute2 on purge                    (closes: Bug#72743) 
     1241+  * Fixed Lintian warnings (no-priority-field and no-section-field) 
     1242+ 
     1243+ -- Juan Cespedes <cespedes@debian.org>  Sat, 14 Oct 2000 19:27:12 +0200 
     1244+ 
     1245+iproute (991023-2) unstable; urgency=low 
     1246+ 
     1247+  * New Standards-Version (3.1.1) (closes: Bug#47923) 
     1248+  * Modified description of package to show which kernel options are 
     1249+    necessary to use the package (closes: Bug#47922) 
     1250+  * Updated manual page to point at /usr/share/doc/iproute (closes: Bug#47924) 
     1251+ 
     1252+ -- Juan Cespedes <cespedes@debian.org>  Sun, 19 Dec 1999 04:00:21 +0100 
     1253+ 
     1254+iproute (991023-1) unstable; urgency=low 
     1255+ 
     1256+  * New upstream version (closes: Bug#48733) 
     1257+ 
     1258+ -- Juan Cespedes <cespedes@debian.org>  Tue,  2 Nov 1999 16:29:37 +0100 
     1259+ 
     1260+iproute (990824-1) unstable; urgency=low 
     1261+ 
     1262+  * New maintainer 
     1263+  * New upstream version 
     1264+  * New Standards-Version: 3.1.0 
     1265+  * Minor fix in "ip rule list": mask in "from" address was not shown 
     1266+    correctly 
     1267+  * Removed obsoleted documentation from "debian/" directory 
     1268+ 
     1269+ -- Juan Cespedes <cespedes@debian.org>  Sun, 24 Oct 1999 19:02:56 +0200 
     1270+ 
     1271+iproute (990630-1) unstable; urgency=low 
     1272+ 
     1273+  * New upstream version. 
     1274+  * FHS and standards 3.0.1.0. 
     1275+ 
     1276+ -- Roberto Lumbreras <rover@debian.org>  Tue,  3 Aug 1999 02:49:28 +0200 
     1277+ 
     1278+iproute (990530-1) unstable; urgency=low 
     1279+ 
     1280+  * New upstream version. 
     1281+  * Build with 2.2.10 kernel headers. 
     1282+  * Install new scripts ip/routef ip/routel, but not ip/ifcfg ip/rtpr by 
     1283+    now, I don't know who/what needs rtpr; ifcfg uses arping, and it isn't 
     1284+    available in debian for now. 
     1285+ 
     1286+ -- Roberto Lumbreras <rover@debian.org>  Tue, 22 Jun 1999 02:28:53 +0200 
     1287+ 
     1288+iproute (990329-1) unstable; urgency=low 
     1289+ 
     1290+  * New upstream version. 
     1291+  * Build with 2.2.5 kernel headers. 
     1292+ 
     1293+ -- Roberto Lumbreras <rover@debian.org>  Sun,  4 Apr 1999 18:50:39 +0200 
     1294+ 
     1295+iproute (980630-1) unstable; urgency=low 
     1296+ 
     1297+  * New upstream version. 
     1298+  * Build with 2.1.112 kernel headers. 
     1299+  * Rewrote the rules file. 
     1300+ 
     1301+ -- Roberto Lumbreras <rover@debian.org>  Wed, 29 Jul 1998 23:37:52 +0200 
     1302+ 
     1303+iproute (980119-1) unstable; urgency=low 
     1304+ 
     1305+  * Outdated documentation. Upstream docs are scarce. 
     1306+  * Non-Maintainer release 
     1307+  * This package has no correct copyright file! 
     1308+  * Include all the README.* docs from the upstream site. 
     1309+  * Modified to build under glibc 
     1310+  * Build with 2.1.85 kernel headers. 
     1311+  * produce a correct diff. 
     1312+  * Reworked the rules file to utilize debmake fully 
     1313+  * Newest upstream release 
     1314+  * glibc compilation 
     1315+ 
     1316+ -- Christoph Lameter <christoph@lameter.com>  Wed,  4 Feb 1998 13:37:28 -0800 
     1317+ 
     1318+iproute (961225-2) unstable frozen; urgency=low 
     1319+ 
     1320+  * Added a man page for iproute. (Fixes #8080). 
     1321+  * Removed out-of-date patches. 
     1322+  * Added routing.txt from /usr/src/linux/Documentation/networking/routing.txt 
     1323+  * Newer version of debmake. 
     1324+ 
     1325+ -- Tom Lees <tom@lpsg.demon.co.uk>  Mon, 17 Apr 1997 17:00:36 +0100 
     1326+ 
     1327+iproute (961225-1) unstable; urgency=low 
     1328+ 
     1329+  * Initial Release. 
     1330+ 
     1331+ -- Tom Lees <tom@lpsg.demon.co.uk>  Mon, 30 Dec 1996 11:12:23 +0000 
     1332+ 
     1333+Local variables: 
     1334+mode: debian-changelog 
     1335+End: 
     1336--- iproute-20071016.orig/debian/iproute.install 
     1337+++ iproute-20071016/debian/iproute.install 
     1338@@ -0,0 +1,8 @@ 
     1339+ip/ip /bin 
     1340+ip/rtmon tc/tc misc/rtacct misc/ss /sbin 
     1341+misc/lnstat misc/nstat /usr/bin/ 
     1342+ip/routef ip/routel /usr/bin 
     1343+etc/* /etc 
     1344+tc/*.so /usr/lib/tc 
     1345+misc/arpd /usr/sbin 
     1346+netem/*.dist /usr/lib/tc 
     1347--- iproute-20071016.orig/debian/patches/fix_ss_typo.dpatch 
     1348+++ iproute-20071016/debian/patches/fix_ss_typo.dpatch 
     1349@@ -0,0 +1,19 @@ 
     1350+#! /bin/sh /usr/share/dpatch/dpatch-run 
     1351+## fix_ss_typo.dpatch by  <formorer@lisa.springfield.lan> 
     1352+## 
     1353+## All lines beginning with `## DP:' are a description of the patch. 
     1354+## DP: No description. 
     1355+ 
     1356+@DPATCH@ 
     1357+diff -urNad iproute-20070313~/man/man8/ss.8 iproute-20070313/man/man8/ss.8 
     1358+--- iproute-20070313~/man/man8/ss.8    2007-03-13 22:50:56.000000000 +0100 
     1359++++ iproute-20070313/man/man8/ss.8     2007-06-10 19:36:04.000000000 +0200 
     1360+@@ -9,7 +9,7 @@ 
     1361+ is used to dump socket statistics. It allows showing information similar 
     1362+ to 
     1363+ .IR netstat . 
     1364+-It can display more TCP information than state than other tools. 
     1365++It can display more TCP and state informations than other tools. 
     1366+  
     1367+ .SH OPTIONS 
     1368+ These programs follow the usual GNU command line syntax, with long 
     1369--- iproute-20071016.orig/debian/patches/00list 
     1370+++ iproute-20071016/debian/patches/00list 
     1371@@ -0,0 +1,12 @@ 
     1372+ip.8-typo 
     1373+wrr-qdisc.dpatch 
     1374+manpages-typo.dpatch 
     1375+ip_address 
     1376+tc_modules.dpatch 
     1377+moo.dpatch 
     1378+ip_route_usage.dpatch 
     1379+tc_cbq_details_typo.dpatch 
     1380+libnetlink_typo.dpatch 
     1381+tcb_htb_typo.dpatch  
     1382+fix_ss_typo.dpatch 
     1383+remove_tc_filters_reference.dpatch 
     1384--- iproute-20071016.orig/debian/patches/libnetlink_typo.dpatch 
     1385+++ iproute-20071016/debian/patches/libnetlink_typo.dpatch 
     1386@@ -0,0 +1,19 @@ 
     1387+#! /bin/sh /usr/share/dpatch/dpatch-run 
     1388+## libnetlink_typo.dpatch by  <formorer@lisa.springfield.lan> 
     1389+## 
     1390+## All lines beginning with `## DP:' are a description of the patch. 
     1391+## DP: No description. 
     1392+ 
     1393+@DPATCH@ 
     1394+diff -urNad iproute-20070313~/man/man3/libnetlink.3 iproute-20070313/man/man3/libnetlink.3 
     1395+--- iproute-20070313~/man/man3/libnetlink.3    2007-03-13 22:50:56.000000000 +0100 
     1396++++ iproute-20070313/man/man3/libnetlink.3     2007-06-10 19:28:30.000000000 +0200 
     1397+@@ -187,7 +187,7 @@ 
     1398+ This library should be named librtnetlink. 
     1399+  
     1400+ .SH AUTHORS 
     1401+-netlink/rtnetlink was designed and writen by Alexey Kuznetsov. 
     1402++netlink/rtnetlink was designed and written by Alexey Kuznetsov. 
     1403+ Andi Kleen wrote the man page. 
     1404+  
     1405+ .SH SEE ALSO 
     1406--- iproute-20071016.orig/debian/patches/add-metrics.diff 
     1407+++ iproute-20071016/debian/patches/add-metrics.diff 
     1408@@ -0,0 +1,97 @@ 
     1409+#! /bin/sh -e 
     1410+##  
     1411+## All lines beginning with `## DP:' are a description of the patch. 
     1412+## DP: show the \ really, see #285507 
     1413+ 
     1414+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     1415+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     1416+ 
     1417+if [ $# -ne 1 ]; then 
     1418+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     1419+    exit 1 
     1420+fi 
     1421+case "$1" in 
     1422+       -patch) patch $patch_opts -p1 < $0;; 
     1423+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     1424+        *) 
     1425+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     1426+                exit 1;; 
     1427+esac 
     1428+ 
     1429+exit 0 
     1430+@DPATCH@ 
     1431+--- iproute-20010824/ip/iproute.c 
     1432++++ iproute-20010824/ip/iproute.c 
     1433+@@ -57,7 +57,7 @@ 
     1434+       fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n"); 
     1435+       fprintf(stderr, "           [ rtt NUMBER ] [ rttvar NUMBER ]\n"); 
     1436+       fprintf(stderr, "           [ window NUMBER] [ cwnd NUMBER ] [ ssthresh REALM ]\n"); 
     1437+-      fprintf(stderr, "           [ realms REALM ]\n"); 
     1438++      fprintf(stderr, "           [ realms REALM ] [ hoplimit NUMBER ] [ initcwnd NUMBER ]\n"); 
     1439+       fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); 
     1440+       fprintf(stderr, "          unreachable | prohibit | blackhole | nat ]\n"); 
     1441+       fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); 
     1442+@@ -481,6 +481,8 @@ 
     1443+                               "cwnd", 
     1444+                               "advmss", 
     1445+                               "reordering", 
     1446++                              "hoplimit", 
     1447++                              "initcwnd", 
     1448+                       }; 
     1449+                       static int hz; 
     1450+                       if (mxrta[i] == NULL) 
     1451+@@ -750,6 +752,30 @@ 
     1452+                               invarg("\"reordering\" value is invalid\n", *argv); 
     1453+                       rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord); 
     1454+ #endif 
     1455++#ifdef RTAX_HOPLIMIT 
     1456++              } else if (strcmp(*argv, "hoplimit") == 0) { 
     1457++                      unsigned hoplim; 
     1458++                      NEXT_ARG(); 
     1459++                      if (strcmp(*argv, "lock") == 0) { 
     1460++                              mxlock |= (1<<RTAX_HOPLIMIT); 
     1461++                              NEXT_ARG(); 
     1462++                      } 
     1463++                      if (get_unsigned(&hoplim, *argv, 0)) 
     1464++                              invarg("\"hoplimit\" value is invalid\n", *argv); 
     1465++                      rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplim); 
     1466++#endif 
     1467++#ifdef RTAX_INITCWND 
     1468++              } else if (strcmp(*argv, "initcwnd") == 0) { 
     1469++                      unsigned initcwnd; 
     1470++                      NEXT_ARG(); 
     1471++                      if (strcmp(*argv, "lock") == 0) { 
     1472++                              mxlock |= (1<<RTAX_HOPLIMIT); 
     1473++                              NEXT_ARG(); 
     1474++                      } 
     1475++                      if (get_unsigned(&initcwnd, *argv, 0)) 
     1476++                              invarg("\"initcwnd\" value is invalid\n", *argv); 
     1477++                      rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, initcwnd); 
     1478++#endif 
     1479+               } else if (strcmp(*argv, "rtt") == 0) { 
     1480+                       unsigned rtt; 
     1481+                       NEXT_ARG(); 
     1482+--- iproute-20010824.orig/doc/ip-cref.tex 
     1483++++ iproute-20010824/doc/ip-cref.tex 
     1484+@@ -1324,2 +1324,15 @@ 
     1485+  
     1486++\item \verb|hoplimit NUMBER| 
     1487++ 
     1488++--- [2.5.74+ only] Hop limit on the path to this destination. If it is not 
     1489++    given, Linux uses the value selected with \verb|sysctl| variable 
     1490++    \verb|net/ipv4/ip_default_ttl|. 
     1491++ 
     1492++\item \verb|initcwnd NUMBER| 
     1493++ 
     1494++--- [2.5.70+ only] Initial congestion window size when establishing 
     1495++    connections to this destination. This value is multiplied with the 
     1496++    MSS (``Maximal Segment Size'') for the connection to get the actual 
     1497++    window size. If it is not given (or set to zero), Linux uses the 
     1498++    values specified in~\cite{RFC2414}. 
     1499+  
     1500+@@ -2653,2 +2666,5 @@ 
     1501+  
     1502++\bibitem{RFC2414}  M.~Allman, S.~Floyd, C.~Partridge. 
     1503++``Increasing TCP's Initial Window'', RFC-2414. 
     1504++ 
     1505+ \end{thebibliography} 
     1506--- iproute-20071016.orig/debian/patches/esfq-support.dpatch 
     1507+++ iproute-20071016/debian/patches/esfq-support.dpatch 
     1508@@ -0,0 +1,284 @@ 
     1509+#! /bin/sh /usr/share/dpatch/dpatch-run 
     1510+## esfq-support.dpatch by Alexander Wirt <formorer@debian.org> 
     1511+## 
     1512+## All lines beginning with `## DP:' are a description of the patch. 
     1513+## DP: No description. 
     1514+ 
     1515+@DPATCH@ 
     1516+diff -urNad iproute-20060323~/tc/Makefile iproute-20060323/tc/Makefile 
     1517+--- iproute-20060323~/tc/Makefile      2006-09-08 18:57:26.000000000 +0200 
     1518++++ iproute-20060323/tc/Makefile       2006-09-08 18:57:54.000000000 +0200 
     1519+@@ -7,6 +7,7 @@ 
     1520+ TCMODULES := 
     1521+ TCMODULES += q_fifo.o 
     1522+ TCMODULES += q_sfq.o 
     1523++TCMODULES += q_esfq.o 
     1524+ TCMODULES += q_red.o 
     1525+ TCMODULES += q_prio.o 
     1526+ TCMODULES += q_tbf.o 
     1527+diff -urNad iproute-20060323~/tc/Makefile.orig iproute-20060323/tc/Makefile.orig 
     1528+--- iproute-20060323~/tc/Makefile.orig 1970-01-01 01:00:00.000000000 +0100 
     1529++++ iproute-20060323/tc/Makefile.orig  2006-09-08 18:57:26.000000000 +0200 
     1530+@@ -0,0 +1,89 @@ 
     1531++TCOBJ= tc.o tc_qdisc.o tc_class.o tc_filter.o tc_util.o \ 
     1532++       m_police.o m_estimator.o m_action.o m_ematch.o \ 
     1533++       emp_ematch.yacc.o emp_ematch.lex.o 
     1534++ 
     1535++include ../Config 
     1536++ 
     1537++TCMODULES := 
     1538++TCMODULES += q_fifo.o 
     1539++TCMODULES += q_sfq.o 
     1540++TCMODULES += q_red.o 
     1541++TCMODULES += q_prio.o 
     1542++TCMODULES += q_tbf.o 
     1543++TCMODULES += q_cbq.o 
     1544++TCMODULES += f_rsvp.o 
     1545++TCMODULES += f_u32.o 
     1546++TCMODULES += f_route.o 
     1547++TCMODULES += f_fw.o 
     1548++TCMODULES += f_basic.o 
     1549++TCMODULES += q_dsmark.o 
     1550++TCMODULES += q_gred.o 
     1551++TCMODULES += f_tcindex.o 
     1552++TCMODULES += q_ingress.o 
     1553++TCMODULES += q_hfsc.o 
     1554++TCMODULES += q_htb.o 
     1555++TCMODULES += m_gact.o 
     1556++TCMODULES += m_mirred.o 
     1557++TCMODULES += m_ipt.o 
     1558++TCMODULES += m_pedit.o 
     1559++TCMODULES += p_ip.o 
     1560++TCMODULES += p_icmp.o 
     1561++TCMODULES += p_tcp.o 
     1562++TCMODULES += p_udp.o 
     1563++TCMODULES += em_nbyte.o 
     1564++TCMODULES += em_cmp.o 
     1565++TCMODULES += em_u32.o 
     1566++TCMODULES += em_meta.o 
     1567++ 
     1568++TCOBJ += $(TCMODULES) 
     1569++ 
     1570++TCLIB := tc_core.o 
     1571++TCLIB += tc_red.o 
     1572++TCLIB += tc_cbq.o 
     1573++TCLIB += tc_estimator.o 
     1574++ 
     1575++CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB 
     1576++ 
     1577++TCSO := 
     1578++TCSO += q_netem.so 
     1579++ifeq ($(TC_CONFIG_ATM),y) 
     1580++  TCSO += q_atm.so 
     1581++endif 
     1582++ 
     1583++LDLIBS += -L. -ltc -lm -ldl 
     1584++ 
     1585++LDFLAGS += -Wl,-export-dynamic 
     1586++ 
     1587++YACC := bison 
     1588++LEX := flex 
     1589++ 
     1590++%.so: %.c 
     1591++      $(CC) $(CFLAGS) -shared -fpic $< -o $@ 
     1592++ 
     1593++ 
     1594++all: libtc.a tc $(TCSO) 
     1595++ 
     1596++tc: $(TCOBJ) $(LIBNETLINK) $(LIBUTIL) $(TCLIB) 
     1597++ 
     1598++libtc.a: $(TCLIB) 
     1599++      $(AR) rcs $@ $(TCLIB) 
     1600++ 
     1601++install: all 
     1602++      mkdir -p $(DESTDIR)/usr/lib/tc 
     1603++      install -m 0755 -s tc $(DESTDIR)$(SBINDIR) 
     1604++      for i in $(TCSO); \ 
     1605++      do install -m 755 -s $$i $(DESTDIR)/usr/lib/tc; \ 
     1606++      done 
     1607++ 
     1608++clean: 
     1609++      rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \ 
     1610++      rm -f emp_ematch.yacc.output 
     1611++ 
     1612++q_atm.so: q_atm.c 
     1613++      $(CC) $(CFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm 
     1614++ 
     1615++%.yacc.c: %.y 
     1616++      $(YACC) $(YACCFLAGS) -o $@ $< 
     1617++ 
     1618++%.lex.c: %.l 
     1619++      $(LEX) $(LEXFLAGS) -o$@ $< 
     1620+diff -urNad iproute-20060323~/tc/q_esfq.c iproute-20060323/tc/q_esfq.c 
     1621+--- iproute-20060323~/tc/q_esfq.c      1970-01-01 01:00:00.000000000 +0100 
     1622++++ iproute-20060323/tc/q_esfq.c       2006-09-08 18:57:54.000000000 +0200 
     1623+@@ -0,0 +1,169 @@ 
     1624++/* 
     1625++ * q_esfq.c           ESFQ. 
     1626++ * 
     1627++ *            This program is free software; you can redistribute it and/or 
     1628++ *            modify it under the terms of the GNU General Public License 
     1629++ *            as published by the Free Software Foundation; either version 
     1630++ *            2 of the License, or (at your option) any later version. 
     1631++ * 
     1632++ * Authors:   Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 
     1633++ * 
     1634++ * Changes:   Alexander Atanasov, <alex@ssi.bg> 
     1635++ *            Added depth,limit,divisor,hash_kind options. 
     1636++ */ 
     1637++ 
     1638++#include <stdio.h> 
     1639++#include <stdlib.h> 
     1640++#include <unistd.h> 
     1641++#include <syslog.h> 
     1642++#include <fcntl.h> 
     1643++#include <math.h>  
     1644++#include <sys/socket.h> 
     1645++#include <netinet/in.h> 
     1646++#include <arpa/inet.h> 
     1647++#include <string.h> 
     1648++ 
     1649++#include "utils.h" 
     1650++#include "tc_util.h" 
     1651++ 
     1652++static void explain(void) 
     1653++{ 
     1654++      fprintf(stderr, "Usage: ... esfq [ perturb SECS ] [ quantum BYTES ] [ depth FLOWS ]\n\t[ divisor HASHBITS ] [ limit PKTS ] [ hash HASHTYPE]\n"); 
     1655++      fprintf(stderr,"Where: \n"); 
     1656++      fprintf(stderr,"HASHTYPE := { classic | src | dst }\n"); 
     1657++} 
     1658++ 
     1659++#define usage() return(-1) 
     1660++ 
     1661++static int esfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) 
     1662++{ 
     1663++      int ok=0; 
     1664++      struct tc_sfq_qopt opt; 
     1665++ 
     1666++      memset(&opt, 0, sizeof(opt)); 
     1667++ 
     1668++      opt.hash_kind= TCA_SFQ_HASH_CLASSIC; 
     1669++       
     1670++      while (argc > 0) { 
     1671++              if (strcmp(*argv, "quantum") == 0) { 
     1672++                      NEXT_ARG(); 
     1673++                      if (get_size(&opt.quantum, *argv)) { 
     1674++                              fprintf(stderr, "Illegal \"quantum\"\n"); 
     1675++                              return -1; 
     1676++                      } 
     1677++                      ok++; 
     1678++              } else if (strcmp(*argv, "perturb") == 0) { 
     1679++                      NEXT_ARG(); 
     1680++                      if (get_integer(&opt.perturb_period, *argv, 0)) { 
     1681++                              fprintf(stderr, "Illegal \"perturb\"\n"); 
     1682++                              return -1; 
     1683++                      } 
     1684++                      ok++; 
     1685++              } else if (strcmp(*argv, "depth") == 0) { 
     1686++                      NEXT_ARG(); 
     1687++                      if (get_integer(&opt.flows, *argv, 0)) { 
     1688++                              fprintf(stderr, "Illegal \"depth\"\n"); 
     1689++                              return -1; 
     1690++                      } 
     1691++                      ok++; 
     1692++              } else if (strcmp(*argv, "divisor") == 0) { 
     1693++                      NEXT_ARG(); 
     1694++                      if (get_integer(&opt.divisor, *argv, 0)) { 
     1695++                              fprintf(stderr, "Illegal \"divisor\"\n"); 
     1696++                              return -1; 
     1697++                      } 
     1698++                      if(opt.divisor >= 15) { 
     1699++                              fprintf(stderr, "Illegal \"divisor\" must be < 15\n"); 
     1700++                              return -1; 
     1701++                      } 
     1702++                      opt.divisor=pow(2,opt.divisor); 
     1703++                      ok++; 
     1704++              } else if (strcmp(*argv, "limit") == 0) { 
     1705++                      NEXT_ARG(); 
     1706++                      if (get_integer(&opt.limit, *argv, 0)) { 
     1707++                              fprintf(stderr, "Illegal \"limit\"\n"); 
     1708++                              return -1; 
     1709++                      } 
     1710++                      ok++; 
     1711++              } else if (strcmp(*argv, "hash") == 0) { 
     1712++                      NEXT_ARG(); 
     1713++                      if(strcmp(*argv,"classic") == 0) { 
     1714++                              opt.hash_kind= TCA_SFQ_HASH_CLASSIC; 
     1715++                      } else  
     1716++                      if(strcmp(*argv,"dst") == 0) { 
     1717++                              opt.hash_kind= TCA_SFQ_HASH_DST; 
     1718++                      } else 
     1719++                      if(strcmp(*argv,"src") == 0) { 
     1720++                              opt.hash_kind= TCA_SFQ_HASH_SRC; 
     1721++                      } else { 
     1722++                              fprintf(stderr, "Illegal \"hash\"\n"); 
     1723++                              explain(); 
     1724++                              return -1; 
     1725++                      } 
     1726++                      ok++; 
     1727++              } else if (strcmp(*argv, "help") == 0) { 
     1728++                      explain(); 
     1729++                      return -1; 
     1730++              } else { 
     1731++                      fprintf(stderr, "What is \"%s\"?\n", *argv); 
     1732++                      explain(); 
     1733++                      return -1; 
     1734++              } 
     1735++              argc--; argv++; 
     1736++      } 
     1737++ 
     1738++      if (ok) 
     1739++              addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
     1740++      return 0; 
     1741++} 
     1742++ 
     1743++static int esfq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) 
     1744++{ 
     1745++      struct tc_sfq_qopt *qopt; 
     1746++      SPRINT_BUF(b1); 
     1747++ 
     1748++      if (opt == NULL) 
     1749++              return 0; 
     1750++ 
     1751++      if (RTA_PAYLOAD(opt)  < sizeof(*qopt)) 
     1752++              return -1; 
     1753++      qopt = RTA_DATA(opt); 
     1754++      fprintf(f, "quantum %s ", sprint_size(qopt->quantum, b1)); 
     1755++      if (show_details) { 
     1756++              fprintf(f, "limit %up flows %u/%u ", 
     1757++                      qopt->limit, qopt->flows, qopt->divisor); 
     1758++      } 
     1759++      if (qopt->perturb_period) 
     1760++              fprintf(f, "perturb %dsec ", qopt->perturb_period); 
     1761++ 
     1762++              fprintf(f,"hash: "); 
     1763++      switch(qopt->hash_kind) 
     1764++      { 
     1765++      case TCA_SFQ_HASH_CLASSIC: 
     1766++              fprintf(f,"classic"); 
     1767++              break; 
     1768++      case TCA_SFQ_HASH_DST: 
     1769++              fprintf(f,"dst"); 
     1770++              break; 
     1771++      case TCA_SFQ_HASH_SRC: 
     1772++              fprintf(f,"src"); 
     1773++              break; 
     1774++      default: 
     1775++              fprintf(f,"Unknown"); 
     1776++      } 
     1777++      return 0; 
     1778++} 
     1779++ 
     1780++static int esfq_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) 
     1781++{ 
     1782++      return 0; 
     1783++} 
     1784++ 
     1785++ 
     1786++struct qdisc_util esfq_util = { 
     1787++      NULL, 
     1788++      "esfq", 
     1789++      esfq_parse_opt, 
     1790++      esfq_print_opt, 
     1791++      esfq_print_xstats, 
     1792++}; 
     1793--- iproute-20071016.orig/debian/patches/wrr-qdisc.dpatch 
     1794+++ iproute-20071016/debian/patches/wrr-qdisc.dpatch 
     1795@@ -0,0 +1,479 @@ 
     1796+#! /bin/sh -e 
     1797+##  
     1798+## All lines beginning with `## DP:' are a description of the patch. 
     1799+## DP: add the wrr qdisc scheduler, see #198414 
     1800+ 
     1801+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     1802+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     1803+ 
     1804+if [ $# -ne 1 ]; then 
     1805+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     1806+    exit 1 
     1807+fi 
     1808+case "$1" in 
     1809+       -patch) patch $patch_opts -p1 < $0;; 
     1810+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     1811+        *) 
     1812+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     1813+                exit 1;; 
     1814+esac 
     1815+ 
     1816+exit 0 
     1817+@DPATCH@ 
     1818+diff -urNad pkg-iproute~/include/linux/pkt_sched.h pkg-iproute/include/linux/pkt_sched.h 
     1819+--- pkg-iproute~/include/linux/pkt_sched.h     2007-10-24 16:36:41.000000000 +0200 
     1820++++ pkg-iproute/include/linux/pkt_sched.h      2007-10-24 16:36:56.000000000 +0200 
     1821+@@ -475,4 +475,116 @@ 
     1822+  
     1823+ #define NETEM_DIST_SCALE      8192 
     1824+  
     1825++/* WRR section */ 
     1826++ 
     1827++/* Other includes */ 
     1828++#include <linux/if_ether.h> 
     1829++ 
     1830++// A sub weight and of a class 
     1831++// All numbers are represented as parts of (2^64-1). 
     1832++struct tc_wrr_class_weight { 
     1833++      __u64 val;      // Current value                        (0 is not valid) 
     1834++      __u64 decr;     // Value pr bytes                       (2^64-1 is not valid) 
     1835++      __u64 incr;     // Value pr seconds                     (2^64-1 is not valid) 
     1836++      __u64 min;      // Minimal value                        (0 is not valid) 
     1837++      __u64 max;      // Minimal value                        (0 is not valid) 
     1838++ 
     1839++// The time where the above information was correct: 
     1840++      time_t tim; 
     1841++}; 
     1842++ 
     1843++// Packet send when modifying a class: 
     1844++struct tc_wrr_class_modf { 
     1845++      // Not-valid values are ignored. 
     1846++      struct tc_wrr_class_weight weight1; 
     1847++      struct tc_wrr_class_weight weight2; 
     1848++}; 
     1849++ 
     1850++// Packet returned when quering a class: 
     1851++struct tc_wrr_class_stats { 
     1852++      char used;      // If this is false the information below is invalid 
     1853++ 
     1854++      struct tc_wrr_class_modf class_modf; 
     1855++ 
     1856++      unsigned char addr[ETH_ALEN]; 
     1857++      char usemac;    // True if addr is a MAC address, else it is an IP address 
     1858++                      // (this value is only for convience, it is always the same 
     1859++                      //  value as in the qdisc) 
     1860++      int heappos;    // Current heap position or 0 if not in heap 
     1861++      __u64 penal_ls; // Penalty value in heap (ls) 
     1862++      __u64 penal_ms; // Penalty value in heap (ms) 
     1863++}; 
     1864++ 
     1865++// Qdisc-wide penalty information (boolean values - 2 not valid) 
     1866++struct tc_wrr_qdisc_weight { 
     1867++      char weight_mode;       // 0=No automatic change to weight 
     1868++                              // 1=Decrease normally 
     1869++                              // 2=Also multiply with number of machines 
     1870++                              // 3=Instead multiply with priority divided 
     1871++                              //   with priority of the other. 
     1872++                              // -1=no change 
     1873++}; 
     1874++ 
     1875++// Packet send when modifing a qdisc: 
     1876++struct tc_wrr_qdisc_modf { 
     1877++      // Not-valid values are ignored: 
     1878++      struct tc_wrr_qdisc_weight weight1; 
     1879++      struct tc_wrr_qdisc_weight weight2; 
     1880++}; 
     1881++ 
     1882++// Packet send when creating a qdisc: 
     1883++struct tc_wrr_qdisc_crt { 
     1884++      struct tc_wrr_qdisc_modf qdisc_modf; 
     1885++ 
     1886++      char srcaddr;   // 1=lookup source, 0=lookup destination 
     1887++      char usemac;    // 1=Classify on MAC addresses, 0=classify on IP 
     1888++      char usemasq;   // 1=Classify based on masqgrading - only valid 
     1889++                      //   if usemac is zero 
     1890++      int bands_max;  // Maximal number of bands (i.e.: classes) 
     1891++      int proxy_maxconn;// If differnt from 0 then we support proxy remapping 
     1892++                      // of packets. And this is the number of maximal 
     1893++                      // concurrent proxy connections. 
     1894++}; 
     1895++ 
     1896++// Packet returned when quering a qdisc: 
     1897++struct tc_wrr_qdisc_stats { 
     1898++      struct tc_wrr_qdisc_crt qdisc_crt; 
     1899++      int proxy_curconn; 
     1900++      int nodes_in_heap;      // Current number of bands wanting to send something 
     1901++      int bands_cur;          // Current number of bands used (i.e.: MAC/IP addresses seen) 
     1902++      int bands_reused;       // Number of times this band has been reused. 
     1903++      int packets_requed;     // Number of times packets have been requeued. 
     1904++      __u64 priosum;          // Sum of priorities in heap where 1 is 2^32 
     1905++}; 
     1906++ 
     1907++struct tc_wrr_qdisc_modf_std { 
     1908++      // This indicates which of the tc_wrr_qdisc_modf structers this is: 
     1909++      char proxy; // 0=This struct 
     1910++ 
     1911++      // Should we also change a class? 
     1912++      char change_class; 
     1913++ 
     1914++      // Only valid if change_class is false 
     1915++      struct tc_wrr_qdisc_modf qdisc_modf; 
     1916++ 
     1917++      // Only valid if change_class is true: 
     1918++      unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0) 
     1919++      struct tc_wrr_class_modf class_modf; // The change 
     1920++}; 
     1921++ 
     1922++// Used for proxyrempping: 
     1923++struct tc_wrr_qdisc_modf_proxy { 
     1924++      // This indicates which of the tc_wrr_qdisc_modf structers this is: 
     1925++      char proxy;     // 1=This struct 
     1926++ 
     1927++      // This is 1 if the proxyremap information should be reset 
     1928++      char reset; 
     1929++ 
     1930++      // changec is the number of elements in changes. 
     1931++      int changec; 
     1932++ 
     1933++      // This is an array of type ProxyRemapBlock: 
     1934++      long changes[0]; 
     1935++}; 
     1936++ 
     1937+ #endif 
     1938+diff -urNad pkg-iproute~/tc/Makefile pkg-iproute/tc/Makefile 
     1939+--- pkg-iproute~/tc/Makefile   2007-10-24 16:36:12.000000000 +0200 
     1940++++ pkg-iproute/tc/Makefile    2007-10-24 16:37:24.000000000 +0200 
     1941+@@ -11,6 +11,7 @@ 
     1942+ TCMODULES += q_prio.o 
     1943+ TCMODULES += q_tbf.o 
     1944+ TCMODULES += q_cbq.o 
     1945++TCMODULES += q_wrr.o 
     1946+ TCMODULES += q_rr.o 
     1947+ TCMODULES += q_netem.o 
     1948+ TCMODULES += f_rsvp.o 
     1949+diff -urNad pkg-iproute~/tc/q_wrr.c pkg-iproute/tc/q_wrr.c 
     1950+--- pkg-iproute~/tc/q_wrr.c    1970-01-01 01:00:00.000000000 +0100 
     1951++++ pkg-iproute/tc/q_wrr.c     2007-10-24 16:36:56.000000000 +0200 
     1952+@@ -0,0 +1,322 @@ 
     1953++#include <stdio.h> 
     1954++#include <stdlib.h> 
     1955++#include <unistd.h> 
     1956++#include <syslog.h> 
     1957++#include <fcntl.h> 
     1958++#include <sys/socket.h> 
     1959++#include <netinet/in.h> 
     1960++#include <arpa/inet.h> 
     1961++#include <string.h> 
     1962++#include <math.h> 
     1963++ 
     1964++#include "utils.h" 
     1965++#include "tc_util.h" 
     1966++ 
     1967++#define usage() return(-1) 
     1968++ 
     1969++// Returns -1 on error 
     1970++static int wrr_parse_qdisc_weight(int argc, char** argv,  
     1971++                              struct tc_wrr_qdisc_modf* opt) { 
     1972++  int i; 
     1973++   
     1974++  opt->weight1.weight_mode=-1; 
     1975++  opt->weight2.weight_mode=-1; 
     1976++   
     1977++  for(i=0; i<argc; i++) {   
     1978++    if(!memcmp(argv[i],"wmode1=",7)) { 
     1979++      opt->weight1.weight_mode=atoi(argv[i]+7);             
     1980++    } else if(!memcmp(argv[i],"wmode2=",7)) { 
     1981++      opt->weight2.weight_mode=atoi(argv[i]+7); 
     1982++    } else { 
     1983++      printf("Usage: ... [wmode1=0|1|2|3] [wmode2=0|1|2|3]\n"); 
     1984++      return -1; 
     1985++    } 
     1986++  } 
     1987++  return 0; 
     1988++} 
     1989++ 
     1990++static int wrr_parse_class_modf(int argc, char** argv,  
     1991++                                struct tc_wrr_class_modf* modf) { 
     1992++  int i; 
     1993++   
     1994++  if(argc<1) { 
     1995++    fprintf(stderr, "Usage: ... [weight1=val] [decr1=val] [incr1=val] [min1=val] [max1=val] [val2=val] ...\n"); 
     1996++    fprintf(stderr, "  The values can be floating point like 0.42 or divisions like 42/100\n"); 
     1997++    return -1; 
     1998++  } 
     1999++   
     2000++  // Set meaningless values: 
     2001++  modf->weight1.val=0; 
     2002++  modf->weight1.decr=(__u64)-1; 
     2003++  modf->weight1.incr=(__u64)-1; 
     2004++  modf->weight1.min=0; 
     2005++  modf->weight1.max=0; 
     2006++  modf->weight2.val=0; 
     2007++  modf->weight2.decr=(__u64)-1; 
     2008++  modf->weight2.incr=(__u64)-1; 
     2009++  modf->weight2.min=0; 
     2010++  modf->weight2.max=0; 
     2011++   
     2012++  // And read values: 
     2013++  for(i=0; i<argc; i++) { 
     2014++    char arg[80]; 
     2015++    char* name,*value1=0,*value2=0; 
     2016++    long double f_val1,f_val2=1,value; 
     2017++    if(strlen(argv[i])>=sizeof(arg)) { 
     2018++      fprintf(stderr,"Argument too long: %s\n",argv[i]); 
     2019++      return -1; 
     2020++    } 
     2021++    strcpy(arg,argv[i]); 
     2022++     
     2023++    name=strtok(arg,"="); 
     2024++    if(name) value1=strtok(0,"/"); 
     2025++    if(value1) value2=strtok(0,""); 
     2026++     
     2027++    if(!value1) { 
     2028++      fprintf(stderr,"No = found in argument: %s\n",argv[i]); 
     2029++      return -1; 
     2030++    } 
     2031++     
     2032++    f_val1=atof(value1); 
     2033++    if(value2) f_val2=atof(value2);     
     2034++     
     2035++    if(f_val2==0)  { 
     2036++      fprintf(stderr,"Division by 0\n"); 
     2037++      return -1; 
     2038++    } 
     2039++         
     2040++    value=f_val1/f_val2;     
     2041++    if(value>1) value=1; 
     2042++    if(value<0) value=0;             
     2043++    value*=((__u64)-1); 
     2044++     
     2045++    // And find the value set 
     2046++    if(!strcmp(name,"weight1"))    modf->weight1.val=value; 
     2047++    else if(!strcmp(name,"decr1")) modf->weight1.decr=value; 
     2048++    else if(!strcmp(name,"incr1")) modf->weight1.incr=value; 
     2049++    else if(!strcmp(name,"min1"))  modf->weight1.min=value; 
     2050++    else if(!strcmp(name,"max1"))  modf->weight1.max=value; 
     2051++    else if(!strcmp(name,"weight2")) modf->weight2.val=value; 
     2052++    else if(!strcmp(name,"decr2")) modf->weight2.decr=value; 
     2053++    else if(!strcmp(name,"incr2")) modf->weight2.incr=value; 
     2054++    else if(!strcmp(name,"min2"))  modf->weight2.min=value; 
     2055++    else if(!strcmp(name,"max2"))  modf->weight2.max=value; 
     2056++    else { 
     2057++      fprintf(stderr,"illegal value: %s\n",name); 
     2058++      return -1; 
     2059++    } 
     2060++  }     
     2061++ 
     2062++  return 0; 
     2063++} 
     2064++ 
     2065++static int wrr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) 
     2066++{ 
     2067++  if(n->nlmsg_flags & NLM_F_CREATE) { 
     2068++    // This is a create request: 
     2069++    struct tc_wrr_qdisc_crt opt; 
     2070++       
     2071++    int sour,dest,ip,mac,masq; 
     2072++ 
     2073++    if(argc<4) { 
     2074++      fprintf(stderr, "Usage: ... wrr sour|dest ip|masq|mac maxclasses proxymaxcon [penalty-setup]\n"); 
     2075++      return -1; 
     2076++    }    
     2077++   
     2078++    // Read sour/dest: 
     2079++    memset(&opt,0,sizeof(opt)); 
     2080++    sour=!strcmp(argv[0],"sour"); 
     2081++    dest=!strcmp(argv[0],"dest");      
     2082++       
     2083++    if(!sour && !dest) { 
     2084++      fprintf(stderr,"sour or dest must be specified\n"); 
     2085++      return -1; 
     2086++    }  
     2087++ 
     2088++    // Read ip/mac 
     2089++    ip=!strcmp(argv[1],"ip"); 
     2090++    mac=!strcmp(argv[1],"mac");        
     2091++    masq=!strcmp(argv[1],"masq");      
     2092++ 
     2093++    if(!ip && !mac && !masq) { 
     2094++      fprintf(stderr,"ip, masq or mac must be specified\n"); 
     2095++      return -1; 
     2096++    }  
     2097++ 
     2098++    opt.srcaddr=sour;          
     2099++    opt.usemac=mac; 
     2100++    opt.usemasq=masq;          
     2101++    opt.bands_max=atoi(argv[2]); 
     2102++     
     2103++    opt.proxy_maxconn=atoi(argv[3]); 
     2104++     
     2105++    // Read weights: 
     2106++    if(wrr_parse_qdisc_weight(argc-4,argv+4,&opt.qdisc_modf)<0) return -1; 
     2107++    if(opt.qdisc_modf.weight1.weight_mode==-1) opt.qdisc_modf.weight1.weight_mode=0; 
     2108++    if(opt.qdisc_modf.weight2.weight_mode==-1) opt.qdisc_modf.weight2.weight_mode=0; 
     2109++               
     2110++    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
     2111++  } else { 
     2112++    struct tc_wrr_qdisc_modf_std opt; 
     2113++    char qdisc,class; 
     2114++     
     2115++    // This is a modify request: 
     2116++    if(argc<1) { 
     2117++      fprintf(stderr,"... qdisc ... or ... class ...\n"); 
     2118++      return -1; 
     2119++    } 
     2120++             
     2121++    qdisc=!strcmp(argv[0],"qdisc"); 
     2122++    class=!strcmp(argv[0],"class"); 
     2123++ 
     2124++    if(!qdisc && !class) { 
     2125++      fprintf(stderr,"qdisc or class must be specified\n"); 
     2126++      return -1; 
     2127++    } 
     2128++       
     2129++    argc--; 
     2130++    argv++; 
     2131++       
     2132++    opt.proxy=0; 
     2133++     
     2134++    if(qdisc) { 
     2135++      opt.change_class=0; 
     2136++      if(wrr_parse_qdisc_weight(argc, argv, &opt.qdisc_modf)<0) return -1; 
     2137++    } else { 
     2138++      int a0,a1,a2,a3,a4=0,a5=0;       
     2139++ 
     2140++      opt.change_class=1; 
     2141++       
     2142++      if(argc<1) { 
     2143++        fprintf(stderr,"... <mac>|<ip>|<masq> ...\n"); 
     2144++        return -1; 
     2145++      } 
     2146++      memset(opt.addr,0,sizeof(opt.addr)); 
     2147++ 
     2148++      if((sscanf(argv[0],"%i.%i.%i.%i",&a0,&a1,&a2,&a3)!=4) && 
     2149++         (sscanf(argv[0],"%x:%x:%x:%x:%x:%x",&a0,&a1,&a2,&a3,&a4,&a5)!=6)) { 
     2150++      fprintf(stderr,"Wrong format of mac or ip address\n"); 
     2151++      return -1; 
     2152++      } 
     2153++       
     2154++      opt.addr[0]=a0; opt.addr[1]=a1; opt.addr[2]=a2; 
     2155++      opt.addr[3]=a3; opt.addr[4]=a4; opt.addr[5]=a5; 
     2156++ 
     2157++      if(wrr_parse_class_modf(argc-1, argv+1, &opt.class_modf)<0) return -1; 
     2158++    }   
     2159++   
     2160++    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
     2161++  } 
     2162++  return 0; 
     2163++} 
     2164++ 
     2165++static int wrr_parse_copt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) { 
     2166++  struct tc_wrr_class_modf opt; 
     2167++   
     2168++  memset(&opt,0,sizeof(opt)); 
     2169++  if(wrr_parse_class_modf(argc,argv,&opt)<0) return -1; 
     2170++   
     2171++  addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
     2172++  return 0;   
     2173++}   
     2174++ 
     2175++static int wrr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) 
     2176++{ 
     2177++      struct tc_wrr_qdisc_stats *qopt; 
     2178++ 
     2179++      if (opt == NULL) 
     2180++              return 0; 
     2181++ 
     2182++      if (RTA_PAYLOAD(opt)  < sizeof(*qopt)) 
     2183++              return -1; 
     2184++      qopt = RTA_DATA(opt); 
     2185++       
     2186++      fprintf(f,"\n  (%s/%s) (maxclasses %i) (usedclasses %i) (reused classes %i)\n", 
     2187++        qopt->qdisc_crt.srcaddr ? "sour" : "dest", 
     2188++        qopt->qdisc_crt.usemac  ? "mac"  : (qopt->qdisc_crt.usemasq ? "masq" : "ip"),    
     2189++        qopt->qdisc_crt.bands_max,                       
     2190++        qopt->bands_cur, 
     2191++        qopt->bands_reused 
     2192++        ); 
     2193++         
     2194++      if(qopt->qdisc_crt.proxy_maxconn) { 
     2195++        fprintf(f,"  (proxy maxcon %i) (proxy curcon %i)\n", 
     2196++          qopt->qdisc_crt.proxy_maxconn,qopt->proxy_curconn); 
     2197++      } 
     2198++       
     2199++      fprintf(f,"  (waiting classes %i) (packets requeued %i) (priosum: %Lg)\n", 
     2200++        qopt->nodes_in_heap, 
     2201++        qopt->packets_requed, 
     2202++        qopt->priosum/((long double)((__u32)-1)) 
     2203++        ); 
     2204++ 
     2205++      fprintf(f,"  (wmode1 %i) (wmode2 %i) \n", 
     2206++        qopt->qdisc_crt.qdisc_modf.weight1.weight_mode, 
     2207++        qopt->qdisc_crt.qdisc_modf.weight2.weight_mode); 
     2208++         
     2209++      return 0; 
     2210++} 
     2211++ 
     2212++static int wrr_print_copt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) { 
     2213++  struct tc_wrr_class_stats *copt; 
     2214++  long double d=(__u64)-1; 
     2215++ 
     2216++  if (opt == NULL) return 0; 
     2217++ 
     2218++  if (RTA_PAYLOAD(opt)  < sizeof(*copt)) 
     2219++    return -1; 
     2220++  copt = RTA_DATA(opt); 
     2221++ 
     2222++  if(!copt->used) { 
     2223++    fprintf(f,"(unused)"); 
     2224++    return 0; 
     2225++  } 
     2226++   
     2227++  if(copt->usemac) { 
     2228++    fprintf(f,"\n  (address: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", 
     2229++      copt->addr[0],copt->addr[1],copt->addr[2], 
     2230++      copt->addr[3],copt->addr[4],copt->addr[5]); 
     2231++  } else {      
     2232++    fprintf(f,"\n  (address: %i.%i.%i.%i)\n",copt->addr[0],copt->addr[1],copt->addr[2],copt->addr[3]); 
     2233++  }     
     2234++   
     2235++  fprintf(f,"  (total weight: %Lg) (current position: %i) (counters: %u %u : %u %u)\n", 
     2236++    (copt->class_modf.weight1.val/d)*(copt->class_modf.weight2.val/d), 
     2237++    copt->heappos, 
     2238++    (unsigned)(copt->penal_ms>>32), 
     2239++    (unsigned)(copt->penal_ms & 0xffffffffU), 
     2240++    (unsigned)(copt->penal_ls>>32), 
     2241++    (unsigned)(copt->penal_ls & 0xffffffffU) 
     2242++    ); 
     2243++     
     2244++  fprintf(f,"  Pars 1: (weight %Lg) (decr: %Lg) (incr: %Lg) (min: %Lg) (max: %Lg)\n", 
     2245++    copt->class_modf.weight1.val/d, 
     2246++    copt->class_modf.weight1.decr/d, 
     2247++    copt->class_modf.weight1.incr/d, 
     2248++    copt->class_modf.weight1.min/d, 
     2249++    copt->class_modf.weight1.max/d); 
     2250++ 
     2251++  fprintf(f,"  Pars 2: (weight %Lg) (decr: %Lg) (incr: %Lg) (min: %Lg) (max: %Lg)", 
     2252++    copt->class_modf.weight2.val/d, 
     2253++    copt->class_modf.weight2.decr/d, 
     2254++    copt->class_modf.weight2.incr/d, 
     2255++    copt->class_modf.weight2.min/d, 
     2256++    copt->class_modf.weight2.max/d); 
     2257++   
     2258++  return 0; 
     2259++} 
     2260++ 
     2261++static int wrr_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) 
     2262++{ 
     2263++      return 0; 
     2264++} 
     2265++ 
     2266++ 
     2267++struct qdisc_util wrr_qdisc_util = { 
     2268++      .id = "wrr", 
     2269++      .parse_qopt = wrr_parse_opt, 
     2270++      .print_qopt = wrr_print_opt, 
     2271++      .print_xstats = wrr_print_xstats, 
     2272++      .parse_copt = wrr_parse_copt, 
     2273++      .print_copt = wrr_print_copt 
     2274++}; 
     2275--- iproute-20071016.orig/debian/patches/remove_tc_filters_reference.dpatch 
     2276+++ iproute-20071016/debian/patches/remove_tc_filters_reference.dpatch 
     2277@@ -0,0 +1,30 @@ 
     2278+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2279+## remove_tc_filters_reference.dpatch by  <formorer@lisa.springfield.lan> 
     2280+## 
     2281+## All lines beginning with `## DP:' are a description of the patch. 
     2282+## DP: No description. 
     2283+ 
     2284+@DPATCH@ 
     2285+diff -urNad iproute-20070313~/man/man8/tc.8 iproute-20070313/man/man8/tc.8 
     2286+--- iproute-20070313~/man/man8/tc.8    2007-06-10 20:22:40.000000000 +0200 
     2287++++ iproute-20070313/man/man8/tc.8     2007-06-10 20:23:16.000000000 +0200 
     2288+@@ -202,8 +202,7 @@ 
     2289+ tc filters 
     2290+ If tc filters are attached to a class, they are consulted first  
     2291+ for relevant instructions. Filters can match on all fields of a packet header,  
     2292+-as well as on the firewall mark applied by ipchains or iptables. See  
     2293+-.BR tc-filters (8). 
     2294++as well as on the firewall mark applied by ipchains or iptables.  
     2295+ .TP 
     2296+ Type of Service 
     2297+ Some qdiscs have built in rules for classifying packets based on the TOS field. 
     2298+@@ -242,8 +241,7 @@ 
     2299+ .TP  
     2300+ FILTERS 
     2301+ Filters have a three part ID, which is only needed when using a hashed 
     2302+-filter hierarchy, for which see 
     2303+-.BR tc-filters (8). 
     2304++filter hierarchy. 
     2305+ .SH UNITS 
     2306+ All parameters accept a floating point number, possibly followed by a unit. 
     2307+ .P 
     2308--- iproute-20071016.orig/debian/patches/tc_sample_fix 
     2309+++ iproute-20071016/debian/patches/tc_sample_fix 
     2310@@ -0,0 +1,33 @@ 
     2311+#! /bin/sh -e 
     2312+##  
     2313+## All lines beginning with `## DP:' are a description of the patch. 
     2314+## DP: Fixes #347699  
     2315+ 
     2316+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     2317+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     2318+ 
     2319+if [ $# -ne 1 ]; then 
     2320+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2321+    exit 1 
     2322+fi 
     2323+case "$1" in 
     2324+       -patch) patch $patch_opts -p1 < $0;; 
     2325+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     2326+        *) 
     2327+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2328+                exit 1;; 
     2329+esac 
     2330+ 
     2331+exit 0 
     2332+@DPATCH@ 
     2333+diff -Nur iproute-20051007.keep/tc/f_u32.c iproute-20051007/tc/f_u32.c 
     2334+--- iproute-20051007.keep/tc/f_u32.c   2005-01-19 08:11:58.000000000 +1000 
     2335++++ iproute-20051007/tc/f_u32.c        2006-01-12 17:12:43.000000000 +1000 
     2336+@@ -878,6 +878,7 @@ 
     2337+                               struct tc_u32_sel sel; 
     2338+                               struct tc_u32_key keys[4]; 
     2339+                       } sel2; 
     2340++                      memset(&sel2, 0, sizeof(sel2)); 
     2341+                       NEXT_ARG(); 
     2342+                       if (parse_selector(&argc, &argv, &sel2.sel, n)) { 
     2343+                               fprintf(stderr, "Illegal \"sample\"\n"); 
     2344--- iproute-20071016.orig/debian/patches/tcb_htb_typo.dpatch 
     2345+++ iproute-20071016/debian/patches/tcb_htb_typo.dpatch 
     2346@@ -0,0 +1,19 @@ 
     2347+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2348+## tcb_htb_typo.dpatch by  <formorer@lisa.springfield.lan> 
     2349+## 
     2350+## All lines beginning with `## DP:' are a description of the patch. 
     2351+## DP: No description. 
     2352+ 
     2353+@DPATCH@ 
     2354+diff -urNad iproute-20070313~/man/man8/tc-htb.8 iproute-20070313/man/man8/tc-htb.8 
     2355+--- iproute-20070313~/man/man8/tc-htb.8        2007-03-13 22:50:56.000000000 +0100 
     2356++++ iproute-20070313/man/man8/tc-htb.8 2007-06-10 19:30:08.000000000 +0200 
     2357+@@ -137,7 +137,7 @@ 
     2358+ .SH NOTES 
     2359+ Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel,  
     2360+ there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick. 
     2361+-From this, the mininum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte  
     2362++From this, the minimum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte  
     2363+ burst as 100*12kb*8 equals 10mbit. 
     2364+  
     2365+ .SH SEE ALSO 
     2366--- iproute-20071016.orig/debian/patches/ip_route_usage.dpatch 
     2367+++ iproute-20071016/debian/patches/ip_route_usage.dpatch 
     2368@@ -0,0 +1,19 @@ 
     2369+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2370+## ip_route_usage.dpatch by Alexander Wirt <formorer@debian.org> 
     2371+## 
     2372+## All lines beginning with `## DP:' are a description of the patch. 
     2373+## DP: No description. 
     2374+ 
     2375+@DPATCH@ 
     2376+diff -urNad pkg-iproute~/ip/iproute.c pkg-iproute/ip/iproute.c 
     2377+--- pkg-iproute~/ip/iproute.c  2007-10-18 14:04:18.000000000 +0200 
     2378++++ pkg-iproute/ip/iproute.c   2007-10-18 14:23:11.000000000 +0200 
     2379+@@ -72,7 +72,7 @@ 
     2380+       fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n"); 
     2381+       fprintf(stderr, "           [ rtt TIME ] [ rttvar TIME ]\n"); 
     2382+       fprintf(stderr, "           [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"); 
     2383+-      fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ]\n"); 
     2384++      fprintf(stderr, "           [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); 
     2385+       fprintf(stderr, "           [ rto_min TIME ]\n"); 
     2386+       fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n"); 
     2387+       fprintf(stderr, "          unreachable | prohibit | blackhole | nat ]\n"); 
     2388--- iproute-20071016.orig/debian/patches/manpages-typo.dpatch 
     2389+++ iproute-20071016/debian/patches/manpages-typo.dpatch 
     2390@@ -0,0 +1,44 @@ 
     2391+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2392+## manpages-typo.dpatch by Alexander Wirt <formorer@debian.org> 
     2393+## 
     2394+## All lines beginning with `## DP:' are a description of the patch. 
     2395+## DP: No description. 
     2396+ 
     2397+@DPATCH@ 
     2398+diff -urNad iproute-20061002~/man/man8/tc-prio.8 iproute-20061002/man/man8/tc-prio.8 
     2399+--- iproute-20061002~/man/man8/tc-prio.8       2006-10-15 17:06:41.000000000 +0200 
     2400++++ iproute-20061002/man/man8/tc-prio.8        2006-10-15 17:10:52.000000000 +0200 
     2401+@@ -30,7 +30,7 @@ 
     2402+ On creation with 'tc qdisc add', a fixed number of bands is created. Each 
     2403+ band is a class, although is not possible to add classes with 'tc qdisc 
     2404+ add', the number of bands to be created must instead be specified on the 
     2405+-commandline attaching PRIO to its root. 
     2406++command line attaching PRIO to its root. 
     2407+  
     2408+ When dequeueing, band 0 is tried first and only if it did not deliver a 
     2409+ packet does PRIO try band 1, and so onwards. Maximum reliability packets 
     2410+@@ -88,7 +88,7 @@ 
     2411+ The four TOS bits (the 'TOS field') are defined as: 
     2412+  
     2413+ .nf 
     2414+-Binary Decimcal  Meaning 
     2415++Binary Decimal  Meaning 
     2416+ ----------------------------------------- 
     2417+ 1000   8         Minimize delay (md) 
     2418+ 0100   4         Maximize throughput (mt) 
     2419+@@ -125,13 +125,13 @@ 
     2420+  
     2421+ The second column contains the value of the relevant 
     2422+ four TOS bits, followed by their translated meaning. For example, 15 stands 
     2423+-for a packet wanting Minimal Montetary Cost, Maximum Reliability, Maximum 
     2424++for a packet wanting Minimal Monetary Cost, Maximum Reliability, Maximum 
     2425+ Throughput AND Minimum Delay.  
     2426+  
     2427+ The fourth column lists the way the Linux kernel interprets the TOS bits, by 
     2428+ showing to which Priority they are mapped. 
     2429+  
     2430+-The last column shows the result of the default priomap. On the commandline, 
     2431++The last column shows the result of the default priomap. On the command line, 
     2432+ the default priomap looks like this: 
     2433+  
     2434+     1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 
     2435--- iproute-20071016.orig/debian/patches/tc_modules.dpatch 
     2436+++ iproute-20071016/debian/patches/tc_modules.dpatch 
     2437@@ -0,0 +1,19 @@ 
     2438+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2439+## tc_modules.dpatch by  <formorer@lisa.springfield.lan> 
     2440+## 
     2441+## All lines beginning with `## DP:' are a description of the patch. 
     2442+## DP: No description. 
     2443+ 
     2444+@DPATCH@ 
     2445+diff -urNad iproute-20070313~/include/iptables.h iproute-20070313/include/iptables.h 
     2446+--- iproute-20070313~/include/iptables.h       2007-03-13 22:50:56.000000000 +0100 
     2447++++ iproute-20070313/include/iptables.h        2007-06-10 17:56:38.000000000 +0200 
     2448+@@ -5,7 +5,7 @@ 
     2449+ #include "libiptc/libiptc.h" 
     2450+  
     2451+ #ifndef IPT_LIB_DIR 
     2452+-#define IPT_LIB_DIR "/usr/local/lib/iptables" 
     2453++#define IPT_LIB_DIR "/lib/iptables" 
     2454+ #endif 
     2455+  
     2456+ #ifndef IPPROTO_SCTP 
     2457--- iproute-20071016.orig/debian/patches/ip_address 
     2458+++ iproute-20071016/debian/patches/ip_address 
     2459@@ -0,0 +1,34 @@ 
     2460+#! /bin/sh -e 
     2461+##  
     2462+## All lines beginning with `## DP:' are a description of the patch. 
     2463+## DP: Removed mentioning of "ip address" in the ip output  
     2464+ 
     2465+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     2466+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     2467+ 
     2468+if [ $# -ne 1 ]; then 
     2469+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2470+    exit 1 
     2471+fi 
     2472+case "$1" in 
     2473+       -patch) patch $patch_opts -p1 < $0;; 
     2474+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     2475+        *) 
     2476+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2477+                exit 1;; 
     2478+esac 
     2479+ 
     2480+exit 0 
     2481+@DPATCH@ 
     2482+diff -ruN iproute-20051007.orig/ip/ipaddress.c iproute-20051007/ip/ipaddress.c 
     2483+--- iproute-20051007.orig/ip/ipaddress.c       2005-09-21 21:33:18.000000000 +0200 
     2484++++ iproute-20051007/ip/ipaddress.c    2006-03-14 07:26:26.830934712 +0100 
     2485+@@ -901,7 +901,7 @@ 
     2486+               return ipaddr_list_or_flush(argc-1, argv+1, 1); 
     2487+       if (matches(*argv, "help") == 0) 
     2488+               usage(); 
     2489+-      fprintf(stderr, "Command \"%s\" is unknown, try \"ip address help\".\n", *argv); 
     2490++      fprintf(stderr, "Command \"%s\" is unknown, try \"ip addr help\".\n", *argv); 
     2491+       exit(-1); 
     2492+ } 
     2493+  
     2494--- iproute-20071016.orig/debian/patches/ip.8-typo 
     2495+++ iproute-20071016/debian/patches/ip.8-typo 
     2496@@ -0,0 +1,33 @@ 
     2497+#! /bin/sh -e 
     2498+##  
     2499+## All lines beginning with `## DP:' are a description of the patch. 
     2500+## DP: show the \ really, see #285507 
     2501+ 
     2502+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     2503+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     2504+ 
     2505+if [ $# -ne 1 ]; then 
     2506+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2507+    exit 1 
     2508+fi 
     2509+case "$1" in 
     2510+       -patch) patch $patch_opts -p1 < $0;; 
     2511+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     2512+        *) 
     2513+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2514+                exit 1;; 
     2515+esac 
     2516+ 
     2517+exit 0 
     2518+@DPATCH@ 
     2519+--- orig/man/man8/ip.8 2004-10-19 20:49:02.000000000 +0000 
     2520++++ new/man/man8/ip.8  2005-01-05 22:04:12.000000000 +0000 
     2521+@@ -374,7 +374,7 @@ 
     2522+ .BR "\-o" , " \-oneline" 
     2523+ output each record on a single line, replacing line feeds 
     2524+ with the 
     2525+-.B '\' 
     2526++.B '\e\' 
     2527+ character. This is convenient when you want to count records  
     2528+ with 
     2529+ .BR wc (1) 
     2530--- iproute-20071016.orig/debian/patches/f_u32 
     2531+++ iproute-20071016/debian/patches/f_u32 
     2532@@ -0,0 +1,63 @@ 
     2533+#! /bin/sh -e 
     2534+##  
     2535+## All lines beginning with `## DP:' are a description of the patch. 
     2536+## DP: Fixes the u32 calculation for 2.6 kernel - by Russell Stuart <russell-debian@stuart.id.au>  
     2537+ 
     2538+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     2539+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     2540+ 
     2541+if [ $# -ne 1 ]; then 
     2542+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2543+    exit 1 
     2544+fi 
     2545+case "$1" in 
     2546+       -patch) patch $patch_opts -p1 < $0;; 
     2547+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     2548+        *) 
     2549+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2550+                exit 1;; 
     2551+esac 
     2552+ 
     2553+exit 0 
     2554+@DPATCH@ 
     2555+diff -Nur iproute-20051007.keep/tc/f_u32.c iproute-20051007/tc/f_u32.c 
     2556+--- iproute-20051007.keep/tc/f_u32.c   2006-01-12 17:34:37.000000000 +1000 
     2557++++ iproute-20051007/tc/f_u32.c        2006-02-07 17:10:29.000000000 +1000 
     2558+@@ -17,6 +17,7 @@ 
     2559+ #include <syslog.h> 
     2560+ #include <fcntl.h> 
     2561+ #include <sys/socket.h> 
     2562++#include <sys/utsname.h> 
     2563+ #include <netinet/in.h> 
     2564+ #include <arpa/inet.h> 
     2565+ #include <string.h> 
     2566+@@ -874,6 +875,7 @@ 
     2567+                               htid = (handle&0xFFFFF000); 
     2568+               } else if (strcmp(*argv, "sample") == 0) { 
     2569+                       __u32 hash; 
     2570++                      struct utsname utsname; 
     2571+                       struct { 
     2572+                               struct tc_u32_sel sel; 
     2573+                               struct tc_u32_key keys[4]; 
     2574+@@ -889,8 +891,19 @@ 
     2575+                               return -1; 
     2576+                       } 
     2577+                       hash = sel2.sel.keys[0].val&sel2.sel.keys[0].mask; 
     2578+-                      hash ^= hash>>16; 
     2579+-                      hash ^= hash>>8; 
     2580++                      uname(&utsname); 
     2581++                      if (strncmp(utsname.release, "2.4.", 4) == 0) { 
     2582++                              hash ^= hash>>16; 
     2583++                              hash ^= hash>>8; 
     2584++                      } 
     2585++                      else { 
     2586++                              __u32 mask = sel2.sel.keys[0].mask; 
     2587++                              while (mask && !(mask & 1)) { 
     2588++                                      mask >>= 1; 
     2589++                                      hash >>= 1; 
     2590++                              } 
     2591++                              hash &= 0xFF; 
     2592++                      } 
     2593+                       htid = ((hash<<12)&0xFF000)|(htid&0xFFF00000); 
     2594+                       sample_ok = 1; 
     2595+                       continue; 
     2596--- iproute-20071016.orig/debian/patches/moo.dpatch 
     2597+++ iproute-20071016/debian/patches/moo.dpatch 
     2598@@ -0,0 +1,39 @@ 
     2599+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2600+## moo.dpatch by Alexander Wirt <formorer@debian.org> 
     2601+## 
     2602+## All lines beginning with `## DP:' are a description of the patch. 
     2603+## DP: Add moo feature 
     2604+ 
     2605+@DPATCH@ 
     2606+diff -urNad pkg-iproute~/ip/ip.c pkg-iproute/ip/ip.c 
     2607+--- pkg-iproute~/ip/ip.c       2007-10-18 11:48:11.000000000 +0200 
     2608++++ pkg-iproute/ip/ip.c        2007-10-18 14:14:20.000000000 +0200 
     2609+@@ -59,6 +59,20 @@ 
     2610+       usage(); 
     2611+ } 
     2612+  
     2613++static int do_moo(int argc, char **argv) 
     2614++{ 
     2615++       
     2616++fprintf(stderr, 
     2617++"\n" 
     2618++" _ __ ___   ___   ___\n" 
     2619++"| '_ ` _ \\ / _ \\ / _ \\\n" 
     2620++"| | | | | | (_) | (_) |\n" 
     2621++"|_| |_| |_|\\___/ \\___/\n" 
     2622++"\n\n" 
     2623++"P.S. no real cows were harmed for this moo\n"); 
     2624++      exit(1); 
     2625++} 
     2626++                        
     2627+ static const struct cmd { 
     2628+       const char *cmd; 
     2629+       int (*func)(int argc, char **argv); 
     2630+@@ -78,6 +92,7 @@ 
     2631+       { "xfrm",       do_xfrm }, 
     2632+       { "mroute",     do_multiroute }, 
     2633+       { "help",       do_help }, 
     2634++      { "moo",        do_moo },  
     2635+       { 0 } 
     2636+ }; 
     2637+  
     2638--- iproute-20071016.orig/debian/patches/heap_corruptionfix 
     2639+++ iproute-20071016/debian/patches/heap_corruptionfix 
     2640@@ -0,0 +1,47 @@ 
     2641+#! /bin/sh -e 
     2642+##  
     2643+## All lines beginning with `## DP:' are a description of the patch. 
     2644+## DP: add references to lartc 
     2645+## DP: also drop bogus reference to tc-filters 
     2646+ 
     2647+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts 
     2648+patch_opts="${patch_opts:--f --no-backup-if-mismatch}" 
     2649+ 
     2650+if [ $# -ne 1 ]; then 
     2651+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2652+    exit 1 
     2653+fi 
     2654+case "$1" in 
     2655+       -patch) patch $patch_opts -p1 < $0;; 
     2656+       -unpatch) patch $patch_opts -p1 -R < $0;; 
     2657+        *) 
     2658+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" 
     2659+                exit 1;; 
     2660+esac 
     2661+ 
     2662+exit 0 
     2663+@DPATCH@ 
     2664+diff -urNad iproute-20041019/tc/normal.c /tmp/dpep.9YHbob/iproute-20041019/tc/normal.c 
     2665+--- iproute-20041019/tc/normal.c       2004-10-19 14:49:02.000000000 -0600 
     2666++++ /tmp/dpep.9YHbob/iproute-20041019/tc/normal.c      2005-09-06 15:48:45.000000000 -0600 
     2667+@@ -26,7 +26,7 @@ 
     2668+       double x, *table; 
     2669+       int i, n; 
     2670+  
     2671+-      table = calloc(sizeof(double), TABLESIZE); 
     2672++      table = calloc(TABLESIZE+1, sizeof(double)); 
     2673+       if (!table) { 
     2674+               fprintf(stderr, "Not enough memory\n"); 
     2675+               return 1; 
     2676+diff -urNad iproute-20041019/tc/paretonormal.c /tmp/dpep.9YHbob/iproute-20041019/tc/paretonormal.c 
     2677+--- iproute-20041019/tc/paretonormal.c 2004-10-19 14:49:02.000000000 -0600 
     2678++++ /tmp/dpep.9YHbob/iproute-20041019/tc/paretonormal.c        2005-09-06 15:49:01.000000000 -0600 
     2679+@@ -54,7 +54,7 @@ 
     2680+       double *table; 
     2681+       int i,n; 
     2682+  
     2683+-      table = calloc(TABLESIZE, sizeof(double)); 
     2684++      table = calloc(TABLESIZE+1, sizeof(double)); 
     2685+       if (!table) { 
     2686+               fprintf(stderr, "Out of memory!\n"); 
     2687+               exit(1); 
     2688--- iproute-20071016.orig/debian/patches/tc_cbq_details_typo.dpatch 
     2689+++ iproute-20071016/debian/patches/tc_cbq_details_typo.dpatch 
     2690@@ -0,0 +1,19 @@ 
     2691+#! /bin/sh /usr/share/dpatch/dpatch-run 
     2692+## tc_cbq_details_typo.dpatch by  <formorer@lisa.springfield.lan> 
     2693+## 
     2694+## All lines beginning with `## DP:' are a description of the patch. 
     2695+## DP: No description. 
     2696+ 
     2697+@DPATCH@ 
     2698+diff -urNad iproute-20070313~/man/man8/tc-cbq-details.8 iproute-20070313/man/man8/tc-cbq-details.8 
     2699+--- iproute-20070313~/man/man8/tc-cbq-details.8        2007-06-10 19:25:18.000000000 +0200 
     2700++++ iproute-20070313/man/man8/tc-cbq-details.8 2007-06-10 19:25:58.000000000 +0200 
     2701+@@ -210,7 +210,7 @@ 
     2702+ priority. If found, choose it, and terminate. 
     2703+ .TP 
     2704+ (iii) 
     2705+-Choose the class at which break out to the fallback algorithm occured. Terminate. 
     2706++Choose the class at which break out to the fallback algorithm occurred. Terminate. 
     2707+ .P 
     2708+ The packet is enqueued to the class which was chosen when either algorithm  
     2709+ terminated. It is therefore possible for a packet to be enqueued *not* at a 
     2710--- iproute-20071016.orig/debian/iproute.manpages 
     2711+++ iproute-20071016/debian/iproute.manpages 
     2712@@ -0,0 +1,2 @@ 
     2713+man/*/* 
     2714+debian/man/* 
     2715--- iproute-20071016.orig/debian/iproute-doc.install 
     2716+++ iproute-20071016/debian/iproute-doc.install 
     2717@@ -0,0 +1 @@ 
     2718+debian/doc/htb/* /usr/share/doc/iproute-doc/htb 
     2719--- iproute-20071016.orig/debian/compat 
     2720+++ iproute-20071016/debian/compat 
     2721@@ -0,0 +1 @@ 
     2722+5 
     2723--- iproute-20071016.orig/debian/iproute-dev.install 
     2724+++ iproute-20071016/debian/iproute-dev.install 
     2725@@ -0,0 +1,2 @@ 
     2726+*/*.h /usr/include/iproute/ 
     2727+lib/libnetlink.a /usr/lib 
     2728--- iproute-20071016.orig/debian/man/rtmon.8 
     2729+++ iproute-20071016/debian/man/rtmon.8 
     2730@@ -0,0 +1,58 @@ 
     2731+.TH RTMON 8 
     2732+.SH NAME 
     2733+rtmon \- listens to and monitors RTnetlink 
     2734+.SH SYNOPSIS 
     2735+.B rtmon 
     2736+.RI "[ options ] file FILE [ all | LISTofOBJECTS ]" 
     2737+.SH DESCRIPTION 
     2738+This manual page documents briefly the 
     2739+.B rtmon 
     2740+command. 
     2741+.PP 
     2742+\fBrtmon\fP is a RTnetlink listener. RTnetlink allows the kernel's routing tables to be read and altered. 
     2743+ 
     2744+rtmon should be started before the first network configuration command is issued. For example if you insert: 
     2745+ 
     2746+ rtmon file /var/log/rtmon.log 
     2747+ 
     2748+in a startup script, you will be able to view the full history later. 
     2749+Certainly, it is possible to start rtmon at any time. It prepends the history with the state snapshot dumped at the moment of starting. 
     2750+.SH OPTIONS 
     2751+rtmon supports the following options: 
     2752+.TP 
     2753+.B \-Version 
     2754+Print version and exit. 
     2755+.TP 
     2756+.B help 
     2757+Show summary of options. 
     2758+.TP 
     2759+.B file FILE [ all | LISTofOBJECTS ] 
     2760+Log output to FILE. LISTofOBJECTS is the list of object types that we want to monitor. 
     2761+It may contain 'link', 'address', 'route' and 'all'. 'link' specifies the network device, 'address' 
     2762+the protocol (IP or IPv6) address on a device, 'route' the routing table entry and 'all' does what the name says. 
     2763+.TP 
     2764+.B \-family [ inet | inet6 | link | help ] 
     2765+Specify protocol family. 'inet' is IPv4, 'inet6' is IPv6, 'link' means that no networking protocol is involved and 'help' prints usage information. 
     2766+.TP 
     2767+.B \-4 
     2768+Use IPv4. Shortcut for -family inet. 
     2769+.TP 
     2770+.B \-6 
     2771+Use IPv6. Shortcut for -family inet6. 
     2772+.TP 
     2773+.B \-0 
     2774+Use a special family identifier meaning that no networking protocol is involved. Shortcut for -family link. 
     2775+.SH USAGE EXAMPLES 
     2776+.TP 
     2777+.B # rtmon file /var/log/rtmon.log 
     2778+Log to file /var/log/rtmon.log, then run: 
     2779+.TP 
     2780+.B # ip monitor file /var/log/rtmon.log 
     2781+to display logged output from file. 
     2782+.SH SEE ALSO 
     2783+.BR ip (8) 
     2784+.SH AUTHOR 
     2785+rtmon was written by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>. 
     2786+.PP 
     2787+This manual page was written by Michael Prokop <mika@grml.org>, 
     2788+for the Debian project (but may be used by others). 
     2789--- iproute-20071016.orig/debian/rules 
     2790+++ iproute-20071016/debian/rules 
     2791@@ -0,0 +1,45 @@ 
     2792+#!/usr/bin/make -f 
     2793+ 
     2794+# created by Andreas Barth <aba@not.so.argh.org> 2004 
     2795+ 
     2796+build: build-arch 
     2797+ 
     2798+include /usr/share/dpatch/dpatch.make 
     2799+ 
     2800+clean: clean-patched unpatch 
     2801+clean-patched: 
     2802+       -rm stamp-build 
     2803+       dh_testdir 
     2804+       dh_testroot 
     2805+       dh_clean 
     2806+       make clean 
     2807+ 
     2808+binary: binary-indep binary-arch 
     2809+ 
     2810+binary-indep build-indep: 
     2811+ 
     2812+binary-arch: build-arch 
     2813+       dh_testdir 
     2814+       dh_testroot 
     2815+       dh_install --fail-missing 
     2816+       dh_link 
     2817+       dh_installexamples -p iproute-doc examples/* 
     2818+       dh_installman 
     2819+       dh_installdocs 
     2820+       dh_installchangelogs 
     2821+       dh_compress 
     2822+       dh_strip 
     2823+       dh_fixperms 
     2824+       dh_installdeb 
     2825+       dh_shlibdeps -Xq_atm.so 
     2826+       dh_gencontrol 
     2827+       dh_md5sums 
     2828+       dh_builddeb 
     2829+ 
     2830+build-arch: stamp-build 
     2831+stamp-build: patch 
     2832+       $(MAKE) KERNEL_INCLUDE=./include 
     2833+       $(MAKE) -C doc all txt 
     2834+       touch stamp-build 
     2835+ 
     2836+.PHONY: build binary binary-arch binary-indep clean 
     2837--- iproute-20071016.orig/debian/control 
     2838+++ iproute-20071016/debian/control 
     2839@@ -0,0 +1,46 @@ 
     2840+Source: iproute 
     2841+Section: net 
     2842+Priority: optional 
     2843+Maintainer: Alexander Wirt <formorer@debian.org> 
     2844+Uploaders: Andreas Barth <aba@not.so.argh.org>, Andreas Henriksson <andreas@fatal.se> 
     2845+Homepage: http://www.linux-foundation.org/en/Net:Iproute2 
     2846+Vcs-Browser: http://git.debian.org/?p=collab-maint/pkg-iproute.git 
     2847+Vcs-Git: git://git.debian.org/git/collab-maint/pkg-iproute.git 
     2848+Standards-Version: 3.7.3 
     2849+Build-Depends: texlive-latex-base, texlive-latex-recommended, libatm1-dev, bison, libdb-dev, linuxdoc-tools, linux-libc-dev, debhelper (>= 5), lynx, dpatch, flex 
     2850+ 
     2851+Package: iproute 
     2852+Architecture: any 
     2853+Provides: arpd 
     2854+Conflicts: arpd 
     2855+Depends: ${shlibs:Depends} 
     2856+Recommends: libatm1 
     2857+Suggests: iproute-doc 
     2858+Description: Professional tools to control the networking in Linux kernels 
     2859+ This is `iproute', the professional set of tools to control the 
     2860+ networking behavior in kernels 2.2.x and later. 
     2861+ . 
     2862+ At least, the options CONFIG_NETLINK and CONFIG_NETLINK_DEV (or 
     2863+ CONFIG_RTNETLINK) must be compiled into the running kernel. 
     2864+ . 
     2865+ This package is also known as iproute2 upstream and in some 
     2866+ documentation. 
     2867+ 
     2868+Package: iproute-doc 
     2869+Section: doc 
     2870+Architecture: all 
     2871+Description: Professional tools to control the networking in Linux kernels 
     2872+ This package contains the documentation for the iproute package.  
     2873+ . 
     2874+ iproute is the professional set of tools to control the 
     2875+ networking behavior in kernels 2.2.x and late 
     2876+ 
     2877+Package: iproute-dev 
     2878+Section: libdevel 
     2879+Architecture: any 
     2880+Description: Development package for iproute 
     2881+ This package contains the header files and static libs for developing 
     2882+ iproute additions. iproute is the professional set of tools to control the 
     2883+ networking behavior in kernels 2.2.x and later. 
     2884+ . 
     2885+ You don't need this package unless doing development. 
     2886--- iproute-20071016.orig/debian/iproute-doc.docs 
     2887+++ iproute-20071016/debian/iproute-doc.docs 
     2888@@ -0,0 +1,4 @@ 
     2889+README* doc/Plan RELNOTES 
     2890+doc/*.tex doc/*.dvi doc/*.ps doc/*.sty 
     2891+doc/*.txt doc/*.html 
     2892+debian/htb/*  
     2893--- iproute-20071016.orig/ip/iptunnel.c 
     2894+++ iproute-20071016/ip/iptunnel.c 
     2895@@ -113,7 +113,7 @@ 
     2896                        NEXT_ARG(); 
     2897                        p->i_flags |= GRE_KEY; 
     2898                        if (strchr(*argv, '.')) 
     2899-                               p->o_key = get_addr32(*argv); 
     2900+                               p->i_key = get_addr32(*argv); 
     2901                        else { 
     2902                                if (get_unsigned(&uval, *argv, 0)<0) { 
     2903                                        fprintf(stderr, "invalid value of \"ikey\"\n"); 
     2904--- iproute-20071016.orig/ip/iproute.c 
     2905+++ iproute-20071016/ip/iproute.c 
     2906@@ -780,6 +780,18 @@ 
    6152907                                invarg("\"reordering\" value is invalid\n", *argv); 
    6162908                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord); 
     
    6282920+                       rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplim); 
    6292921+#endif 
    630 +#ifdef RTAX_INITCWND 
    631 +               } else if (strcmp(*argv, "initcwnd") == 0) { 
    632 +                       unsigned initcwnd; 
    633 +                       NEXT_ARG(); 
    634 +                       if (strcmp(*argv, "lock") == 0) { 
    635 +                               mxlock |= (1<<RTAX_HOPLIMIT); 
    636 +                               NEXT_ARG(); 
    637 +                       } 
    638 +                       if (get_unsigned(&initcwnd, *argv, 0)) 
    639 +                               invarg("\"initcwnd\" value is invalid\n", *argv); 
    640 +                       rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, initcwnd); 
    641 +#endif 
    6422922                } else if (strcmp(*argv, "rtt") == 0) { 
    6432923                        unsigned rtt; 
    6442924                        NEXT_ARG(); 
    645 Index: iproute-2.6.20-070313/ip/iptunnel.c 
    646 =================================================================== 
    647 --- iproute-2.6.20-070313.orig/ip/iptunnel.c    2007-06-09 13:53:56.000000000 +0100 
    648 +++ iproute-2.6.20-070313/ip/iptunnel.c 2007-06-09 13:53:57.000000000 +0100 
    649 @@ -113,7 +113,7 @@ 
    650                         NEXT_ARG(); 
    651                         p->i_flags |= GRE_KEY; 
    652                         if (strchr(*argv, '.')) 
    653 -                               p->o_key = get_addr32(*argv); 
    654 +                               p->i_key = get_addr32(*argv); 
    655                         else { 
    656                                 if (get_unsigned(&uval, *argv, 0)<0) { 
    657                                         fprintf(stderr, "invalid value of \"ikey\"\n"); 
    658 Index: iproute-2.6.20-070313/Makefile 
    659 =================================================================== 
    660 --- iproute-2.6.20-070313.orig/Makefile 2007-06-09 13:53:56.000000000 +0100 
    661 +++ iproute-2.6.20-070313/Makefile      2007-06-09 13:53:57.000000000 +0100 
    662 @@ -48,7 +48,7 @@ 
    663                 $(DESTDIR)$(DOCDIR)/examples 
    664         install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ 
    665                 $(DESTDIR)$(DOCDIR)/examples/diffserv 
    666 -       @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done 
    667 +       @set -e; for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done 
    668         install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) 
    669         install -m 0755 -d $(DESTDIR)$(MANDIR)/man8 
    670         install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8 
    671 @@ -59,7 +59,7 @@ 
    672   
    673  clean: 
    674         rm -f cscope.* 
    675 -       @for i in $(SUBDIRS) doc; \ 
    676 +       @set -e; for i in $(SUBDIRS) doc; \ 
    677         do $(MAKE) $(MFLAGS) -C $$i clean; done 
    678   
    679  clobber: clean 
    680 Index: iproute-2.6.20-070313/man/man8/ip.8 
    681 =================================================================== 
    682 --- iproute-2.6.20-070313.orig/man/man8/ip.8    2007-06-09 13:53:56.000000000 +0100 
    683 +++ iproute-2.6.20-070313/man/man8/ip.8 2007-06-09 13:53:57.000000000 +0100 
    684 @@ -1808,6 +1808,8 @@ 
    685  .RB "IP Command reference " ip-cref.ps 
     2925--- iproute-20071016.orig/ip/ipaddress.c 
     2926+++ iproute-20071016/ip/ipaddress.c 
     2927@@ -34,6 +34,8 @@ 
     2928 #include "ll_map.h" 
     2929 #include "ip_common.h" 
     2930  
     2931+#define MAX_ROUNDS 10 
     2932+ 
     2933 static struct 
     2934 { 
     2935        int ifindex; 
     2936@@ -667,7 +669,7 @@ 
     2937                filter.flushp = 0; 
     2938                filter.flushe = sizeof(flushb); 
     2939  
     2940-               for (;;) { 
     2941+               while (round < MAX_ROUNDS) { 
     2942                        if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) { 
     2943                                perror("Cannot send dump request"); 
     2944                                exit(1); 
     2945@@ -694,6 +696,8 @@ 
     2946                                fflush(stdout); 
     2947                        } 
     2948                } 
     2949+               fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", MAX_ROUNDS); fflush(stderr); 
     2950+               return 1; 
     2951        } 
     2952  
     2953        if (filter.family != AF_PACKET) { 
     2954--- iproute-20071016.orig/ip/iplink.c 
     2955+++ iproute-20071016/ip/iplink.c 
     2956@@ -107,7 +107,8 @@ 
     2957 { 
     2958        struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(n); 
     2959  
     2960-       if (n->nlmsg_type == NLMSG_ERROR && err->error == -EOPNOTSUPP) 
     2961+       if (n->nlmsg_type == NLMSG_ERROR && 
     2962+           (err->error == -EOPNOTSUPP || err->error == -EINVAL)) 
     2963                have_rtnl_newlink = 0; 
     2964        else 
     2965                have_rtnl_newlink = 1; 
     2966--- iproute-20071016.orig/Makefile 
     2967+++ iproute-20071016/Makefile 
     2968@@ -56,6 +56,7 @@ 
     2969        ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/rtstat.8 
     2970        ln -sf lnstat.8  $(DESTDIR)$(MANDIR)/man8/ctstat.8 
     2971        ln -sf rtacct.8  $(DESTDIR)$(MANDIR)/man8/nstat.8 
     2972+       ln -sf routel.8  $(DESTDIR)$(MANDIR)/man8/routef.8 
     2973        install -m 0755 -d $(DESTDIR)$(MANDIR)/man3 
     2974        install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3 
     2975  
     2976--- iproute-20071016.orig/man/man8/ip.8 
     2977+++ iproute-20071016/man/man8/ip.8 
     2978@@ -32,7 +32,7 @@ 
    6862979 .br 
    687  .RB "IP tunnels " ip-cref.ps 
     2980 .BR promisc " { " on " | " off " } |" 
     2981 .br 
     2982-.BR allmulti " { " on " | " off " } |" 
     2983+.BR allmulticast " { " on " | " off " } |" 
     2984 .br 
     2985 .BR dynamic " { " on " | " off " } |" 
     2986 .br 
     2987@@ -1568,10 +1568,12 @@ 
     2988 set 
     2989 .I unique 
     2990 priority value. 
     2991+The options preference and order are synonyms with priority. 
     2992  
     2993 .TP 
     2994 .BI table " TABLEID" 
     2995 the routing table identifier to lookup if the rule selector matches. 
     2996+It is also possible to use lookup instead of table. 
     2997  
     2998 .TP 
     2999 .BI realms " FROM/TO" 
     3000@@ -1589,6 +1591,7 @@ 
     3001 routes) or a local host address (or even zero). 
     3002 In the last case the router does not translate the packets, but 
     3003 masquerades them to this address. 
     3004+Using map-to instead of nat means the same thing. 
     3005  
     3006 .B Warning: 
     3007 Changes to the RPDB made with these commands do not become active 
     3008@@ -1601,6 +1604,7 @@ 
     3009  
     3010 .SS ip rule show - list rules 
     3011 This command has no arguments. 
     3012+The options list or lst are synonyms with show. 
     3013  
     3014 .SH ip maddress - multicast addresses management 
     3015  
     3016--- iproute-20071016.orig/man/man8/ss.8 
     3017+++ iproute-20071016/man/man8/ss.8 
     3018@@ -107,7 +107,7 @@ 
     3019 .B ss -o state established '( dport = :ssh or sport = :ssh )' 
     3020 Display all established ssh connections. 
     3021 .TP 
     3022-.B ss -x src \"/tmp/.X11-unix/*\" 
     3023+.B ss -x src /tmp/.X11-unix/* 
     3024 Find all local processes connected to X server. 
     3025 .TP 
     3026 .B ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24 
     3027--- iproute-20071016.orig/man/man8/routel.8 
     3028+++ iproute-20071016/man/man8/routel.8 
     3029@@ -0,0 +1,32 @@ 
     3030+.TH "ROUTEL" "8" "3 Jan, 2008" "iproute2" "Linux" 
     3031+.SH "NAME" 
     3032+.LP  
     3033+routel \- list routes with pretty output format 
    6883034+.br 
    689 +.RB http://lartc.org/ 
    690   
    691  .SH AUTHOR 
    692  Original Manpage  by Michail Litvak <mci@owl.openwall.com> 
    693 Index: iproute-2.6.20-070313/man/man8/tc.8 
    694 =================================================================== 
    695 --- iproute-2.6.20-070313.orig/man/man8/tc.8    2007-06-09 13:53:56.000000000 +0100 
    696 +++ iproute-2.6.20-070313/man/man8/tc.8 2007-06-09 13:53:57.000000000 +0100 
    697 @@ -341,7 +341,7 @@ 
    698  .BR tc-pfifo (8), 
    699  .BR tc-bfifo (8), 
    700  .BR tc-pfifo_fast (8), 
    701 -.BR tc-filters (8) 
    702 +.BR http://lartc.org/ 
    703   
    704  .SH AUTHOR 
    705  Manpage maintained by bert hubert (ahu@ds9a.nl) 
    706 Index: iproute-2.6.20-070313/misc/Makefile 
    707 =================================================================== 
    708 --- iproute-2.6.20-070313.orig/misc/Makefile    2007-06-09 13:53:56.000000000 +0100 
    709 +++ iproute-2.6.20-070313/misc/Makefile 2007-06-09 13:53:57.000000000 +0100 
    710 @@ -1,7 +1,8 @@ 
    711  SSOBJ=ss.o ssfilter.o 
    712  LNSTATOBJ=lnstat.o lnstat_util.o 
    713   
    714 -TARGETS=ss nstat ifstat rtacct arpd lnstat 
    715 +#TARGETS=ss nstat ifstat rtacct arpd lnstat 
    716 +TARGETS=ss nstat rtacct lnstat 
    717   
    718  include ../Config 
    719   
    720 Index: iproute-2.6.20-070313/misc/netbug 
    721 =================================================================== 
    722 --- iproute-2.6.20-070313.orig/misc/netbug      2007-06-09 13:53:56.000000000 +0100 
    723 +++ iproute-2.6.20-070313/misc/netbug   2007-06-09 13:53:57.000000000 +0100 
    724 @@ -1,23 +1,16 @@ 
    725  #! /bin/bash 
    726   
    727 +set -e 
    728 + 
    729  echo -n "Send network configuration summary to [ENTER means kuznet@ms2.inr.ac.ru] " 
    730  IFS="" read mail || exit 1 
    731  [ -z "$mail" ] && mail=kuznet@ms2.inr.ac.ru 
    732   
    733 +netbug=`mktemp -d -t netbug.XXXXXX` || {echo "$0: Cannot create temporary directory" >&2; exit 1;  } 
    734 +netbugtar=`tempfile -d $netbug --suffix=tar.gz` || {echo "$0: Cannot create temporary file" >&2; exit 1;  } 
    735 +tmppath=$netbug 
    736 +trap "/bin/rm -rf $netbug $netbugtar" 0 1 2 3 13 15 
    737   
    738 -netbug="" 
    739 -while [ "$netbug" = "" ]; do 
    740 -       netbug=`echo netbug.$$.$RANDOM` 
    741 -       if [ -e /tmp/$netbug ]; then 
    742 -               netbug="" 
    743 -       fi 
    744 -done 
    745 - 
    746 -tmppath=/tmp/$netbug 
    747 - 
    748 -trap "rm -rf $tmppath $tmppath.tar.gz" 0 SIGINT 
    749 - 
    750 -mkdir $tmppath 
    751  mkdir $tmppath/net 
    752   
    753  cat /proc/slabinfo > $tmppath/slabinfo 
    754 @@ -44,9 +37,8 @@ 
    755  fi 
    756   
    757  cd /tmp 
    758 -tar c $netbug | gzip -9c > $netbug.tar.gz 
    759 - 
    760 -uuencode $netbug.tar.gz $netbug.tar.gz | mail -s $netbug "$mail" 
    761 +tar c $tmppath | gzip -9c > $netbugtar 
    762 +uuencode $netbugtar $netbugtar | mail -s $netbug "$mail" 
    763   
    764  echo "Sending to <$mail>; subject is $netbug" 
    765   
    766 Index: iproute-2.6.20-070313/tc/Makefile 
    767 =================================================================== 
    768 --- iproute-2.6.20-070313.orig/tc/Makefile      2007-06-09 13:53:56.000000000 +0100 
    769 +++ iproute-2.6.20-070313/tc/Makefile   2007-06-09 13:53:57.000000000 +0100 
    770 @@ -11,6 +11,7 @@ 
    771  TCMODULES += q_prio.o 
    772  TCMODULES += q_tbf.o 
    773  TCMODULES += q_cbq.o 
    774 +TCMODULES += q_wrr.o 
    775  TCMODULES += f_rsvp.o 
    776  TCMODULES += f_u32.o 
    777  TCMODULES += f_route.o 
    778 Index: iproute-2.6.20-070313/tc/q_htb.c 
    779 =================================================================== 
    780 --- iproute-2.6.20-070313.orig/tc/q_htb.c       2007-06-09 13:53:56.000000000 +0100 
    781 +++ iproute-2.6.20-070313/tc/q_htb.c    2007-06-09 13:53:57.000000000 +0100 
    782 @@ -1,3 +1,311 @@ 
    783 +#if 0 
    784 +/* 
    785 + * q_htb.c             HTB. 
    786 + * 
    787 + *             This program is free software; you can redistribute it and/or 
    788 + *             modify it under the terms of the GNU General Public License 
    789 + *             as published by the Free Software Foundation; either version 
    790 + *             2 of the License, or (at your option) any later version. 
    791 + * 
    792 + * Authors:    Martin Devera, devik@cdi.cz 
    793 + * 
    794 + */ 
    795 + 
    796 +#include <stdio.h> 
    797 +#include <stdlib.h> 
    798 +#include <unistd.h> 
    799 +#include <syslog.h> 
    800 +#include <fcntl.h> 
    801 +#include <sys/socket.h> 
    802 +#include <netinet/in.h> 
    803 +#include <arpa/inet.h> 
    804 +#include <string.h> 
    805 + 
    806 +#include "utils.h" 
    807 +#include "tc_util.h" 
    808 + 
    809 +#define HTB_TC_VER 0x30003 
    810 +#if HTB_TC_VER >> 16 != TC_HTB_PROTOVER 
    811 +#error "Different kernel and TC HTB versions" 
    812 +#endif 
    813 + 
    814 +static void explain(void) 
    815 +{ 
    816 +       fprintf(stderr, "Usage: ... qdisc add ... htb [default N] [r2q N]\n" 
    817 +               " default  minor id of class to which unclassified packets are sent {0}\n" 
    818 +               " r2q      DRR quantums are computed as rate in Bps/r2q {10}\n" 
    819 +               " debug    string of 16 numbers each 0-3 {0}\n\n" 
    820 +               "... class add ... htb rate R1 burst B1 [prio P] [slot S] [pslot PS]\n" 
    821 +               "                      [ceil R2] [cburst B2] [mtu MTU] [quantum Q]\n" 
    822 +               " rate     rate allocated to this class (class can still borrow)\n" 
    823 +               " burst    max bytes burst which can be accumulated during idle period {computed}\n" 
    824 +               " ceil     definite upper class rate (no borrows) {rate}\n" 
    825 +               " cburst   burst but for ceil {computed}\n" 
    826 +               " mtu      max packet size we create rate map for {1600}\n" 
    827 +               " prio     priority of leaf; lower are served first {0}\n" 
    828 +               " quantum  how much bytes to serve from leaf at once {use r2q}\n" 
    829 +               "\nTC HTB version %d.%d\n",HTB_TC_VER>>16,HTB_TC_VER&0xffff 
    830 +               ); 
    831 +} 
    832 + 
    833 +static void explain1(char *arg) 
    834 +{ 
    835 +    fprintf(stderr, "Illegal \"%s\"\n", arg); 
    836 +    explain(); 
    837 +} 
    838 + 
    839 + 
    840 +#define usage() return(-1) 
    841 + 
    842 +static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) 
    843 +{ 
    844 +       struct tc_htb_glob opt; 
    845 +       struct rtattr *tail; 
    846 +       unsigned i; char *p; 
    847 +       memset(&opt,0,sizeof(opt)); 
    848 +       opt.rate2quantum = 10; 
    849 +       opt.version = 3; 
    850 + 
    851 +       while (argc > 0) { 
    852 +               if (matches(*argv, "r2q") == 0) { 
    853 +                   NEXT_ARG(); 
    854 +                   if (get_u32(&opt.rate2quantum, *argv, 10)) { 
    855 +                       explain1("r2q"); return -1; 
    856 +                   } 
    857 +               } else if (matches(*argv, "default") == 0) { 
    858 +                   NEXT_ARG(); 
    859 +                   if (get_u32(&opt.defcls, *argv, 16)) { 
    860 +                       explain1("default"); return -1; 
    861 +                   } 
    862 +               } else if (matches(*argv, "debug") == 0) { 
    863 +                   NEXT_ARG(); p = *argv; 
    864 +                   for (i=0; i<16; i++,p++) { 
    865 +                       if (*p<'0' || *p>'3') break; 
    866 +                       opt.debug |= (*p-'0')<<(2*i); 
    867 +                   } 
    868 +               } else { 
    869 +                       fprintf(stderr, "What is \"%s\"?\n", *argv); 
    870 +                       explain(); 
    871 +                       return -1; 
    872 +               } 
    873 +               argc--; argv++; 
    874 +       } 
    875 +       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len)); 
    876 +       addattr_l(n, 1024, TCA_OPTIONS, NULL, 0); 
    877 +       addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt))); 
    878 +       tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail; 
    879 +       return 0; 
    880 +} 
    881 + 
    882 +static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) 
    883 +{ 
    884 +       int ok=0; 
    885 +       struct tc_htb_opt opt; 
    886 +       __u32 rtab[256],ctab[256]; 
    887 +       unsigned buffer=0,cbuffer=0; 
    888 +       int cell_log=-1,ccell_log = -1,mtu; 
    889 +       struct rtattr *tail; 
    890 + 
    891 +       memset(&opt, 0, sizeof(opt)); mtu = 1600; /* eth packet len */ 
    892 + 
    893 +       while (argc > 0) { 
    894 +               if (matches(*argv, "prio") == 0) { 
    895 +                       NEXT_ARG(); 
    896 +                       if (get_u32(&opt.prio, *argv, 10)) { 
    897 +                               explain1("prio"); return -1; 
    898 +                       } 
    899 +                       ok++; 
    900 +               } else if (matches(*argv, "mtu") == 0) { 
    901 +                       NEXT_ARG(); 
    902 +                       if (get_u32(&mtu, *argv, 10)) { 
    903 +                               explain1("mtu"); return -1; 
    904 +                       } 
    905 +               } else if (matches(*argv, "quantum") == 0) { 
    906 +                       NEXT_ARG(); 
    907 +                       if (get_u32(&opt.quantum, *argv, 10)) { 
    908 +                               explain1("quantum"); return -1; 
    909 +                       } 
    910 +               } else if (matches(*argv, "burst") == 0 || 
    911 +                       strcmp(*argv, "buffer") == 0 || 
    912 +                       strcmp(*argv, "maxburst") == 0) { 
    913 +                       NEXT_ARG(); 
    914 +                       if (get_size_and_cell(&buffer, &cell_log, *argv) < 0) { 
    915 +                               explain1("buffer"); 
    916 +                               return -1; 
    917 +                       } 
    918 +                       ok++; 
    919 +               } else if (matches(*argv, "cburst") == 0 || 
    920 +                       strcmp(*argv, "cbuffer") == 0 || 
    921 +                       strcmp(*argv, "cmaxburst") == 0) { 
    922 +                       NEXT_ARG(); 
    923 +                       if (get_size_and_cell(&cbuffer, &ccell_log, *argv) < 0) { 
    924 +                               explain1("cbuffer"); 
    925 +                               return -1; 
    926 +                       } 
    927 +                       ok++; 
    928 +               } else if (strcmp(*argv, "ceil") == 0) { 
    929 +                       NEXT_ARG(); 
    930 +                       if (opt.ceil.rate) { 
    931 +                               fprintf(stderr, "Double \"ceil\" spec\n"); 
    932 +                               return -1; 
    933 +                       } 
    934 +                       if (get_rate(&opt.ceil.rate, *argv)) { 
    935 +                               explain1("ceil"); 
    936 +                               return -1; 
    937 +                       } 
    938 +                       ok++; 
    939 +               } else if (strcmp(*argv, "rate") == 0) { 
    940 +                       NEXT_ARG(); 
    941 +                       if (opt.rate.rate) { 
    942 +                               fprintf(stderr, "Double \"rate\" spec\n"); 
    943 +                               return -1; 
    944 +                       } 
    945 +                       if (get_rate(&opt.rate.rate, *argv)) { 
    946 +                               explain1("rate"); 
    947 +                               return -1; 
    948 +                       } 
    949 +                       ok++; 
    950 +               } else if (strcmp(*argv, "help") == 0) { 
    951 +                       explain(); 
    952 +                       return -1; 
    953 +               } else { 
    954 +                       fprintf(stderr, "What is \"%s\"?\n", *argv); 
    955 +                       explain(); 
    956 +                       return -1; 
    957 +               } 
    958 +               argc--; argv++; 
    959 +       } 
    960 + 
    961 +/*     if (!ok) 
    962 +               return 0;*/ 
    963 + 
    964 +       if (opt.rate.rate == 0) { 
    965 +               fprintf(stderr, "\"rate\" is required.\n"); 
    966 +               return -1; 
    967 +       } 
    968 +       /* if ceil params are missing, use the same as rate */ 
    969 +       if (!opt.ceil.rate) opt.ceil = opt.rate; 
    970 + 
    971 +       /* compute minimal allowed burst from rate; mtu is added here to make 
    972 +          sute that buffer is larger than mtu and to have some safeguard space */ 
    973 +       if (!buffer) buffer = opt.rate.rate / HZ + mtu; 
    974 +       if (!cbuffer) cbuffer = opt.ceil.rate / HZ + mtu; 
    975 + 
    976 +       if ((cell_log = tc_calc_rtable(opt.rate.rate, rtab, cell_log, mtu, 0)) < 0) { 
    977 +               fprintf(stderr, "htb: failed to calculate rate table.\n"); 
    978 +               return -1; 
    979 +       } 
    980 +       opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer); 
    981 +       opt.rate.cell_log = cell_log; 
    982 +        
    983 +       if ((ccell_log = tc_calc_rtable(opt.ceil.rate, ctab, cell_log, mtu, 0)) < 0) { 
    984 +               fprintf(stderr, "htb: failed to calculate ceil rate table.\n"); 
    985 +               return -1; 
    986 +       } 
    987 +       opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer); 
    988 +       opt.ceil.cell_log = ccell_log; 
    989 + 
    990 +       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len)); 
    991 +       addattr_l(n, 1024, TCA_OPTIONS, NULL, 0); 
    992 +       addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt)); 
    993 +       addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024); 
    994 +       addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024); 
    995 +       tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail; 
    996 +       return 0; 
    997 +} 
    998 + 
    999 +static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) 
    1000 +{ 
    1001 +       struct rtattr *tb[TCA_HTB_RTAB+1]; 
    1002 +       struct tc_htb_opt *hopt; 
    1003 +       struct tc_htb_glob *gopt; 
    1004 +       double buffer,cbuffer; 
    1005 +       SPRINT_BUF(b1); 
    1006 +       SPRINT_BUF(b2); 
    1007 + 
    1008 +       if (opt == NULL) 
    1009 +               return 0; 
    1010 + 
    1011 +       memset(tb, 0, sizeof(tb)); 
    1012 +       parse_rtattr(tb, TCA_HTB_RTAB, RTA_DATA(opt), RTA_PAYLOAD(opt)); 
    1013 + 
    1014 +       if (tb[TCA_HTB_PARMS]) { 
    1015 + 
    1016 +           hopt = RTA_DATA(tb[TCA_HTB_PARMS]); 
    1017 +           if (RTA_PAYLOAD(tb[TCA_HTB_PARMS])  < sizeof(*hopt)) return -1; 
    1018 + 
    1019 +               if (!hopt->level) { 
    1020 +                       fprintf(f, "prio %d ", (int)hopt->prio); 
    1021 +                       if (show_details) 
    1022 +                               fprintf(f, "quantum %d ", (int)hopt->quantum); 
    1023 +               } 
    1024 +           fprintf(f, "rate %s ", sprint_rate(hopt->rate.rate, b1)); 
    1025 +           buffer = ((double)hopt->rate.rate*tc_core_tick2usec(hopt->buffer))/1000000; 
    1026 +           fprintf(f, "ceil %s ", sprint_rate(hopt->ceil.rate, b1)); 
    1027 +           cbuffer = ((double)hopt->ceil.rate*tc_core_tick2usec(hopt->cbuffer))/1000000; 
    1028 +           if (show_details) { 
    1029 +               fprintf(f, "burst %s/%u mpu %s ", sprint_size(buffer, b1), 
    1030 +                       1<<hopt->rate.cell_log, sprint_size(hopt->rate.mpu, b2)); 
    1031 +               fprintf(f, "cburst %s/%u mpu %s ", sprint_size(cbuffer, b1), 
    1032 +                       1<<hopt->ceil.cell_log, sprint_size(hopt->ceil.mpu, b2)); 
    1033 +               fprintf(f, "level %d ", (int)hopt->level); 
    1034 +           } else { 
    1035 +               fprintf(f, "burst %s ", sprint_size(buffer, b1)); 
    1036 +               fprintf(f, "cburst %s ", sprint_size(cbuffer, b1)); 
    1037 +           } 
    1038 +           if (show_raw) 
    1039 +               fprintf(f, "buffer [%08x] cbuffer [%08x] ",  
    1040 +                       hopt->buffer,hopt->cbuffer); 
    1041 +       } 
    1042 +       if (tb[TCA_HTB_INIT]) { 
    1043 +           gopt = RTA_DATA(tb[TCA_HTB_INIT]); 
    1044 +           if (RTA_PAYLOAD(tb[TCA_HTB_INIT])  < sizeof(*gopt)) return -1; 
    1045 + 
    1046 +           fprintf(f, "r2q %d default %x direct_packets_stat %u",  
    1047 +                   gopt->rate2quantum,gopt->defcls,gopt->direct_pkts); 
    1048 +               if (show_details) 
    1049 +                       fprintf(f," ver %d.%d",gopt->version >> 16,gopt->version & 0xffff); 
    1050 +       } 
    1051 +       return 0; 
    1052 +} 
    1053 + 
    1054 +static int htb_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) 
    1055 +{ 
    1056 +       struct tc_htb_xstats *st; 
    1057 +       if (xstats == NULL) 
    1058 +               return 0; 
    1059 + 
    1060 +       if (RTA_PAYLOAD(xstats) < sizeof(*st)) 
    1061 +               return -1; 
    1062 + 
    1063 +       st = RTA_DATA(xstats); 
    1064 +       fprintf(f, " lended: %u borrowed: %u giants: %u\n",  
    1065 +               st->lends,st->borrows,st->giants); 
    1066 +       fprintf(f, " tokens: %d ctokens: %d\n", st->tokens,st->ctokens); 
    1067 +       return 0; 
    1068 +} 
    1069 + 
    1070 +struct qdisc_util htb_util = { 
    1071 +       NULL, 
    1072 +       "htb", 
    1073 +       htb_parse_opt, 
    1074 +       htb_print_opt, 
    1075 +       htb_print_xstats, 
    1076 +       htb_parse_class_opt, 
    1077 +       htb_print_opt, 
    1078 +}; 
    1079 + 
    1080 +/* for testing of old one */ 
    1081 +struct qdisc_util htb2_util = { 
    1082 +       NULL, 
    1083 +       "htb2", 
    1084 +       htb_parse_opt, 
    1085 +       htb_print_opt, 
    1086 +       htb_print_xstats, 
    1087 +       htb_parse_class_opt, 
    1088 +       htb_print_opt, 
    1089 +}; 
    1090 +#endif 
    1091  /* 
    1092   * q_htb.c             HTB. 
    1093   * 
    1094 Index: iproute-2.6.20-070313/tc/q_wrr.c 
    1095 =================================================================== 
    1096 --- /dev/null   1970-01-01 00:00:00.000000000 +0000 
    1097 +++ iproute-2.6.20-070313/tc/q_wrr.c    2007-06-09 13:53:57.000000000 +0100 
    1098 @@ -0,0 +1,322 @@ 
    1099 +#include <stdio.h> 
    1100 +#include <stdlib.h> 
    1101 +#include <unistd.h> 
    1102 +#include <syslog.h> 
    1103 +#include <fcntl.h> 
    1104 +#include <sys/socket.h> 
    1105 +#include <netinet/in.h> 
    1106 +#include <arpa/inet.h> 
    1107 +#include <string.h> 
    1108 +#include <math.h> 
    1109 + 
    1110 +#include "utils.h" 
    1111 +#include "tc_util.h" 
    1112 + 
    1113 +#define usage() return(-1) 
    1114 + 
    1115 +// Returns -1 on error 
    1116 +static int wrr_parse_qdisc_weight(int argc, char** argv,  
    1117 +                              struct tc_wrr_qdisc_modf* opt) { 
    1118 +  int i; 
    1119  
    1120 +  opt->weight1.weight_mode=-1; 
    1121 +  opt->weight2.weight_mode=-1; 
    1122  
    1123 +  for(i=0; i<argc; i++) {   
    1124 +    if(!memcmp(argv[i],"wmode1=",7)) { 
    1125 +      opt->weight1.weight_mode=atoi(argv[i]+7);             
    1126 +    } else if(!memcmp(argv[i],"wmode2=",7)) { 
    1127 +      opt->weight2.weight_mode=atoi(argv[i]+7); 
    1128 +    } else { 
    1129 +      printf("Usage: ... [wmode1=0|1|2|3] [wmode2=0|1|2|3]\n"); 
    1130 +      return -1; 
    1131 +    } 
    1132 +  } 
    1133 +  return 0; 
    1134 +} 
    1135 + 
    1136 +static int wrr_parse_class_modf(int argc, char** argv,  
    1137 +                                struct tc_wrr_class_modf* modf) { 
    1138 +  int i; 
    1139  
    1140 +  if(argc<1) { 
    1141 +    fprintf(stderr, "Usage: ... [weight1=val] [decr1=val] [incr1=val] [min1=val] [max1=val] [val2=val] ...\n"); 
    1142 +    fprintf(stderr, "  The values can be floating point like 0.42 or divisions like 42/100\n"); 
    1143 +    return -1; 
    1144 +  } 
    1145  
    1146 +  // Set meaningless values: 
    1147 +  modf->weight1.val=0; 
    1148 +  modf->weight1.decr=(__u64)-1; 
    1149 +  modf->weight1.incr=(__u64)-1; 
    1150 +  modf->weight1.min=0; 
    1151 +  modf->weight1.max=0; 
    1152 +  modf->weight2.val=0; 
    1153 +  modf->weight2.decr=(__u64)-1; 
    1154 +  modf->weight2.incr=(__u64)-1; 
    1155 +  modf->weight2.min=0; 
    1156 +  modf->weight2.max=0; 
    1157  
    1158 +  // And read values: 
    1159 +  for(i=0; i<argc; i++) { 
    1160 +    char arg[80]; 
    1161 +    char* name,*value1=0,*value2=0; 
    1162 +    long double f_val1,f_val2=1,value; 
    1163 +    if(strlen(argv[i])>=sizeof(arg)) { 
    1164 +      fprintf(stderr,"Argument too long: %s\n",argv[i]); 
    1165 +      return -1; 
    1166 +    } 
    1167 +    strcpy(arg,argv[i]); 
    1168 +     
    1169 +    name=strtok(arg,"="); 
    1170 +    if(name) value1=strtok(0,"/"); 
    1171 +    if(value1) value2=strtok(0,""); 
    1172 +     
    1173 +    if(!value1) { 
    1174 +      fprintf(stderr,"No = found in argument: %s\n",argv[i]); 
    1175 +      return -1; 
    1176 +    } 
    1177 +     
    1178 +    f_val1=atof(value1); 
    1179 +    if(value2) f_val2=atof(value2);     
    1180 +     
    1181 +    if(f_val2==0)  { 
    1182 +      fprintf(stderr,"Division by 0\n"); 
    1183 +      return -1; 
    1184 +    } 
    1185 +         
    1186 +    value=f_val1/f_val2;     
    1187 +    if(value>1) value=1; 
    1188 +    if(value<0) value=0;             
    1189 +    value*=((__u64)-1); 
    1190 +     
    1191 +    // And find the value set 
    1192 +    if(!strcmp(name,"weight1"))    modf->weight1.val=value; 
    1193 +    else if(!strcmp(name,"decr1")) modf->weight1.decr=value; 
    1194 +    else if(!strcmp(name,"incr1")) modf->weight1.incr=value; 
    1195 +    else if(!strcmp(name,"min1"))  modf->weight1.min=value; 
    1196 +    else if(!strcmp(name,"max1"))  modf->weight1.max=value; 
    1197 +    else if(!strcmp(name,"weight2")) modf->weight2.val=value; 
    1198 +    else if(!strcmp(name,"decr2")) modf->weight2.decr=value; 
    1199 +    else if(!strcmp(name,"incr2")) modf->weight2.incr=value; 
    1200 +    else if(!strcmp(name,"min2"))  modf->weight2.min=value; 
    1201 +    else if(!strcmp(name,"max2"))  modf->weight2.max=value; 
    1202 +    else { 
    1203 +      fprintf(stderr,"illegal value: %s\n",name); 
    1204 +      return -1; 
    1205 +    } 
    1206 +  }     
    1207 + 
    1208 +  return 0; 
    1209 +} 
    1210 + 
    1211 +static int wrr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) 
    1212 +{ 
    1213 +  if(n->nlmsg_flags & NLM_F_CREATE) { 
    1214 +    // This is a create request: 
    1215 +    struct tc_wrr_qdisc_crt opt; 
    1216 +        
    1217 +    int sour,dest,ip,mac,masq; 
    1218 + 
    1219 +    if(argc<4) { 
    1220 +      fprintf(stderr, "Usage: ... wrr sour|dest ip|masq|mac maxclasses proxymaxcon [penalty-setup]\n"); 
    1221 +      return -1; 
    1222 +    }     
    1223  
    1224 +    // Read sour/dest: 
    1225 +    memset(&opt,0,sizeof(opt)); 
    1226 +    sour=!strcmp(argv[0],"sour"); 
    1227 +    dest=!strcmp(argv[0],"dest");       
    1228 +        
    1229 +    if(!sour && !dest) { 
    1230 +      fprintf(stderr,"sour or dest must be specified\n"); 
    1231 +      return -1; 
    1232 +    }   
    1233 + 
    1234 +    // Read ip/mac 
    1235 +    ip=!strcmp(argv[1],"ip"); 
    1236 +    mac=!strcmp(argv[1],"mac");         
    1237 +    masq=!strcmp(argv[1],"masq");       
    1238 + 
    1239 +    if(!ip && !mac && !masq) { 
    1240 +      fprintf(stderr,"ip, masq or mac must be specified\n"); 
    1241 +      return -1; 
    1242 +    }   
    1243 + 
    1244 +    opt.srcaddr=sour;           
    1245 +    opt.usemac=mac; 
    1246 +    opt.usemasq=masq;           
    1247 +    opt.bands_max=atoi(argv[2]); 
    1248 +     
    1249 +    opt.proxy_maxconn=atoi(argv[3]); 
    1250 +     
    1251 +    // Read weights: 
    1252 +    if(wrr_parse_qdisc_weight(argc-4,argv+4,&opt.qdisc_modf)<0) return -1; 
    1253 +    if(opt.qdisc_modf.weight1.weight_mode==-1) opt.qdisc_modf.weight1.weight_mode=0; 
    1254 +    if(opt.qdisc_modf.weight2.weight_mode==-1) opt.qdisc_modf.weight2.weight_mode=0; 
    1255 +                
    1256 +    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
    1257 +  } else { 
    1258 +    struct tc_wrr_qdisc_modf_std opt; 
    1259 +    char qdisc,class; 
    1260 +     
    1261 +    // This is a modify request: 
    1262 +    if(argc<1) { 
    1263 +      fprintf(stderr,"... qdisc ... or ... class ...\n"); 
    1264 +      return -1; 
    1265 +    } 
    1266 +             
    1267 +    qdisc=!strcmp(argv[0],"qdisc"); 
    1268 +    class=!strcmp(argv[0],"class"); 
    1269 + 
    1270 +    if(!qdisc && !class) { 
    1271 +      fprintf(stderr,"qdisc or class must be specified\n"); 
    1272 +      return -1; 
    1273 +    } 
    1274 +       
    1275 +    argc--; 
    1276 +    argv++; 
    1277 +       
    1278 +    opt.proxy=0; 
    1279 +     
    1280 +    if(qdisc) { 
    1281 +      opt.change_class=0; 
    1282 +      if(wrr_parse_qdisc_weight(argc, argv, &opt.qdisc_modf)<0) return -1; 
    1283 +    } else { 
    1284 +      int a0,a1,a2,a3,a4=0,a5=0;       
    1285 + 
    1286 +      opt.change_class=1; 
    1287 +       
    1288 +      if(argc<1) { 
    1289 +        fprintf(stderr,"... <mac>|<ip>|<masq> ...\n"); 
    1290 +        return -1; 
    1291 +      } 
    1292 +      memset(opt.addr,0,sizeof(opt.addr)); 
    1293 + 
    1294 +      if((sscanf(argv[0],"%i.%i.%i.%i",&a0,&a1,&a2,&a3)!=4) && 
    1295 +         (sscanf(argv[0],"%x:%x:%x:%x:%x:%x",&a0,&a1,&a2,&a3,&a4,&a5)!=6)) { 
    1296 +       fprintf(stderr,"Wrong format of mac or ip address\n"); 
    1297 +       return -1; 
    1298 +      } 
    1299 +       
    1300 +      opt.addr[0]=a0; opt.addr[1]=a1; opt.addr[2]=a2; 
    1301 +      opt.addr[3]=a3; opt.addr[4]=a4; opt.addr[5]=a5; 
    1302 + 
    1303 +      if(wrr_parse_class_modf(argc-1, argv+1, &opt.class_modf)<0) return -1; 
    1304 +    }   
    1305  
    1306 +    addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
    1307 +  } 
    1308 +  return 0; 
    1309 +} 
    1310 + 
    1311 +static int wrr_parse_copt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) { 
    1312 +  struct tc_wrr_class_modf opt; 
    1313  
    1314 +  memset(&opt,0,sizeof(opt)); 
    1315 +  if(wrr_parse_class_modf(argc,argv,&opt)<0) return -1; 
    1316  
    1317 +  addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); 
    1318 +  return 0;   
    1319 +}   
    1320 + 
    1321 +static int wrr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) 
    1322 +{ 
    1323 +       struct tc_wrr_qdisc_stats *qopt; 
    1324 + 
    1325 +       if (opt == NULL) 
    1326 +               return 0; 
    1327 + 
    1328 +       if (RTA_PAYLOAD(opt)  < sizeof(*qopt)) 
    1329 +               return -1; 
    1330 +       qopt = RTA_DATA(opt); 
    1331 +        
    1332 +       fprintf(f,"\n  (%s/%s) (maxclasses %i) (usedclasses %i) (reused classes %i)\n", 
    1333 +         qopt->qdisc_crt.srcaddr ? "sour" : "dest", 
    1334 +         qopt->qdisc_crt.usemac  ? "mac"  : (qopt->qdisc_crt.usemasq ? "masq" : "ip"),    
    1335 +         qopt->qdisc_crt.bands_max,                       
    1336 +         qopt->bands_cur, 
    1337 +         qopt->bands_reused 
    1338 +         ); 
    1339 +          
    1340 +       if(qopt->qdisc_crt.proxy_maxconn) { 
    1341 +         fprintf(f,"  (proxy maxcon %i) (proxy curcon %i)\n", 
    1342 +           qopt->qdisc_crt.proxy_maxconn,qopt->proxy_curconn); 
    1343 +       } 
    1344 +        
    1345 +       fprintf(f,"  (waiting classes %i) (packets requeued %i) (priosum: %Lg)\n", 
    1346 +         qopt->nodes_in_heap, 
    1347 +         qopt->packets_requed, 
    1348 +         qopt->priosum/((long double)((__u32)-1)) 
    1349 +         ); 
    1350 + 
    1351 +       fprintf(f,"  (wmode1 %i) (wmode2 %i) \n", 
    1352 +         qopt->qdisc_crt.qdisc_modf.weight1.weight_mode, 
    1353 +         qopt->qdisc_crt.qdisc_modf.weight2.weight_mode); 
    1354 +          
    1355 +       return 0; 
    1356 +} 
    1357 + 
    1358 +static int wrr_print_copt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) { 
    1359 +  struct tc_wrr_class_stats *copt; 
    1360 +  long double d=(__u64)-1; 
    1361 + 
    1362 +  if (opt == NULL) return 0; 
    1363 + 
    1364 +  if (RTA_PAYLOAD(opt)  < sizeof(*copt)) 
    1365 +    return -1; 
    1366 +  copt = RTA_DATA(opt); 
    1367 + 
    1368 +  if(!copt->used) { 
    1369 +    fprintf(f,"(unused)"); 
    1370 +    return 0; 
    1371 +  } 
    1372  
    1373 +  if(copt->usemac) { 
    1374 +    fprintf(f,"\n  (address: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", 
    1375 +      copt->addr[0],copt->addr[1],copt->addr[2], 
    1376 +      copt->addr[3],copt->addr[4],copt->addr[5]); 
    1377 +  } else {      
    1378 +    fprintf(f,"\n  (address: %i.%i.%i.%i)\n",copt->addr[0],copt->addr[1],copt->addr[2],copt->addr[3]); 
    1379 +  }     
    1380  
    1381 +  fprintf(f,"  (total weight: %Lg) (current position: %i) (counters: %u %u : %u %u)\n", 
    1382 +    (copt->class_modf.weight1.val/d)*(copt->class_modf.weight2.val/d), 
    1383 +    copt->heappos, 
    1384 +    (unsigned)(copt->penal_ms>>32), 
    1385 +    (unsigned)(copt->penal_ms & 0xffffffffU), 
    1386 +    (unsigned)(copt->penal_ls>>32), 
    1387 +    (unsigned)(copt->penal_ls & 0xffffffffU) 
    1388 +    ); 
    1389 +     
    1390 +  fprintf(f,"  Pars 1: (weight %Lg) (decr: %Lg) (incr: %Lg) (min: %Lg) (max: %Lg)\n", 
    1391 +    copt->class_modf.weight1.val/d, 
    1392 +    copt->class_modf.weight1.decr/d, 
    1393 +    copt->class_modf.weight1.incr/d, 
    1394 +    copt->class_modf.weight1.min/d, 
    1395 +    copt->class_modf.weight1.max/d); 
    1396 + 
    1397 +  fprintf(f,"  Pars 2: (weight %Lg) (decr: %Lg) (incr: %Lg) (min: %Lg) (max: %Lg)", 
    1398 +    copt->class_modf.weight2.val/d, 
    1399 +    copt->class_modf.weight2.decr/d, 
    1400 +    copt->class_modf.weight2.incr/d, 
    1401 +    copt->class_modf.weight2.min/d, 
    1402 +    copt->class_modf.weight2.max/d); 
    1403  
    1404 +  return 0; 
    1405 +} 
    1406 + 
    1407 +static int wrr_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) 
    1408 +{ 
    1409 +       return 0; 
    1410 +} 
    1411 + 
    1412 + 
    1413 +struct qdisc_util wrr_qdisc_util = { 
    1414 +       .id = "wrr", 
    1415 +       .parse_qopt = wrr_parse_opt, 
    1416 +       .print_qopt = wrr_print_opt, 
    1417 +       .print_xstats = wrr_print_xstats, 
    1418 +       .parse_copt = wrr_parse_copt, 
    1419 +       .print_copt = wrr_print_copt 
    1420 +}; 
     3035+routef \- flush routes 
     3036+.SH "SYNTAX" 
     3037+.LP  
     3038+routel [\fItablenr\fP [\fIraw ip args...\fP]] 
     3039+.br  
     3040+routef 
     3041+.SH "DESCRIPTION" 
     3042+.LP  
     3043+These programs are a set of helper scripts you can use instead of raw iproute2 commands. 
     3044+.br 
     3045+The routel script will list routes in a format that some might consider easier to interpret then the ip route list equivalent. 
     3046+.br 
     3047+The routef script does not take any arguments and will simply flush the routing table down the drain. Beware! This means deleting all routes which will make your network unusable! 
     3048+ 
     3049+.SH "FILES" 
     3050+.LP  
     3051+\fI/usr/bin/routef\fP  
     3052+.br  
     3053+\fI/usr/bin/routel\fP  
     3054+.SH "AUTHORS" 
     3055+.LP  
     3056+The routel script was written by Stephen R. van den Berg <srb@cuci.nl>, 1999/04/18 and donated to the public domain. 
     3057+.br 
     3058+This manual page was written by Andreas Henriksson  <andreas@fatal.se>, for the Debian GNU/Linux system. 
     3059+.SH "SEE ALSO" 
     3060+.LP  
     3061+ip(8) 
  • trunk/package/iproute2/patches/006-iproute2-tc_esfq.patch

    r7612 r10147  
    1 diff -urN --exclude=.svn iproute2-2.6.11-050330/include/linux/pkt_sched.h iproute2-2.6.11-050330/include/linux/pkt_sched.h 
    2 --- iproute2-2.6.11-050330/include/linux/pkt_sched.h    2007-05-04 22:21:48.000000000 -0400 
    3 +++ iproute2-2.6.11-050330/include/linux/pkt_sched.h    2007-05-04 22:27:12.000000000 -0400 
    4 @@ -174,8 +174,38 @@ 
     1diff -Naur iproute-2.6.20-070313.orig/include/linux/pkt_sched.h iproute-2.6.20-070313/include/linux/pkt_sched.h 
     2--- iproute-2.6.20-070313.orig/include/linux/pkt_sched.h        2007-03-13 14:50:56.000000000 -0700 
     3+++ iproute-2.6.20-070313/include/linux/pkt_sched.h     2007-06-09 11:32:22.000000000 -0700 
     4@@ -146,8 +146,37 @@ 
    55  * 
    66  *     The only reason for this is efficiency, it is possible 
    77  *     to change these parameters in compile time. 
    88+ * 
    9 + *     If you need to play with these values use esfq instead. 
     9+ *     If you need to play with these values, use esfq instead. 
    1010  */ 
    1111  
     
    1818+       TCA_SFQ_HASH_DST, 
    1919+       TCA_SFQ_HASH_SRC, 
     20+       TCA_SFQ_HASH_FWMARK, 
    2021+       /* conntrack */ 
    2122+       TCA_SFQ_HASH_CTORIGDST, 
     
    3637+}; 
    3738+ 
    38 + 
    39 + 
    4039 /* RED section */ 
    4140  
    4241 enum 
    43 @@ -551,8 +580,37 @@ 
    44   * 
    45   *     The only reason for this is efficiency, it is possible 
    46   *     to change these parameters in compile time. 
    47 + * 
    48 + *     If you need to play with these values use esfq instead. 
    49   */ 
    50   
    51 +/* ESFQ section */ 
    52 + 
    53 +enum 
    54 +{ 
    55 +       /* traditional */ 
    56 +       TCA_SFQ_HASH_CLASSIC, 
    57 +       TCA_SFQ_HASH_DST, 
    58 +       TCA_SFQ_HASH_SRC, 
    59 +       /* conntrack */ 
    60 +       TCA_SFQ_HASH_CTORIGDST, 
    61 +       TCA_SFQ_HASH_CTORIGSRC, 
    62 +       TCA_SFQ_HASH_CTREPLDST, 
    63 +       TCA_SFQ_HASH_CTREPLSRC, 
    64 +       TCA_SFQ_HASH_CTNATCHG, 
    65 +}; 
    66 + 
    67 +struct tc_esfq_qopt 
    68 +{ 
    69 +       unsigned        quantum;        /* Bytes per round allocated to flow */ 
    70 +       int             perturb_period; /* Period of hash perturbation */ 
    71 +       __u32           limit;          /* Maximal packets in queue */ 
    72 +       unsigned        divisor;        /* Hash divisor  */ 
    73 +       unsigned        flows;          /* Maximal number of flows  */ 
    74 +       unsigned        hash_kind;      /* Hash function to use for flow identification */ 
    75 +}; 
    76 + 
    77 + 
    78  /* RED section */ 
    79   
    80  enum 
    81 diff -urN --exclude=.svn iproute2-2.6.11-050330/tc/Makefile iproute2-2.6.11-050330/tc/Makefile 
    82 --- iproute2-2.6.11-050330/tc/Makefile  2007-05-04 22:21:48.000000000 -0400 
    83 +++ iproute2-2.6.11-050330/tc/Makefile  2007-05-04 22:27:37.000000000 -0400 
    84 @@ -6,6 +6,7 @@ 
     42diff -Naur iproute-2.6.20-070313.orig/tc/Makefile iproute-2.6.20-070313/tc/Makefile 
     43--- iproute-2.6.20-070313.orig/tc/Makefile      2007-03-13 14:50:56.000000000 -0700 
     44+++ iproute-2.6.20-070313/tc/Makefile   2007-06-09 00:39:44.000000000 -0700 
     45@@ -7,6 +7,7 @@ 
    8546 TCMODULES := 
    8647 TCMODULES += q_fifo.o 
     
    9051 TCMODULES += q_prio.o 
    9152 TCMODULES += q_tbf.o 
    92 diff -urN --exclude=.svn iproute2-2.6.11-050330/tc/q_esfq.c iproute2-2.6.11-050330/tc/q_esfq.c 
    93 --- iproute2-2.6.11-050330/tc/q_esfq.c  1969-12-31 19:00:00.000000000 -0500 
    94 +++ iproute2-2.6.11-050330/tc/q_esfq.c  2007-05-04 22:37:54.000000000 -0400 
    95 @@ -0,0 +1,200 @@ 
     53diff -Naur iproute-2.6.20-070313.orig/tc/q_esfq.c iproute-2.6.20-070313/tc/q_esfq.c 
     54--- iproute-2.6.20-070313.orig/tc/q_esfq.c      1969-12-31 16:00:00.000000000 -0800 
     55+++ iproute-2.6.20-070313/tc/q_esfq.c   2007-06-09 11:38:59.000000000 -0700 
     56@@ -0,0 +1,198 @@ 
    9657+/* 
    9758+ * q_esfq.c            ESFQ. 
     
    12889+       fprintf(stderr, "Usage: ... esfq [ perturb SECS ] [ quantum BYTES ] [ depth FLOWS ]\n\t[ divisor HASHBITS ] [ limit PKTS ] [ hash HASHTYPE]\n"); 
    12990+       fprintf(stderr,"Where: \n"); 
    130 +       fprintf(stderr,"HASHTYPE := { classic | src | dst | ctorigdst | ctorigsrc | ctrepldst | ctreplsrc | ctnatchg }\n"); 
     91+       fprintf(stderr,"HASHTYPE := { classic | src | dst | fwmark | ctorigdst | ctorigsrc | ctrepldst | ctreplsrc | ctnatchg}\n"); 
    13192+} 
    13293+ 
     
    170131+                               return -1; 
    171132+                       } 
    172 +                       if(opt.divisor >= 14) { 
    173 +                               fprintf(stderr, "Illegal \"divisor\": must be < 14\n"); 
     133+                       if(opt.divisor >= 15) { 
     134+                               fprintf(stderr, "Illegal \"divisor\": must be < 15\n"); 
    174135+                               return -1; 
    175136+                       } 
     
    185146+               } else if (strcmp(*argv, "hash") == 0) { 
    186147+                       NEXT_ARG(); 
    187 +                       if(strcmp(*argv, "classic") == 0) { 
    188 +                               opt.hash_kind= TCA_SFQ_HASH_CLASSIC; 
    189 +                       } else  
    190 +                       if(strcmp(*argv, "dst") == 0) { 
    191 +                               opt.hash_kind= TCA_SFQ_HASH_DST; 
    192 +                       } else 
    193 +                       if(strcmp(*argv, "src") == 0) { 
    194 +                               opt.hash_kind= TCA_SFQ_HASH_SRC; 
    195 +                       } else 
    196 +                       if(strcmp(*argv, "ctorigsrc") == 0) { 
    197 +                               opt.hash_kind= TCA_SFQ_HASH_CTORIGSRC; 
    198 +                       } else 
    199 +                       if(strcmp(*argv, "ctorigdst") == 0) { 
    200 +                               opt.hash_kind= TCA_SFQ_HASH_CTORIGDST; 
    201 +                       } else 
    202 +                       if(strcmp(*argv, "ctreplsrc") == 0) { 
    203 +                               opt.hash_kind= TCA_SFQ_HASH_CTREPLSRC; 
    204 +                       } else 
    205 +                       if(strcmp(*argv, "ctrepldst") == 0) { 
    206 +                               opt.hash_kind= TCA_SFQ_HASH_CTREPLDST; 
    207 +                       } else 
    208 +                       if(strcmp(*argv, "ctnatchg") == 0) { 
    209 +                               opt.hash_kind= TCA_SFQ_HASH_CTNATCHG; 
     148+                       if (strcmp(*argv, "classic") == 0) { 
     149+                               opt.hash_kind = TCA_SFQ_HASH_CLASSIC; 
     150+                       } else if (strcmp(*argv, "dst") == 0) { 
     151+                               opt.hash_kind = TCA_SFQ_HASH_DST; 
     152+                       } else if (strcmp(*argv, "src") == 0) { 
     153+                               opt.hash_kind = TCA_SFQ_HASH_SRC; 
     154+                       } else if (strcmp(*argv, "fwmark") == 0) { 
     155+                               opt.hash_kind = TCA_SFQ_HASH_FWMARK; 
     156+                       } else if (strcmp(*argv, "ctorigsrc") == 0) { 
     157+                               opt.hash_kind = TCA_SFQ_HASH_CTORIGSRC; 
     158+                       } else if (strcmp(*argv, "ctorigdst") == 0) { 
     159+                               opt.hash_kind = TCA_SFQ_HASH_CTORIGDST; 
     160+                       } else if (strcmp(*argv, "ctreplsrc") == 0) { 
     161+                               opt.hash_kind = TCA_SFQ_HASH_CTREPLSRC; 
     162+                       } else if (strcmp(*argv, "ctrepldst") == 0) { 
     163+                               opt.hash_kind = TCA_SFQ_HASH_CTREPLDST; 
     164+                       } else if (strcmp(*argv, "ctnatchg") == 0) { 
     165+                               opt.hash_kind = TCA_SFQ_HASH_CTNATCHG; 
    210166+                       } else { 
    211167+                               fprintf(stderr, "Illegal \"hash\"\n"); 
     
    261217+               fprintf(f,"src"); 
    262218+               break; 
     219+       case TCA_SFQ_HASH_FWMARK: 
     220+               fprintf(f,"fwmark"); 
     221+               break; 
    263222+       case TCA_SFQ_HASH_CTORIGSRC: 
    264223+               fprintf(f,"ctorigsrc"); 
  • trunk/target/linux/generic-2.6/patches-2.6.23/200-sched_esfq.patch

    r9114 r10147  
    1 Index: linux-2.6.23-rc6/include/linux/pkt_sched.h 
    2 =================================================================== 
    3 --- linux-2.6.23-rc6.orig/include/linux/pkt_sched.h     2007-09-21 16:23:53.000000000 +0800 
    4 +++ linux-2.6.23-rc6/include/linux/pkt_sched.h  2007-09-21 16:24:04.000000000 +0800 
    5 @@ -155,8 +155,40 @@ 
     1diff -Naur linux-2.6.21.5.orig/include/linux/pkt_sched.h linux-2.6.21.5/include/linux/pkt_sched.h 
     2--- linux-2.6.21.5.orig/include/linux/pkt_sched.h       2007-06-11 11:37:06.000000000 -0700 
     3+++ linux-2.6.21.5/include/linux/pkt_sched.h    2007-06-22 22:53:46.000000000 -0700 
     4@@ -146,8 +146,37 @@ 
    65  * 
    76  *     The only reason for this is efficiency, it is possible 
    87  *     to change these parameters in compile time. 
    9 + * 
    10 + *     If you need to play with these values use esfq instead. 
     8+ *      
     9+ *     If you need to play with these values, use esfq instead. 
    1110  */ 
    1211  
     
    2019+       TCA_SFQ_HASH_SRC, 
    2120+       TCA_SFQ_HASH_FWMARK, 
    22 +        /* direct */ 
    23 +       TCA_SFQ_HASH_DSTDIR, 
    24 +       TCA_SFQ_HASH_SRCDIR, 
    25 +       TCA_SFQ_HASH_FWMARKDIR, 
    2621+       /* conntrack */ 
    2722+       TCA_SFQ_HASH_CTORIGDST, 
     
    2924+       TCA_SFQ_HASH_CTREPLDST, 
    3025+       TCA_SFQ_HASH_CTREPLSRC, 
     26+       TCA_SFQ_HASH_CTNATCHG, 
    3127+}; 
    3228+ 
     
    4440  
    4541 enum 
    46 Index: linux-2.6.23-rc6/net/sched/Kconfig 
    47 =================================================================== 
    48 --- linux-2.6.23-rc6.orig/net/sched/Kconfig     2007-09-21 16:23:53.000000000 +0800 
    49 +++ linux-2.6.23-rc6/net/sched/Kconfig  2007-09-21 16:24:04.000000000 +0800 
    50 @@ -144,6 +144,26 @@ 
     42diff -Naur linux-2.6.21.5.orig/net/sched/Kconfig linux-2.6.21.5/net/sched/Kconfig 
     43--- linux-2.6.21.5.orig/net/sched/Kconfig       2007-06-11 11:37:06.000000000 -0700 
     44+++ linux-2.6.21.5/net/sched/Kconfig    2007-06-23 14:11:02.000000000 -0700 
     45@@ -189,6 +189,37 @@ 
    5146          To compile this code as a module, choose M here: the 
    5247          module will be called sch_sfq. 
     
    6863+         several other hashing methods, such as by src IP or by dst IP, which 
    6964+         can be more fair to users in some networking situations. 
    70 + 
     65+          
    7166+         To compile this code as a module, choose M here: the 
    7267+         module will be called sch_esfq. 
     68+ 
     69+config NET_SCH_ESFQ_NFCT 
     70+       bool "Connection Tracking Hash Types" 
     71+       depends on NET_SCH_ESFQ && NF_CONNTRACK 
     72+       ---help--- 
     73+         Say Y here to enable support for hashing based on netfilter connection 
     74+         tracking information. This is useful for a router that is also using 
     75+         NAT to connect privately-addressed hosts to the Internet. If you want 
     76+         to provide fair distribution of upstream bandwidth, ESFQ must use 
     77+         connection tracking information, since all outgoing packets will share 
     78+         the same source address. 
    7379+ 
    7480 config NET_SCH_TEQL 
    7581        tristate "True Link Equalizer (TEQL)" 
    7682        ---help--- 
    77 Index: linux-2.6.23-rc6/net/sched/Makefile 
    78 =================================================================== 
    79 --- linux-2.6.23-rc6.orig/net/sched/Makefile    2007-09-21 16:23:53.000000000 +0800 
    80 +++ linux-2.6.23-rc6/net/sched/Makefile 2007-09-21 16:24:04.000000000 +0800 
    81 @@ -22,6 +22,7 @@ 
     83diff -Naur linux-2.6.21.5.orig/net/sched/Makefile linux-2.6.21.5/net/sched/Makefile 
     84--- linux-2.6.21.5.orig/net/sched/Makefile      2007-06-11 11:37:06.000000000 -0700 
     85+++ linux-2.6.21.5/net/sched/Makefile   2007-06-22 22:53:46.000000000 -0700 
     86@@ -23,6 +23,7 @@ 
    8287 obj-$(CONFIG_NET_SCH_INGRESS)  += sch_ingress.o  
    8388 obj-$(CONFIG_NET_SCH_DSMARK)   += sch_dsmark.o 
     
    8792 obj-$(CONFIG_NET_SCH_TEQL)     += sch_teql.o 
    8893 obj-$(CONFIG_NET_SCH_PRIO)     += sch_prio.o 
    89 Index: linux-2.6.23-rc6/net/sched/sch_esfq.c 
    90 =================================================================== 
    91 --- /dev/null   1970-01-01 00:00:00.000000000 +0000 
    92 +++ linux-2.6.23-rc6/net/sched/sch_esfq.c       2007-09-21 16:24:04.000000000 +0800 
    93 @@ -0,0 +1,704 @@ 
     94diff -Naur linux-2.6.21.5.orig/net/sched/sch_esfq.c linux-2.6.21.5/net/sched/sch_esfq.c 
     95--- linux-2.6.21.5.orig/net/sched/sch_esfq.c    1969-12-31 16:00:00.000000000 -0800 
     96+++ linux-2.6.21.5/net/sched/sch_esfq.c 2007-06-23 19:18:00.000000000 -0700 
     97@@ -0,0 +1,702 @@ 
    9498+/* 
    9599+ * net/sched/sch_esfq.c        Extended Stochastic Fairness Queueing discipline. 
     
    112116+ *             Maintenance of the Linux 2.6 port. 
    113117+ *             Added fwmark hash (thanks to Robert Kurjata). 
    114 + *             Added direct hashing for src, dst, and fwmark. 
    115118+ *             Added usage of jhash. 
    116 + * 
     119+ *             Added conntrack support. 
     120+ *             Added ctnatchg hash (thanks to Ben Pfountz). 
    117121+ */ 
    118122+ 
     
    144148+#include <net/pkt_sched.h> 
    145149+#include <linux/jhash.h> 
    146 + 
    147 +#ifdef CONFIG_NF_CONNTRACK_ENABLED 
    148150+#include <net/netfilter/nf_conntrack.h> 
    149 +#endif 
    150151+ 
    151152+/*     Stochastic Fairness Queuing algorithm. 
     
    153154+       The difference is that you can change limit, depth, 
    154155+       hash table size and choose alternate hash types. 
    155 + 
     156+        
    156157+       classic:        same as in sch_sfq.c 
    157158+       dst:            destination IP address 
    158159+       src:            source IP address 
    159 +       fwmark:         netfilter mark value 
    160 +       dst_direct: 
    161 +       src_direct: 
    162 +       fwmark_direct:  direct hashing of the above sources 
     160+       fwmark:         netfilter mark value 
    163161+       ctorigdst:      original destination IP address 
    164162+       ctorigsrc:      original source IP address 
    165163+       ctrepldst:      reply destination IP address 
    166 +       ctreplsrc:      reply source IP 
    167 + 
     164+       ctreplsrc:      reply source IP  
     165+        
    168166+*/ 
    169167+ 
     168+#define ESFQ_HEAD 0 
     169+#define ESFQ_TAIL 1 
    170170+ 
    171171+/* This type should contain at least SFQ_DEPTH*2 values */ 
     
    199199+       struct sk_buff_head     *qs;            /* Slot queue */ 
    200200+       struct esfq_head        *dep;           /* Linked list of slots, indexed by depth */ 
    201 +       unsigned        dyn_min;        /* For dynamic divisor adjustment; minimum value seen */ 
    202 +       unsigned        dyn_max;        /*                                 maximum value seen */ 
    203 +       unsigned        dyn_range;      /*                                 saved range */ 
    204201+}; 
    205202+ 
     
    217214+}; 
    218215+ 
    219 +/* Hash input values directly into the "nearest" slot, taking into account the 
    220 + * range of input values seen. This is most useful when the hash table is at 
    221 + * least as large as the range of possible values. 
    222 + * Note: this functionality was added before the change to using jhash, and may 
    223 + * no longer be useful. */ 
    224 +static __inline__ unsigned esfq_hash_direct(struct esfq_sched_data *q, u32 h) 
    225 +{ 
    226 +       /* adjust minimum and maximum */ 
    227 +       if (h < q->dyn_min || h > q->dyn_max) { 
    228 +               q->dyn_min = h < q->dyn_min ? h : q->dyn_min; 
    229 +               q->dyn_max = h > q->dyn_max ? h : q->dyn_max; 
    230 + 
    231 +               /* find new range */ 
    232 +               if ((q->dyn_range = q->dyn_max - q->dyn_min) >= q->hash_divisor) 
    233 +                       printk(KERN_WARNING "ESFQ: (direct hash) Input range %u is larger than hash " 
    234 +                                       "table. See ESFQ README for details.\n", q->dyn_range); 
    235 +       } 
    236 + 
    237 +       /* hash input values into slot numbers */ 
    238 +       if (q->dyn_min == q->dyn_max) 
    239 +               return 0; /* only one value seen; avoid division by 0 */ 
    240 +       else 
    241 +               return (h - q->dyn_min) * (q->hash_divisor - 1) / q->dyn_range; 
    242 +} 
    243 + 
    244216+static __inline__ unsigned esfq_jhash_1word(struct esfq_sched_data *q,u32 a) 
    245217+{ 
     
    257229+} 
    258230+ 
    259 + 
    260231+static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb) 
    261232+{ 
    262233+       struct esfq_packet_info info; 
    263 +#ifdef CONFIG_NF_CONNTRACK_ENABLED 
     234+#ifdef CONFIG_NET_SCH_ESFQ_NFCT 
    264235+       enum ip_conntrack_info ctinfo; 
    265236+       struct nf_conn *ct = nf_ct_get(skb, &ctinfo); 
    266237+#endif 
    267 + 
     238+        
    268239+       switch (skb->protocol) { 
    269240+       case __constant_htons(ETH_P_IP): 
    270241+       { 
    271 +               struct iphdr *iph = ip_hdr(skb); 
     242+               struct iphdr *iph = skb->nh.iph; 
    272243+               info.dst = iph->daddr; 
    273244+               info.src = iph->saddr; 
     
    285256+       case __constant_htons(ETH_P_IPV6): 
    286257+       { 
    287 +               struct ipv6hdr *iph = ipv6_hdr(skb); 
     258+               struct ipv6hdr *iph = skb->nh.ipv6h; 
    288259+               /* Hash ipv6 addresses into a u32. This isn't ideal, 
    289260+                * but the code is simple. */ 
     
    308279+       info.mark = skb->mark; 
    309280+ 
    310 +#ifdef CONFIG_NF_CONNTRACK_ENABLED 
     281+#ifdef CONFIG_NET_SCH_ESFQ_NFCT 
    311282+       /* defaults if there is no conntrack info */ 
    312283+       info.ctorigsrc = info.src; 
     
    333304+#endif 
    334305+ 
    335 +       switch(q->hash_kind) 
    336 +       { 
     306+       switch(q->hash_kind) { 
    337307+       case TCA_SFQ_HASH_CLASSIC: 
    338308+               return esfq_jhash_3words(q, info.dst, info.src, info.proto); 
    339309+       case TCA_SFQ_HASH_DST: 
    340310+               return esfq_jhash_1word(q, info.dst); 
    341 +       case TCA_SFQ_HASH_DSTDIR: 
    342 +               return esfq_hash_direct(q, ntohl(info.dst)); 
    343311+       case TCA_SFQ_HASH_SRC: 
    344312+               return esfq_jhash_1word(q, info.src); 
    345 +       case TCA_SFQ_HASH_SRCDIR: 
    346 +               return esfq_hash_direct(q, ntohl(info.src)); 
    347313+       case TCA_SFQ_HASH_FWMARK: 
    348314+               return esfq_jhash_1word(q, info.mark); 
    349 +       case TCA_SFQ_HASH_FWMARKDIR: 
    350 +               return esfq_hash_direct(q, info.mark); 
    351 +#ifdef CONFIG_NF_CONNTRACK_ENABLED 
     315+#ifdef CONFIG_NET_SCH_ESFQ_NFCT 
    352316+       case TCA_SFQ_HASH_CTORIGDST: 
    353317+               return esfq_jhash_1word(q, info.ctorigdst); 
     
    358322+       case TCA_SFQ_HASH_CTREPLSRC: 
    359323+               return esfq_jhash_1word(q, info.ctreplsrc); 
     324+       case TCA_SFQ_HASH_CTNATCHG: 
     325+       { 
     326+               if (info.ctorigdst == info.ctreplsrc) 
     327+                       return esfq_jhash_1word(q, info.ctorigsrc); 
     328+               return esfq_jhash_1word(q, info.ctreplsrc); 
     329+       } 
    360330+#endif 
    361331+       default: 
     
    452422+} 
    453423+ 
    454 +static int 
    455 +esfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) 
    456 +{ 
    457 +       struct esfq_sched_data *q = qdisc_priv(sch); 
     424+static void esfq_q_enqueue(struct sk_buff *skb, struct esfq_sched_data *q, unsigned int end) 
     425+{ 
    458426+       unsigned hash = esfq_hash(q, skb); 
    459427+       unsigned depth = q->depth; 
     
    465433+               q->hash[x] = hash; 
    466434+       } 
    467 +       sch->qstats.backlog += skb->len; 
    468 +       __skb_queue_tail(&q->qs[x], skb); 
     435+ 
     436+       if (end == ESFQ_TAIL) 
     437+               __skb_queue_tail(&q->qs[x], skb); 
     438+       else 
     439+               __skb_queue_head(&q->qs[x], skb); 
     440+ 
    469441+       esfq_inc(q, x); 
    470442+       if (q->qs[x].qlen == 1) {               /* The flow is new */ 
     
    479451+               } 
    480452+       } 
     453+} 
     454+ 
     455+static int esfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) 
     456+{ 
     457+       struct esfq_sched_data *q = qdisc_priv(sch); 
     458+       esfq_q_enqueue(skb, q, ESFQ_TAIL); 
     459+       sch->qstats.backlog += skb->len; 
    481460+       if (++sch->q.qlen < q->limit-1) { 
    482461+               sch->bstats.bytes += skb->len; 
     
    485464+       } 
    486465+ 
     466+       sch->qstats.drops++; 
    487467+       esfq_drop(sch); 
    488468+       return NET_XMIT_CN; 
    489469+} 
    490470+ 
    491 +static int 
    492 +esfq_requeue(struct sk_buff *skb, struct Qdisc* sch) 
    493 +{ 
    494 +       struct esfq_sched_data *q = qdisc_priv(sch); 
    495 +       unsigned hash = esfq_hash(q, skb); 
    496 +       unsigned depth = q->depth; 
    497 +       esfq_index x; 
    498 + 
    499 +       x = q->ht[hash]; 
    500 +       if (x == depth) { 
    501 +               q->ht[hash] = x = q->dep[depth].next; 
    502 +               q->hash[x] = hash; 
    503 +       } 
     471+ 
     472+static int esfq_requeue(struct sk_buff *skb, struct Qdisc* sch) 
     473+{ 
     474+       struct esfq_sched_data *q = qdisc_priv(sch); 
     475+       esfq_q_enqueue(skb, q, ESFQ_HEAD); 
    504476+       sch->qstats.backlog += skb->len; 
    505 +       __skb_queue_head(&q->qs[x], skb); 
    506 +       esfq_inc(q, x); 
    507 +       if (q->qs[x].qlen == 1) {               /* The flow is new */ 
    508 +               if (q->tail == depth) { /* It is the first flow */ 
    509 +                       q->tail = x; 
    510 +                       q->next[x] = x; 
    511 +                       q->allot[x] = q->quantum; 
    512 +               } else { 
    513 +                       q->next[x] = q->next[q->tail]; 
    514 +                       q->next[q->tail] = x; 
    515 +                       q->tail = x; 
    516 +               } 
    517 +       } 
    518477+       if (++sch->q.qlen < q->limit - 1) { 
    519478+               sch->qstats.requeues++; 
     
    526485+} 
    527486+ 
    528 + 
    529 + 
    530 + 
    531 +static struct sk_buff * 
    532 +esfq_dequeue(struct Qdisc* sch) 
    533 +{ 
    534 +       struct esfq_sched_data *q = qdisc_priv(sch); 
     487+static struct sk_buff *esfq_q_dequeue(struct esfq_sched_data *q) 
     488+{ 
    535489+       struct sk_buff *skb; 
    536490+       unsigned depth = q->depth; 
     
    540494+       if (q->tail == depth) 
    541495+               return NULL; 
    542 + 
     496+        
    543497+       a = old_a = q->next[q->tail]; 
    544 + 
     498+        
    545499+       /* Grab packet */ 
    546500+       skb = __skb_dequeue(&q->qs[a]); 
    547501+       esfq_dec(q, a); 
    548 +       sch->q.qlen--; 
    549 +       sch->qstats.backlog -= skb->len; 
    550 + 
     502+        
    551503+       /* Is the slot empty? */ 
    552504+       if (q->qs[a].qlen == 0) { 
     
    564516+               q->allot[a] += q->quantum; 
    565517+       } 
    566 + 
     518+        
    567519+       return skb; 
    568520+} 
    569521+ 
    570 +static void 
    571 +esfq_reset(struct Qdisc* sch) 
    572 +{ 
     522+static struct sk_buff *esfq_dequeue(struct Qdisc* sch) 
     523+{ 
     524+       struct esfq_sched_data *q = qdisc_priv(sch); 
    573525+       struct sk_buff *skb; 
    574526+ 
    575 +       while ((skb = esfq_dequeue(sch)) != NULL) 
    576 +               kfree_skb(skb); 
    577 +} 
    578 + 
    579 +static void esfq_perturbation(unsigned long arg) 
    580 +{ 
    581 +       struct Qdisc *sch = (struct Qdisc*)arg; 
    582 +       struct esfq_sched_data *q = qdisc_priv(sch); 
    583 + 
    584 +       q->perturbation = net_random()&0x1F; 
    585 + 
    586 +       if (q->perturb_period) { 
    587 +               q->perturb_timer.expires = jiffies + q->perturb_period; 
    588 +               add_timer(&q->perturb_timer); 
    589 +       } 
    590 +} 
    591 + 
    592 +static int esfq_change(struct Qdisc *sch, struct rtattr *opt) 
    593 +{ 
    594 +       struct esfq_sched_data *q = qdisc_priv(sch); 
    595 +       struct tc_esfq_qopt *ctl = RTA_DATA(opt); 
    596 +       int old_perturb = q->perturb_period; 
    597 + 
    598 +       if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) 
    599 +               return -EINVAL; 
    600 + 
    601 +       sch_tree_lock(sch); 
    602 +       q->quantum = ctl->quantum ? : psched_mtu(sch->dev); 
    603 +       q->perturb_period = ctl->perturb_period*HZ; 
    604 +//     q->hash_divisor = ctl->divisor; 
    605 +//     q->tail = q->limit = q->depth = ctl->flows; 
    606 + 
    607 +       if (ctl->limit) 
    608 +               q->limit = min_t(u32, ctl->limit, q->depth); 
    609 + 
    610 +       if (ctl->hash_kind) { 
    611 +               q->hash_kind = ctl->hash_kind; 
    612 +               if (q->hash_kind != TCA_SFQ_HASH_CLASSIC) 
    613 +                       q->perturb_period = 0; 
    614 +       } 
    615 + 
    616 +       // is sch_tree_lock enough to do this ? 
    617 +       while (sch->q.qlen >= q->limit-1) 
    618 +               esfq_drop(sch); 
    619 + 
    620 +       if (old_perturb) 
    621 +               del_timer(&q->perturb_timer); 
    622 +       if (q->perturb_period) { 
    623 +               q->perturb_timer.expires = jiffies + q->perturb_period; 
    624 +               add_timer(&q->perturb_timer); 
    625 +       } else { 
    626 +               q->perturbation = 0; 
    627 +       } 
    628 +       sch_tree_unlock(sch); 
    629 +       return 0; 
    630 +} 
    631 + 
    632 +static int esfq_init(struct Qdisc *sch, struct rtattr *opt) 
    633 +{ 
    634 +       struct esfq_sched_data *q = qdisc_priv(sch); 
    635 +       struct tc_esfq_qopt *ctl; 
    636 +       esfq_index p = ~0U/2; 
    637 +       int i; 
    638 + 
    639 +       if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl))) 
    640 +               return -EINVAL; 
    641 + 
    642 +       init_timer(&q->perturb_timer); 
    643 +       q->perturb_timer.data = (unsigned long)sch; 
    644 +       q->perturb_timer.function = esfq_perturbation; 
    645 +       q->perturbation = 0; 
    646 +       q->hash_kind = TCA_SFQ_HASH_CLASSIC; 
    647 +       q->max_depth = 0; 
    648 +       q->dyn_min = ~0U; /* maximum value for this type */ 
    649 +       q->dyn_max = 0;  /* dyn_min/dyn_max will be set properly upon first packet */ 
    650 +       if (opt == NULL) { 
    651 +               q->quantum = psched_mtu(sch->dev); 
    652 +               q->perturb_period = 0; 
    653 +               q->hash_divisor = 1024; 
    654 +               q->tail = q->limit = q->depth = 128; 
    655 + 
    656 +       } else { 
    657 +               ctl = RTA_DATA(opt); 
    658 +               q->quantum = ctl->quantum ? : psched_mtu(sch->dev); 
    659 +               q->perturb_period = ctl->perturb_period*HZ; 
    660 +               q->hash_divisor = ctl->divisor ? : 1024; 
    661 +               q->tail = q->limit = q->depth = ctl->flows ? : 128; 
    662 + 
    663 +               if ( q->depth > p - 1 ) 
    664 +                       return -EINVAL; 
    665 + 
    666 +               if (ctl->limit) 
    667 +                       q->limit = min_t(u32, ctl->limit, q->depth); 
    668 + 
    669 +               if (ctl->hash_kind) { 
    670 +                       q->hash_kind = ctl->hash_kind; 
    671 +               } 
    672 + 
    673 +               if (q->perturb_period) { 
    674 +                       q->perturb_timer.expires = jiffies + q->perturb_period; 
    675 +                       add_timer(&q->perturb_timer); 
    676 +               } 
    677 +       } 
    678 + 
    679 +       q->ht = kmalloc(q->hash_divisor*sizeof(esfq_index), GFP_KERNEL); 
    680 +       if (!q->ht) 
    681 +               goto err_case; 
    682 + 
    683 +       q->dep = kmalloc((1+q->depth*2)*sizeof(struct esfq_head), GFP_KERNEL); 
    684 +       if (!q->dep) 
    685 +               goto err_case; 
    686 +       q->next = kmalloc(q->depth*sizeof(esfq_index), GFP_KERNEL); 
    687 +       if (!q->next) 
    688 +               goto err_case; 
    689 + 
    690 +       q->allot = kmalloc(q->depth*sizeof(short), GFP_KERNEL); 
    691 +       if (!q->allot) 
    692 +               goto err_case; 
    693 +       q->hash = kmalloc(q->depth*sizeof(unsigned short), GFP_KERNEL); 
    694 +       if (!q->hash) 
    695 +               goto err_case; 
    696 +       q->qs = kmalloc(q->depth*sizeof(struct sk_buff_head), GFP_KERNEL); 
    697 +       if (!q->qs) 
    698 +               goto err_case; 
    699 + 
    700 +       for (i=0; i< q->hash_divisor; i++) 
    701 +               q->ht[i] = q->depth; 
    702 +       for (i=0; i<q->depth; i++) { 
    703 +               skb_queue_head_init(&q->qs[i]); 
    704 +               q->dep[i+q->depth].next = i+q->depth; 
    705 +               q->dep[i+q->depth].prev = i+q->depth; 
    706 +       } 
    707 + 
    708 +       for (i=0; i<q->depth; i++) 
    709 +               esfq_link(q, i); 
    710 +       return 0; 
    711 +err_case: 
    712 +       del_timer(&q->perturb_timer); 
    713 +       if (q->ht) 
    714 +               kfree(q->ht); 
    715 +       if (q->dep) 
    716 +               kfree(q->dep); 
    717 +       if (q->next) 
    718 +               kfree(q->next); 
    719 +       if (q->allot) 
    720 +               kfree(q->allot); 
    721 +       if (q->hash) 
    722 +               kfree(q->hash); 
    723 +       if (q->qs) 
    724 +               kfree(q->qs); 
    725 +       return -ENOBUFS; 
    726 +} 
    727 + 
    728 +static void esfq_destroy(struct Qdisc *sch) 
    729 +{ 
    730 +       struct esfq_sched_data *q = qdisc_priv(sch); 
     527+       skb = esfq_q_dequeue(q); 
     528+       if (skb == NULL) 
     529+               return NULL; 
     530+       sch->q.qlen--; 
     531+       sch->qstats.backlog -= skb->len; 
     532+       return skb; 
     533+} 
     534+ 
     535+static void esfq_q_destroy(struct esfq_sched_data *q) 
     536+{ 
    731537+       del_timer(&q->perturb_timer); 
    732538+       if(q->ht) 
     
    744550+} 
    745551+ 
     552+static void esfq_destroy(struct Qdisc *sch) 
     553+{ 
     554+       struct esfq_sched_data *q = qdisc_priv(sch); 
     555+       esfq_q_destroy(q); 
     556+} 
     557+ 
     558+ 
     559+static void esfq_reset(struct Qdisc* sch) 
     560+{ 
     561+       struct sk_buff *skb; 
     562+ 
     563+       while ((skb = esfq_dequeue(sch)) != NULL) 
     564+               kfree_skb(skb); 
     565+} 
     566+ 
     567+static void esfq_perturbation(unsigned long arg) 
     568+{ 
     569+       struct Qdisc *sch = (struct Qdisc*)arg; 
     570+       struct esfq_sched_data *q = qdisc_priv(sch); 
     571+ 
     572+       q->perturbation = net_random()&0x1F; 
     573+ 
     574+       if (q->perturb_period) { 
     575+               q->perturb_timer.expires = jiffies + q->perturb_period; 
     576+               add_timer(&q->perturb_timer); 
     577+       } 
     578+} 
     579+ 
     580+static unsigned int esfq_check_hash(unsigned int kind) 
     581+{ 
     582+       switch (kind) { 
     583+       case TCA_SFQ_HASH_CTORIGDST: 
     584+       case TCA_SFQ_HASH_CTORIGSRC: 
     585+       case TCA_SFQ_HASH_CTREPLDST: 
     586+       case TCA_SFQ_HASH_CTREPLSRC: 
     587+       case TCA_SFQ_HASH_CTNATCHG: 
     588+#ifndef CONFIG_NET_SCH_ESFQ_NFCT 
     589+       { 
     590+               if (net_ratelimit()) 
     591+                       printk(KERN_WARNING "ESFQ: Conntrack hash types disabled in kernel config. Falling back to classic.\n"); 
     592+               return TCA_SFQ_HASH_CLASSIC; 
     593+       } 
     594+#endif 
     595+       case TCA_SFQ_HASH_CLASSIC: 
     596+       case TCA_SFQ_HASH_DST: 
     597+       case TCA_SFQ_HASH_SRC: 
     598+       case TCA_SFQ_HASH_FWMARK: 
     599+               return kind; 
     600+       default: 
     601+       { 
     602+               if (net_ratelimit()) 
     603+                       printk(KERN_WARNING "ESFQ: Unknown hash type. Falling back to classic.\n"); 
     604+               return TCA_SFQ_HASH_CLASSIC; 
     605+       } 
     606+       } 
     607+} 
     608+        
     609+static int esfq_q_init(struct esfq_sched_data *q, struct rtattr *opt) 
     610+{ 
     611+       struct tc_esfq_qopt *ctl = RTA_DATA(opt); 
     612+       esfq_index p = ~0U/2; 
     613+       int i; 
     614+        
     615+       if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl))) 
     616+               return -EINVAL; 
     617+ 
     618+       q->perturbation = 0; 
     619+       q->hash_kind = TCA_SFQ_HASH_CLASSIC; 
     620+       q->max_depth = 0; 
     621+       if (opt == NULL) { 
     622+               q->perturb_period = 0; 
     623+               q->hash_divisor = 1024; 
     624+               q->tail = q->limit = q->depth = 128; 
     625+                
     626+       } else { 
     627+               struct tc_esfq_qopt *ctl = RTA_DATA(opt); 
     628+               if (ctl->quantum) 
     629+                       q->quantum = ctl->quantum; 
     630+               q->perturb_period = ctl->perturb_period*HZ; 
     631+               q->hash_divisor = ctl->divisor ? : 1024; 
     632+               q->tail = q->limit = q->depth = ctl->flows ? : 128; 
     633+                
     634+               if ( q->depth > p - 1 ) 
     635+                       return -EINVAL; 
     636+                
     637+               if (ctl->limit) 
     638+                       q->limit = min_t(u32, ctl->limit, q->depth); 
     639+                
     640+               if (ctl->hash_kind) { 
     641+                       q->hash_kind = esfq_check_hash(ctl->hash_kind); 
     642+               } 
     643+       } 
     644+        
     645+       q->ht = kmalloc(q->hash_divisor*sizeof(esfq_index), GFP_KERNEL); 
     646+       if (!q->ht) 
     647+               goto err_case; 
     648+       q->dep = kmalloc((1+q->depth*2)*sizeof(struct esfq_head), GFP_KERNEL); 
     649+       if (!q->dep) 
     650+               goto err_case; 
     651+       q->next = kmalloc(q->depth*sizeof(esfq_index), GFP_KERNEL); 
     652+       if (!q->next) 
     653+               goto err_case; 
     654+       q->allot = kmalloc(q->depth*sizeof(short), GFP_KERNEL); 
     655+       if (!q->allot) 
     656+               goto err_case; 
     657+       q->hash = kmalloc(q->depth*sizeof(unsigned short), GFP_KERNEL); 
     658+       if (!q->hash) 
     659+               goto err_case; 
     660+       q->qs = kmalloc(q->depth*sizeof(struct sk_buff_head), GFP_KERNEL); 
     661+       if (!q->qs) 
     662+               goto err_case; 
     663+        
     664+       for (i=0; i< q->hash_divisor; i++) 
     665+               q->ht[i] = q->depth; 
     666+       for (i=0; i<q->depth; i++) { 
     667+               skb_queue_head_init(&q->qs[i]); 
     668+               q->dep[i+q->depth].next = i+q->depth; 
     669+               q->dep[i+q->depth].prev = i+q->depth; 
     670+       } 
     671+        
     672+       for (i=0; i<q->depth; i++) 
     673+               esfq_link(q, i); 
     674+       return 0; 
     675+err_case: 
     676+       esfq_q_destroy(q); 
     677+       return -ENOBUFS; 
     678+} 
     679+ 
     680+static int esfq_init(struct Qdisc *sch, struct rtattr *opt) 
     681+{ 
     682+       struct esfq_sched_data *q = qdisc_priv(sch); 
     683+       int err; 
     684+        
     685+       q->quantum = psched_mtu(sch->dev); /* default */ 
     686+       if ((err = esfq_q_init(q, opt))) 
     687+               return err; 
     688+ 
     689+       init_timer(&q->perturb_timer); 
     690+       q->perturb_timer.data = (unsigned long)sch; 
     691+       q->perturb_timer.function = esfq_perturbation; 
     692+       if (q->perturb_period) { 
     693+               q->perturb_timer.expires = jiffies + q->perturb_period; 
     694+               add_timer(&q->perturb_timer); 
     695+       } 
     696+        
     697+       return 0; 
     698+} 
     699+ 
     700+static int esfq_change(struct Qdisc *sch, struct rtattr *opt) 
     701+{ 
     702+       struct esfq_sched_data *q = qdisc_priv(sch); 
     703+       struct esfq_sched_data new; 
     704+       struct sk_buff *skb; 
     705+       int err; 
     706+        
     707+       /* set up new queue */ 
     708+       memset(&new, 0, sizeof(struct esfq_sched_data)); 
     709+       new.quantum = psched_mtu(sch->dev); /* default */ 
     710+       if ((err = esfq_q_init(&new, opt))) 
     711+               return err; 
     712+ 
     713+       /* copy all packets from the old queue to the new queue */ 
     714+       sch_tree_lock(sch); 
     715+       while ((skb = esfq_q_dequeue(q)) != NULL) 
     716+               esfq_q_enqueue(skb, &new, ESFQ_TAIL); 
     717+        
     718+       /* clean up the old queue */ 
     719+       esfq_q_destroy(q); 
     720+ 
     721+       /* copy elements of the new queue into the old queue */ 
     722+       q->perturb_period = new.perturb_period; 
     723+       q->quantum        = new.quantum; 
     724+       q->limit          = new.limit; 
     725+       q->depth          = new.depth; 
     726+       q->hash_divisor   = new.hash_divisor; 
     727+       q->hash_kind      = new.hash_kind; 
     728+       q->tail           = new.tail; 
     729+       q->max_depth      = new.max_depth; 
     730+       q->ht    = new.ht; 
     731+       q->dep   = new.dep; 
     732+       q->next  = new.next; 
     733+       q->allot = new.allot; 
     734+       q->hash  = new.hash; 
     735+       q->qs    = new.qs; 
     736+ 
     737+       /* finish up */ 
     738+       if (q->perturb_period) { 
     739+               q->perturb_timer.expires = jiffies + q->perturb_period; 
     740+               add_timer(&q->perturb_timer); 
     741+       } else { 
     742+               q->perturbation = 0; 
     743+       } 
     744+       sch_tree_unlock(sch); 
     745+       return 0; 
     746+} 
     747+ 
    746748+static int esfq_dump(struct Qdisc *sch, struct sk_buff *skb) 
    747749+{ 
    748750+       struct esfq_sched_data *q = qdisc_priv(sch); 
    749 +       unsigned char    *b = skb->tail; 
     751+       unsigned char *b = skb->tail; 
    750752+       struct tc_esfq_qopt opt; 
    751753+ 
     
    780782+       .reset          =       esfq_reset, 
    781783+       .destroy        =       esfq_destroy, 
    782 +       .change         =       NULL, /* esfq_change - needs more work */ 
     784+       .change         =       esfq_change, 
    783785+       .dump           =       esfq_dump, 
    784786+       .owner          =       THIS_MODULE, 
     
    789791+       return register_qdisc(&esfq_qdisc_ops); 
    790792+} 
    791 +static void __exit esfq_module_exit(void) 
     793+static void __exit esfq_module_exit(void)  
    792794+{ 
    793795+       unregister_qdisc(&esfq_qdisc_ops); 
Note: See TracChangeset for help on using the changeset viewer.