2 * q_multiq.c Multiqueue aware qdisc
4 * Copyright (c) 2008, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses>.
18 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
20 * Original Authors: PJ Waskiewicz, <peter.p.waskiewicz.jr@intel.com> (RR)
21 * Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> (from PRIO)
30 #include <sys/socket.h>
31 #include <netinet/in.h>
32 #include <arpa/inet.h>
38 static void explain(void)
40 fprintf(stderr
, "Usage: ... multiq [help]\n");
43 static int multiq_parse_opt(struct qdisc_util
*qu
, int argc
, char **argv
,
46 struct tc_multiq_qopt opt
;
49 if (strcmp(*argv
, "help") == 0) {
53 fprintf(stderr
, "What is \"%s\"?\n", *argv
);
59 addattr_l(n
, 1024, TCA_OPTIONS
, &opt
, sizeof(opt
));
63 static int multiq_print_opt(struct qdisc_util
*qu
, FILE *f
, struct rtattr
*opt
)
65 struct tc_multiq_qopt
*qopt
;
69 if (RTA_PAYLOAD(opt
) < sizeof(*qopt
))
74 fprintf(f
, "bands %u/%u ", qopt
->bands
, qopt
->max_bands
);
79 struct qdisc_util multiq_qdisc_util
= {
81 .parse_qopt
= multiq_parse_opt
,
82 .print_qopt
= multiq_print_opt
,