summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-09-05 17:48:55 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-09-05 17:48:55 +0200
commit012cef721c57246073b0aad80921eab6f2ee49f4 (patch)
treeea37f4f793b975fe8a7be08e91fb57c73c5b03c6
parentc9b7b2e197e51743bd29b75e270865bb141145cb (diff)
ifpps: 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 ifpps.o slightly smaller: before: text data bss dec hex filename 22146 0 1456 23602 5c32 ifpps/ifpps.o after: text data bss dec hex filename 21807 0 1456 23263 5adf ifpps/ifpps.o Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--ifpps.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/ifpps.c b/ifpps.c
index 77c63a6..7dc8e68 100644
--- a/ifpps.c
+++ b/ifpps.c
@@ -93,6 +93,14 @@ 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"
+ "Swiss federal institute of technology (ETH Zurich)\n"
+ "Copyright (C) 2013 Tobias Klauser <tklauser@distanz.ch>\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 void signal_handler(int number)
{
switch (number) {
@@ -137,14 +145,8 @@ static void __noreturn help(void)
" ifpps -lpcd wlan0 > plot.dat\n\n"
"Note:\n"
" On 10G cards, RX/TX statistics are usually accumulated each > 1sec.\n"
- " Thus, in those situations, it's good to use a -t of 10sec.\n\n"
- "Please report bugs to <bugs@netsniff-ng.org>\n"
- "Copyright (C) 2009-2013 Daniel Borkmann <dborkma@tik.ee.ethz.ch>\n"
- "Swiss federal institute of technology (ETH Zurich)\n"
- "Copyright (C) 2013 Tobias Klauser <tklauser@distanz.ch>\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");
+ " Thus, in those situations, it's good to use a -t of 10sec.\n\n");
+ puts(copyright);
die();
}
@@ -152,14 +154,8 @@ static void __noreturn version(void)
{
printf("\nifpps %s, Git id: %s\n", VERSION_LONG, GITVERSION);
puts("top-like kernel networking and system statistics\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"
- "Swiss federal institute of technology (ETH Zurich)\n"
- "Copyright (C) 2013 Tobias Klauser <tklauser@distanz.ch>\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();
}