diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:45:38 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:45:38 +0200 |
commit | c9b7b2e197e51743bd29b75e270865bb141145cb (patch) | |
tree | 5a192b18208fe3654e76cbe7f14d12eab2423167 /netsniff-ng.c | |
parent | 253e0e9a1bf6f6f4c3572c1562f838685a8a25d7 (diff) |
netsniff-ng: 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 netsniff-ng.o slightly smaller:
before:
text data bss dec hex filename
26998 8 68 27074 69c2 netsniff-ng/netsniff-ng.o
after:
text data bss dec hex filename
26582 8 68 26658 6822 netsniff-ng/netsniff-ng.o
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'netsniff-ng.c')
-rw-r--r-- | netsniff-ng.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/netsniff-ng.c b/netsniff-ng.c index 05d1267..eabd942 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -105,6 +105,15 @@ 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) 2009-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>\n" + "Copyright (C) 2009-2012 Emmanuel Roullit <emmanuel.roullit@gmail.com>\n" + "Copyright (C) 2012 Markus Amend <markus@netsniff-ng.org>\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 tx_sock; static struct itimerval itimer; static unsigned long frame_count_max = 0, interval = TX_KERNEL_PULL_INT; @@ -1142,15 +1151,8 @@ static void __noreturn help(void) " netsniff-ng --in any --filter http.bpf --jumbo-support --ascii -V\n\n" "Note:\n" " For introducing bit errors, delays with random variation and more\n" - " while replaying pcaps, make use of tc(8) with its disciplines (e.g. netem).\n\n" - "Please report bugs to <bugs@netsniff-ng.org>\n" - "Copyright (C) 2009-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>\n" - "Copyright (C) 2009-2012 Emmanuel Roullit <emmanuel.roullit@gmail.com>\n" - "Copyright (C) 2012 Markus Amend <markus@netsniff-ng.org>\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"); + " while replaying pcaps, make use of tc(8) with its disciplines (e.g. netem).\n\n"); + puts(copyright); die(); } @@ -1158,15 +1160,8 @@ static void __noreturn version(void) { printf("\nnetsniff-ng %s, Git id: %s\n", VERSION_LONG, GITVERSION); puts("the packet sniffing beast\n" - "http://www.netsniff-ng.org\n\n" - "Please report bugs to <bugs@netsniff-ng.org>\n" - "Copyright (C) 2009-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>\n" - "Copyright (C) 2009-2012 Emmanuel Roullit <emmanuel.roullit@gmail.com>\n" - "Copyright (C) 2012 Markus Amend <markus@netsniff-ng.org>\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(); } |