From c9b7b2e197e51743bd29b75e270865bb141145cb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 5 Sep 2014 17:45:38 +0200 Subject: 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 --- netsniff-ng.c | 31 +++++++++++++------------------ 1 file 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 \n" + "Copyright (C) 2009-2013 Daniel Borkmann \n" + "Copyright (C) 2009-2012 Emmanuel Roullit \n" + "Copyright (C) 2012 Markus Amend \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 \n" - "Copyright (C) 2009-2013 Daniel Borkmann \n" - "Copyright (C) 2009-2012 Emmanuel Roullit \n" - "Copyright (C) 2012 Markus Amend \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 \n" - "Copyright (C) 2009-2013 Daniel Borkmann \n" - "Copyright (C) 2009-2012 Emmanuel Roullit \n" - "Copyright (C) 2012 Markus Amend \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(); } -- cgit v1.2.3-54-g00ecf