osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 1 | /* |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 2 | * q_ingress.c INGRESS. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version |
| 7 | * 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * Authors: J Hadi Salim |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <stdio.h> |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 13 | #include <string.h> |
| 14 | |
| 15 | #include "utils.h" |
| 16 | #include "tc_util.h" |
| 17 | |
| 18 | static void explain(void) |
| 19 | { |
Daniel Borkmann | 0d45c4b | 2016-01-12 01:42:19 +0100 | [diff] [blame] | 20 | fprintf(stderr, "Usage: ... ingress\n"); |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 21 | } |
| 22 | |
Daniel Borkmann | 0d45c4b | 2016-01-12 01:42:19 +0100 | [diff] [blame] | 23 | static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, |
| 24 | struct nlmsghdr *n) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 25 | { |
Daniel Borkmann | ec6f5ab | 2015-05-09 22:59:17 +0200 | [diff] [blame] | 26 | while (argc > 0) { |
| 27 | if (strcmp(*argv, "handle") == 0) { |
| 28 | NEXT_ARG(); |
| 29 | argc--; argv++; |
| 30 | } else { |
| 31 | fprintf(stderr, "What is \"%s\"?\n", *argv); |
| 32 | explain(); |
| 33 | return -1; |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 37 | return 0; |
| 38 | } |
| 39 | |
Daniel Borkmann | 0d45c4b | 2016-01-12 01:42:19 +0100 | [diff] [blame] | 40 | static int ingress_print_opt(struct qdisc_util *qu, FILE *f, |
| 41 | struct rtattr *opt) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 42 | { |
Daniel Borkmann | ec6f5ab | 2015-05-09 22:59:17 +0200 | [diff] [blame] | 43 | fprintf(f, "---------------- "); |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 44 | return 0; |
| 45 | } |
| 46 | |
net[shemminger]!kaber | 95812b5 | 2004-09-28 18:35:49 +0000 | [diff] [blame] | 47 | struct qdisc_util ingress_qdisc_util = { |
osdl.net!shemminger | f2f99e2 | 2004-08-31 17:45:21 +0000 | [diff] [blame] | 48 | .id = "ingress", |
| 49 | .parse_qopt = ingress_parse_opt, |
| 50 | .print_qopt = ingress_print_opt, |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 51 | }; |