summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wiretap/file_access.c4
-rw-r--r--wiretap/netmon.c14
-rw-r--r--wiretap/netmon.h3
3 files changed, 17 insertions, 4 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index 58d508887a..5f364b2fde 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -516,11 +516,11 @@ static const struct file_type_info dump_open_table_base[] = {
/* WTAP_FILE_NETMON_1_x */
{ "Microsoft NetMon 1.x", "netmon1", "*.cap", ".cap", TRUE, FALSE,
- netmon_dump_can_write_encap, netmon_dump_open },
+ netmon_dump_can_write_encap_1_x, netmon_dump_open },
/* WTAP_FILE_NETMON_2_x */
{ "Microsoft NetMon 2.x", "netmon2", "*.cap", ".cap", TRUE, FALSE,
- netmon_dump_can_write_encap, netmon_dump_open },
+ netmon_dump_can_write_encap_2_x, netmon_dump_open },
/* WTAP_FILE_NGSNIFFER_UNCOMPRESSED */
{ "NA Sniffer (DOS)", "ngsniffer", "*.cap;*.enc;*.trc;*.fdc;*.syc", ".cap", FALSE, FALSE,
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 2c72384ae6..23a2d8a23b 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -947,7 +947,19 @@ static const int wtap_encap[] = {
/* Returns 0 if we could write the specified encapsulation type,
an error indication otherwise. */
-int netmon_dump_can_write_encap(int encap)
+int netmon_dump_can_write_encap_1_x(int encap)
+{
+ /*
+ * Per-packet encapsulations are *not* supported in NetMon 1.x
+ * format.
+ */
+ if (encap < 0 || (unsigned) encap >= NUM_WTAP_ENCAPS || wtap_encap[encap] == -1)
+ return WTAP_ERR_UNSUPPORTED_ENCAP;
+
+ return 0;
+}
+
+int netmon_dump_can_write_encap_2_x(int encap)
{
/*
* Per-packet encapsulations are supported in NetMon 2.1
diff --git a/wiretap/netmon.h b/wiretap/netmon.h
index 935740a298..b2bc7a2375 100644
--- a/wiretap/netmon.h
+++ b/wiretap/netmon.h
@@ -28,6 +28,7 @@
int netmon_open(wtap *wth, int *err, gchar **err_info);
gboolean netmon_dump_open(wtap_dumper *wdh, int *err);
-int netmon_dump_can_write_encap(int encap);
+int netmon_dump_can_write_encap_1_x(int encap);
+int netmon_dump_can_write_encap_2_x(int encap);
#endif