aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_access.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-07-28 21:12:07 +0000
committerGuy Harris <guy@alum.mit.edu>2013-07-28 21:12:07 +0000
commita4ad9e9f74d58f3a869ceb27845f74345d7b81be (patch)
tree8232de5a3f542b692b883fcf0f057b0f2a0e7af5 /wiretap/file_access.c
parent0f13e3c95d571c7000e84d0c1e6f9f76575508b4 (diff)
If a core Wireshark developer repeatedly can't remember that the
argument to the -F flag for pcap format is "libpcap", not "pcap", we have a problem. Make it "pcap", and add a backwards-compatibility hack to support using "libpcap" as well. Update the man pages to refer to it as pcap as well, and fix the capitalization of "WinPcap" (see http://www.winpcap.org) while we're at it. Also, refer to http://www.tcpdump.org/linktypes.html for the list of link-layer header types for pcap and pcap-ng. svn path=/trunk/; revision=50989
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r--wiretap/file_access.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index e90f42b43d..55262cf09a 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -505,12 +505,12 @@ static const struct file_type_info dump_open_table_base[] = {
/* WTAP_FILE_PCAP */
/* Gianluca Varenni suggests that we add "deprecated" to the description. */
- { "Wireshark/tcpdump/... - libpcap", "libpcap", "pcap", "cap;dmp",
+ { "Wireshark/tcpdump/... - pcap", "pcap", "pcap", "cap;dmp",
FALSE, FALSE, 0,
libpcap_dump_can_write_encap, libpcap_dump_open },
/* WTAP_FILE_PCAPNG */
- { "Wireshark - pcapng", "pcapng", "pcapng", "ntar",
+ { "Wireshark/... - pcapng", "pcapng", "pcapng", "ntar",
FALSE, TRUE, WTAP_COMMENT_PER_SECTION|WTAP_COMMENT_PER_INTERFACE|WTAP_COMMENT_PER_PACKET,
pcapng_dump_can_write_encap, pcapng_dump_open },
@@ -1068,6 +1068,15 @@ int wtap_short_string_to_file_type(const char *short_name)
strcmp(short_name, dump_open_table[filetype].short_name) == 0)
return filetype;
}
+
+ /*
+ * We now call the "libpcap" file format just "pcap", but we
+ * allow it to be specified as "libpcap" as well, for
+ * backwards compatibility.
+ */
+ if (strcmp(short_name, "libpcap") == 0)
+ return WTAP_FILE_PCAP;
+
return -1; /* no such file type, or we can't write it */
}