1 diff -ruN iproute-20041019/include/linux/pkt_sched.h iproute-20041019.srr.patched.v0.4/include/linux/pkt_sched.h
2 --- iproute-20041019/include/linux/pkt_sched.h 2006-07-27 13:04:00.000000000 +0300
3 +++ iproute-20041019.srr.patched.v0.4/include/linux/pkt_sched.h 2006-07-27 13:11:36.000000000 +0300
5 * to change these parameters in compile time.
13 + __u32 slot_classify;
19 diff -ruN iproute-20041019/tc/q_srr.c iproute-20041019.srr.patched.v0.4/tc/q_srr.c
20 --- iproute-20041019/tc/q_srr.c 1970-01-01 03:00:00.000000000 +0300
21 +++ iproute-20041019.srr.patched.v0.4/tc/q_srr.c 2006-07-27 12:59:27.000000000 +0300
26 +#include <sys/socket.h>
27 +#include <netinet/in.h>
28 +#include <arpa/inet.h>
38 +static void explain(void)
40 + fprintf(stderr, "Usage: ... srr [ slots NUMBER ] [ limit NUMBER ] [ classify src/dst/fw ]\n");
43 +#define usage() return(-1)
45 +static int srr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
48 + struct tc_srr_qopt opt;
50 + memset(&opt, 0, sizeof(opt));
52 + while ( argc > 0 ) {
53 + if ( strcmp(*argv, "slots") == 0 ) {
55 + if ( get_u32(&opt.slots, *argv, 0) ) {
56 + fprintf(stderr, "Illegal \"slot\"\n");
61 + else if ( strcmp(*argv, "limit") == 0 ) {
63 + if ( get_u32(&opt.slot_limit, *argv, 0) ) {
64 + fprintf(stderr, "Illegal \"limit\"\n");
68 + else if ( strcmp(*argv, "classify") == 0 ) {
70 + if ( strcmp(*argv, "src") == 0 ) {
71 + opt.slot_classify = SRR_CL_SRC;
74 + if ( strcmp(*argv, "dst") == 0 ) {
75 + opt.slot_classify = SRR_CL_DST;
78 + if ( strcmp(*argv, "fw") == 0 ) {
79 + opt.slot_classify = SRR_CL_FWM;
82 + fprintf(stderr, "Illegal \"classify\"\n");
87 + else if ( strcmp(*argv, "help") == 0 ) {
92 + fprintf(stderr, "What is \"%s\"?\n", *argv);
100 + addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
104 +static int srr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
106 + struct tc_srr_qopt *qopt;
111 + if (RTA_PAYLOAD(opt) < sizeof(*qopt))
114 + qopt = RTA_DATA(opt);
115 + fprintf(f, "slots %u ", qopt->slots);
116 + fprintf(f, "used %u/%u ", qopt->used_slots, qopt->slots);
117 + fprintf(f, "qlimit %u ", qopt->slot_limit);
118 + switch (qopt->slot_classify) {
120 + fprintf(f, "classify IP_SRC");
123 + fprintf(f, "classify IP_DST");
126 + fprintf(f, "classify FW");
129 + fprintf(f, "classify UNKNOW!!!");
136 +struct qdisc_util srr_qdisc_util = {
138 + .parse_qopt = srr_parse_opt,
139 + .print_qopt = srr_print_opt,
141 --- iproute-2.6.22-070710/tc/Makefile.orig 2007-07-18 18:15:46.749073720 +0200
142 +++ iproute-2.6.22-070710/tc/Makefile 2007-07-18 18:17:19.296663578 +0200
144 TCMODULES += q_fifo.o
146 TCMODULES += q_esfq.o
147 +TCMODULES += q_srr.o
149 TCMODULES += q_prio.o