• 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 	addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
38 	return 0;
39 }
40 
ingress_print_opt(struct qdisc_util * qu,FILE * f,struct rtattr * opt)41 static int ingress_print_opt(struct qdisc_util *qu, FILE *f,
42 			     struct rtattr *opt)
43 {
44 	fprintf(f, "---------------- ");
45 	return 0;
46 }
47 
48 struct qdisc_util ingress_qdisc_util = {
49 	.id		= "ingress",
50 	.parse_qopt	= ingress_parse_opt,
51 	.print_qopt	= ingress_print_opt,
52 };
53