]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/q_ingress.c
lib: introduce print_nl
[mirror_iproute2.git] / tc / q_ingress.c
index 30b24e7de417575791138a8acf97ad16a34bbf8f..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");
 }
 
-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)
 {
        while (argc > 0) {
                if (strcmp(*argv, "handle") == 0) {
@@ -45,13 +34,13 @@ static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, struc
                }
        }
 
-       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;
 }