diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:36:54 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:43:29 +0200 |
commit | 253e0e9a1bf6f6f4c3572c1562f838685a8a25d7 (patch) | |
tree | bc1baafb8ed71c776c0c40d893f563bd31715d7c | |
parent | 5ba6970df808af47d284f43f9ce92059849155a0 (diff) |
trafgen: Don't duplicate copyright/bug report/license string
Move the copyright/bug report/license string to an own constant and use
it for the output of help() and version() to avoid duplication and
prevent the strings from getting out of sync. This makes the text
section of trafgen.o slightly smaller:
before:
text data bss dec hex filename
18512 0 104 18616 48b8 trafgen/trafgen.o
after:
text data bss dec hex filename
18240 0 104 18344 47a8 trafgen/trafgen.o
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | trafgen.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -112,6 +112,13 @@ static const struct option long_options[] = { {NULL, 0, NULL, 0} }; +static const char *copyright = "Please report bugs to <bugs@netsniff-ng.org>\n" + "Copyright (C) 2011-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,\n" + "Swiss federal institute of technology (ETH Zurich)\n" + "License: GNU GPL version 2.0\n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n"; + static int sock; static struct cpu_stats *stats; static unsigned int seed; @@ -199,13 +206,8 @@ static void __noreturn help(void) " Tolly 64:55, 78:5, 576:17, 1518:23\n" " Cisco 64:7, 594:4, 1518:1\n" " RPR Trimodal 64:60, 512:20, 1518:20\n" - " RPR Quadrimodal 64:50, 512:15, 1518:15, 9218:20\n\n" - "Please report bugs to <bugs@netsniff-ng.org>\n" - "Copyright (C) 2011-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,\n" - "Swiss federal institute of technology (ETH Zurich)\n" - "License: GNU GPL version 2.0\n" - "This is free software: you are free to change and redistribute it.\n" - "There is NO WARRANTY, to the extent permitted by law.\n"); + " RPR Quadrimodal 64:50, 512:15, 1518:15, 9218:20\n\n"); + puts(copyright); die(); } @@ -267,13 +269,8 @@ static void __noreturn version(void) { printf("\ntrafgen %s, Git id: %s\n", VERSION_LONG, GITVERSION); puts("multithreaded zero-copy network packet generator\n" - "http://www.netsniff-ng.org\n\n" - "Please report bugs to <bugs@netsniff-ng.org>\n" - "Copyright (C) 2011-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,\n" - "Swiss federal institute of technology (ETH Zurich)\n" - "License: GNU GPL version 2.0\n" - "This is free software: you are free to change and redistribute it.\n" - "There is NO WARRANTY, to the extent permitted by law.\n"); + "http://www.netsniff-ng.org\n\n"); + puts(copyright); die(); } |