diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:52:08 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-09-05 17:52:08 +0200 |
commit | c5371dbd3bf60eb9ea2239dc2af009b61bdf933b (patch) | |
tree | 5662ce8485cb5172ca810b0b467db7b907a5939e /astraceroute.c | |
parent | 012cef721c57246073b0aad80921eab6f2ee49f4 (diff) |
astraceroute: 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 astraceroute.o slightly smaller:
before:
text data bss dec hex filename
18481 0 4 18485 4835 astraceroute/astraceroute.o
after:
text data bss dec hex filename
18201 0 4 18205 471d astraceroute/astraceroute.o
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'astraceroute.c')
-rw-r--r-- | astraceroute.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/astraceroute.c b/astraceroute.c index 6b2ffc5..cef668a 100644 --- a/astraceroute.c +++ b/astraceroute.c @@ -117,6 +117,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 const struct sock_filter ipv4_icmp_type_11[] = { { 0x28, 0, 0, 0x0000000c }, /* ldh [12] */ { 0x15, 0, 8, 0x00000800 }, /* jneq #0x800, drop */ @@ -226,13 +233,8 @@ static void __noreturn help(void) " If the TCP probe did not give any results, then astraceroute will\n" " automatically probe for classic ICMP packets! To gather more\n" " information about astraceroute's fetched AS numbers, see e.g.\n" - " http://bgp.he.net/AS<number>!\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://bgp.he.net/AS<number>!\n\n"); + puts(copyright); die(); } @@ -240,13 +242,8 @@ static void __noreturn version(void) { printf("\nastraceroute %s, Git id: %s\n", VERSION_LONG, GITVERSION); puts("autonomous system trace route utility\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(); } |