diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-11-12 12:34:08 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-11-12 12:34:08 -0800 |
commit | c8ccf8b3e18392e857fd22517752777a022949f3 (patch) | |
tree | ce12f45ad08ef37ccebac99975b09c665736a511 /tcpdump.c | |
parent | 571ed4f006372a8f255902c8ee2eb61788b9e341 (diff) | |
download | tcpdump-c8ccf8b3e18392e857fd22517752777a022949f3.tar.gz |
Get rid of unused version string definitions.
Also, if we don't have pcap_lib_version(), declare pcap_version if we
found it in libpcap, otherwise define it as a static string "unknown".
Diffstat (limited to 'tcpdump.c')
-rw-r--r-- | tcpdump.c | 35 |
1 files changed, 4 insertions, 31 deletions
@@ -2794,33 +2794,6 @@ print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) info(0); } -#ifdef _WIN32 - /* - * XXX - there should really be libpcap calls to get the version - * number as a string (the string would be generated from #defines - * at run time, so that it's not generated from string constants - * in the library, as, on many UNIX systems, those constants would - * be statically linked into the application executable image, and - * would thus reflect the version of libpcap on the system on - * which the application was *linked*, not the system on which it's - * *running*. - * - * That routine should be documented, unlike the "version[]" - * string, so that UNIX vendors providing their own libpcaps - * don't omit it (as a couple of vendors have...). - * - * Packet.dll should perhaps also export a routine to return the - * version number of the Packet.dll code, to supply the - * "Wpcap_version" information on Windows. - */ - char WDversion[]="current-git.tcpdump.org"; -#if !defined(HAVE_GENERATED_VERSION) - char version[]="current-git.tcpdump.org"; -#endif - char pcap_version[]="current-git.tcpdump.org"; - char Wpcap_version[]="3.1"; -#endif - #ifdef SIGNAL_REQ_INFO void requestinfo(int signo _U_) { @@ -2865,17 +2838,17 @@ static void print_version(void) { #ifndef HAVE_PCAP_LIB_VERSION -#if defined(_WIN32) || defined(HAVE_PCAP_VERSION) + #ifdef HAVE_PCAP_VERSION extern char pcap_version[]; -#else /* defined(_WIN32) || defined(HAVE_PCAP_VERSION) */ + #else /* HAVE_PCAP_VERSION */ static char pcap_version[] = "unknown"; -#endif /* defined(_WIN32) || defined(HAVE_PCAP_VERSION) */ + #endif /* HAVE_PCAP_VERSION */ #endif /* HAVE_PCAP_LIB_VERSION */ const char *smi_version_string; (void)fprintf(stderr, "%s version " PACKAGE_VERSION "\n", program_name); #ifdef HAVE_PCAP_LIB_VERSION - (void)fprintf(stderr, "%s\n",pcap_lib_version()); + (void)fprintf(stderr, "%s\n", pcap_lib_version()); #else /* HAVE_PCAP_LIB_VERSION */ (void)fprintf(stderr, "libpcap version %s\n", pcap_version); #endif /* HAVE_PCAP_LIB_VERSION */ |