1 --- iproute2-5.10.0/include/uapi/linux/pkt_sched.h.orig 2021-02-24 19:32:20.974075535 +0100
2 +++ iproute2-5.10.0/include/uapi/linux/pkt_sched.h 2021-02-24 19:33:12.273391823 +0100
4 unsigned hash_kind; /* Hash function to use for flow identification */
12 + __u32 slot_classify;
18 diff -ruN iproute-20041019/tc/q_srr.c iproute-20041019.srr.patched.v0.4/tc/q_srr.c
19 --- iproute-20041019/tc/q_srr.c 1970-01-01 03:00:00.000000000 +0300
20 +++ iproute-20041019.srr.patched.v0.4/tc/q_srr.c 2006-07-27 12:59:27.000000000 +0300
25 +#include <sys/socket.h>
26 +#include <netinet/in.h>
27 +#include <arpa/inet.h>
37 +static void explain(void)
39 + fprintf(stderr, "Usage: ... srr [ slots NUMBER ] [ limit NUMBER ] [ classify src/dst/fw ]\n");
42 +#define usage() return(-1)
44 +static int srr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
47 + struct tc_srr_qopt opt;
49 + memset(&opt, 0, sizeof(opt));
51 + while ( argc > 0 ) {
52 + if ( strcmp(*argv, "slots") == 0 ) {
54 + if ( get_u32(&opt.slots, *argv, 0) ) {
55 + fprintf(stderr, "Illegal \"slot\"\n");
60 + else if ( strcmp(*argv, "limit") == 0 ) {
62 + if ( get_u32(&opt.slot_limit, *argv, 0) ) {
63 + fprintf(stderr, "Illegal \"limit\"\n");
67 + else if ( strcmp(*argv, "classify") == 0 ) {
69 + if ( strcmp(*argv, "src") == 0 ) {
70 + opt.slot_classify = SRR_CL_SRC;
73 + if ( strcmp(*argv, "dst") == 0 ) {
74 + opt.slot_classify = SRR_CL_DST;
77 + if ( strcmp(*argv, "fw") == 0 ) {
78 + opt.slot_classify = SRR_CL_FWM;
81 + fprintf(stderr, "Illegal \"classify\"\n");
86 + else if ( strcmp(*argv, "help") == 0 ) {
91 + fprintf(stderr, "What is \"%s\"?\n", *argv);
99 + addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
103 +static int srr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
105 + struct tc_srr_qopt *qopt;
110 + if (RTA_PAYLOAD(opt) < sizeof(*qopt))
113 + qopt = RTA_DATA(opt);
114 + fprintf(f, "slots %u ", qopt->slots);
115 + fprintf(f, "used %u/%u ", qopt->used_slots, qopt->slots);
116 + fprintf(f, "qlimit %u ", qopt->slot_limit);
117 + switch (qopt->slot_classify) {
119 + fprintf(f, "classify IP_SRC");
122 + fprintf(f, "classify IP_DST");
125 + fprintf(f, "classify FW");
128 + fprintf(f, "classify UNKNOW!!!");
135 +struct qdisc_util srr_qdisc_util = {
137 + .parse_qopt = srr_parse_opt,
138 + .print_qopt = srr_print_opt,
140 --- iproute2-5.10.0/tc/Makefile.orig 2021-02-24 19:32:21.377429702 +0100
141 +++ iproute2-5.10.0/tc/Makefile 2021-02-24 19:33:44.238376154 +0100
143 TCMODULES += q_netem.o
144 TCMODULES += q_choke.o
146 +TCMODULES += q_srr.o
148 TCMODULES += f_rsvp.o