| 1 |
/* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 |
/* |
| 3 |
* q_ingress.c INGRESS. |
| 4 |
* |
| 5 |
* Authors: J Hadi Salim |
| 6 |
*/ |
| 7 |
|
| 8 |
#include <stdio.h> |
| 9 |
#include <string.h> |
| 10 |
|
| 11 |
#include "utils.h" |
| 12 |
#include "tc_util.h" |
| 13 |
|
| 14 |
static void explain(void) |
| 15 |
{ |
| 16 |
fprintf(stderr, "Usage: ... ingress\n"); |
| 17 |
} |
| 18 |
|
| 19 |
static int ingress_parse_opt(const struct qdisc_util *qu, int argc, char **argv, |
| 20 |
struct nlmsghdr *n, const char *dev) |
| 21 |
{ |
| 22 |
while (argc > 0) { |
| 23 |
if (strcmp(*argv, "handle") == 0) { |
| 24 |
NEXT_ARG(); |
| 25 |
argc--; argv++; |
| 26 |
} else { |
| 27 |
fprintf(stderr, "What is \"%s\"?\n", *argv); |
| 28 |
explain(); |
| 29 |
return -1; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
static int ingress_print_opt(const struct qdisc_util *qu, FILE *f, |
| 37 |
struct rtattr *opt) |
| 38 |
{ |
| 39 |
print_string(PRINT_FP, NULL, "---------------- ", NULL); |
| 40 |
return 0; |
| 41 |
} |
| 42 |
|
| 43 |
struct qdisc_util ingress_qdisc_util = { |
| 44 |
.id = "ingress", |
| 45 |
.parse_qopt = ingress_parse_opt, |
| 46 |
.print_qopt = ingress_print_opt, |
| 47 |
}; |