]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/q_ingress.c
tc: Remove pointless assignments in batch()
[mirror_iproute2.git] / tc / q_ingress.c
index c7fded74c2c06ae0141cb7a3d039294eba901dab..93313c9c2aec6edf41b51336df4466926be35033 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *
  * q_ingress.c             INGRESS.
  *
  *              This program is free software; you can redistribute it and/or
@@ -8,20 +7,9 @@
  *              2 of the License, or (at your option) any later version.
  *
  * Authors:    J Hadi Salim
- *
- * This is here just in case it is needed
- * useless right now; might be useful in the future
- *
  */
 
 #include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <string.h>
 
 #include "utils.h"
 
 static void explain(void)
 {
-       fprintf(stderr, "Usage: ... ingress \n");
+       fprintf(stderr, "Usage: ... ingress\n");
 }
 
-#define usage() return(-1)
-
-static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
+static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv,
+                            struct nlmsghdr *n, const char *dev)
 {
-
-       if (argc > 0) {
-               while (argc > 0) {
-
-                       if (strcmp(*argv, "handle") == 0) {
-                               NEXT_ARG();
-                               argc--; argv++;
-                       } else {
-                               fprintf(stderr, "What is \"%s\"?\n", *argv);
-                               explain();
-                               return -1;
-                       }
+       while (argc > 0) {
+               if (strcmp(*argv, "handle") == 0) {
+                       NEXT_ARG();
+                       argc--; argv++;
+               } else {
+                       fprintf(stderr, "What is \"%s\"?\n", *argv);
+                       explain();
+                       return -1;
                }
        }
 
-       addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
        return 0;
 }
 
-static int ingress_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
+static int ingress_print_opt(struct qdisc_util *qu, FILE *f,
+                            struct rtattr *opt)
 {
-
-               fprintf(f, "---------------- ");
+       print_string(PRINT_FP, NULL, "---------------- ", NULL);
        return 0;
 }
 
-struct qdisc_util ingress_util = {
+struct qdisc_util ingress_qdisc_util = {
        .id             = "ingress",
        .parse_qopt     = ingress_parse_opt,
        .print_qopt     = ingress_print_opt,