X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=genl%2Fgenl.c;h=aba3c13afd3496a8c583c7888c370a7b3072e1b2;hb=b78c480532013b31148ec319c30ba0f659547831;hp=747074b029a7b98626ba32b70e15dc2e3b7aded9;hpb=f89bb0210fcf7bc52f9bc743bbc92c811b1f578a;p=mirror_iproute2.git diff --git a/genl/genl.c b/genl/genl.c index 747074b0..aba3c13a 100644 --- a/genl/genl.c +++ b/genl/genl.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -27,17 +26,15 @@ #include "utils.h" #include "genl_utils.h" -int show_stats = 0; -int show_details = 0; -int show_raw = 0; -int resolve_hosts = 0; +int show_stats; +int show_details; +int show_raw; static void *BODY; -static struct genl_util * genl_list; +static struct genl_util *genl_list; -static int print_nofopt(const struct sockaddr_nl *who, struct nlmsghdr *n, - void *arg) +static int print_nofopt(struct nlmsghdr *n, void *arg) { fprintf((FILE *) arg, "unknown genl type ..\n"); return 0; @@ -46,8 +43,9 @@ static int print_nofopt(const struct sockaddr_nl *who, struct nlmsghdr *n, static int parse_nofopt(struct genl_util *f, int argc, char **argv) { if (argc) { - fprintf(stderr, "Unknown genl \"%s\", hence option \"%s\" " - "is unparsable\n", f->name, *argv); + fprintf(stderr, + "Unknown genl \"%s\", hence option \"%s\" is unparsable\n", + f->name, *argv); return -1; } @@ -100,9 +98,10 @@ static void usage(void) __attribute__((noreturn)); static void usage(void) { - fprintf(stderr, "Usage: genl [ OPTIONS ] OBJECT | help }\n" - "where OBJECT := { ctrl etc }\n" - " OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] }\n"); + fprintf(stderr, + "Usage: genl [ OPTIONS ] OBJECT [help] }\n" + "where OBJECT := { ctrl etc }\n" + " OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -V[ersion] | -h[elp] }\n"); exit(-1); } @@ -124,19 +123,21 @@ int main(int argc, char **argv) } else if (matches(argv[1], "-help") == 0) { usage(); } else { - fprintf(stderr, "Option \"%s\" is unknown, try " - "\"genl -help\".\n", argv[1]); + fprintf(stderr, + "Option \"%s\" is unknown, try \"genl -help\".\n", + argv[1]); exit(-1); } argc--; argv++; } if (argc > 1) { + struct genl_util *a; int ret; - struct genl_util *a = NULL; + a = get_genl_kind(argv[1]); if (!a) { - fprintf(stderr,"bad genl %s\n", argv[1]); + fprintf(stderr, "bad genl %s\n", argv[1]); exit(-1); }