• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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
10  */
11 
12 #include <stdio.h>
13 #include <string.h>
14 
15 #include "utils.h"
16 #include "tc_util.h"
17 
explain(void)18 static void explain(void)
19 {
20 	fprintf(stderr, "Usage: ... ingress\n");
21 }
22 
ingress_parse_opt(struct qdisc_util * qu,int argc,char ** argv,struct nlmsghdr * n)23 static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv,
24 			     struct nlmsghdr *n)
25 {
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;
34 		}
35 	}
36 
37 	return 0;
38 }
39 
ingress_print_opt(struct qdisc_util * qu,FILE * f,struct rtattr * opt)40 static int ingress_print_opt(struct qdisc_util *qu, FILE *f,
41 			     struct rtattr *opt)
42 {
43 	fprintf(f, "---------------- ");
44 	return 0;
45 }
46 
47 struct qdisc_util ingress_qdisc_util = {
48 	.id		= "ingress",
49 	.parse_qopt	= ingress_parse_opt,
50 	.print_qopt	= ingress_print_opt,
51 };
52