]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_simple.c
treewide: refactor help messages
[mirror_iproute2.git] / tc / m_simple.c
index a4457c70324ee64a8c3a3b34591a200501ab65f5..e3e1cdb1ba2108684a14d4cc49707b403717fb59 100644 (file)
@@ -66,7 +66,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #endif
 static void explain(void)
 {
-       fprintf(stderr, "Usage:... simple [sdata STRING] [CONTROL] [index INDEX]\n");
-       fprintf(stderr, "\tSTRING being an arbitrary string\n"
-               "\tCONTROL := reclassify|pipe|drop|continue|ok\n"
-               "\tINDEX := optional index value used\n");
+       fprintf(stderr,
+               "Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n"
+               "\tSTRING being an arbitrary string\n"
+               "\tINDEX := optional index value used\n"
+               "\tCONTROL := reclassify|pipe|drop|continue|ok\n");
 }
 
 static void usage(void)
@@ -147,12 +147,11 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 
        sel.action = TC_ACT_PIPE;
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+       tail = addattr_nest(n, MAX_MSG, tca_id);
        addattr_l(n, MAX_MSG, TCA_DEF_PARMS, &sel, sizeof(sel));
        if (simpdata)
                addattr_l(n, MAX_MSG, TCA_DEF_DATA, simpdata, SIMP_MAX_DATA);
-       tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
+       addattr_nest_end(n, tail);
 
        *argc_p = argc;
        *argv_p = argv;