]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/q_qfq.c
tc: implement support for terse dump
[mirror_iproute2.git] / tc / q_qfq.c
index 05b4d84e2118450d5d87d1c9fce9dd55fb1140fa..eb8fa4b849273c4771a1a6d00db8a354d045e0a5 100644 (file)
@@ -10,7 +10,6 @@
  *             Fabio Checconi <fabio@gandalf.sssup.it>
  *
  */
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -36,31 +35,25 @@ static void explain_class(void)
 }
 
 static int qfq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
-                        struct nlmsghdr *n)
+                        struct nlmsghdr *n, const char *dev)
 {
-       while (argc > 0) {
-               if (matches(*argv, "help") == 0) {
-                       explain();
-                       return -1;
-               } else {
+       if (argc > 0) {
+               if (matches(*argv, "help") != 0)
                        fprintf(stderr, "What is \"%s\"?\n", *argv);
-                       explain();
-                       return -1;
-               }
-               argc--; argv++;
+               explain();
+               return -1;
        }
 
        return 0;
 }
 
 static int qfq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
-                              struct nlmsghdr *n)
+                              struct nlmsghdr *n, const char *dev)
 {
        struct rtattr *tail;
        __u32 tmp;
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
+       tail = addattr_nest(n, 4096, TCA_OPTIONS);
 
        while (argc > 0) {
                if (matches(*argv, "weight") == 0) {
@@ -86,7 +79,7 @@ static int qfq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
                argc--; argv++;
        }
 
-       tail->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail;
+       addattr_nest_end(n, tail);
 
        return 0;
 }