aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/libpcap.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-07-29 01:30:54 -0700
committerGuy Harris <gharris@sonic.net>2020-07-29 09:05:24 +0000
commitf8efccc3cc1e8d604a4fd085ab9a0f0174e9b25f (patch)
treefab66a38a9126c70da2a011a426e4a93e90d32db /wiretap/libpcap.c
parent12621c5b641246bc7f26fb71bbc2045a844a2810 (diff)
wiretap: generate fake IDBs for more capture file types.
That makes them work as input to a mergecap that writes pcapng files. File types that don't have a single per-file encapsulation type need more work, with multiple fake IDBs, one for each packet encapsulation type seen in the file, unless we can generate real IDBs. Change-Id: I2859e4f7fb15ec0c0f31a4044dc15638e5db7826 Reviewed-on: https://code.wireshark.org/review/37983 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'wiretap/libpcap.c')
-rw-r--r--wiretap/libpcap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index eee97dd338..4b80f86727 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -353,6 +353,15 @@ wtap_open_return_val libpcap_open(wtap *wth, int *err, gchar **err_info)
*/
wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_PCAP_AIX;
wth->file_tsprec = WTAP_TSPREC_NSEC;
+
+ /*
+ * Add an IDB; we don't know how many interfaces were
+ * involved, so we just say one interface, about which
+ * we only know the link-layer type, snapshot length,
+ * and time stamp resolution.
+ */
+ wtap_add_generated_idb(wth);
+
return WTAP_OPEN_MINE;
}
@@ -528,9 +537,6 @@ done:
* the link-layer type, snapshot length, and time stamp
* resolution.
*
- * This allows nanosecond pcap files to be correctly
- * converted to pcapng files.
- *
* XXX - this will be a bit weird if you're trying to convert
* a LINKTYPE_ERF pcap file to a pcapng file; it'll have a
* placeholder interface added here, *plus* interfaces
@@ -539,9 +545,6 @@ done:
* for capturing, and the DAG capture code will use it, so that
* if you're capturing on more than one interface, they'll all
* get regular IDBs, with no need for the placeholder.
- *
- * XXX - yes, adding at least one IDB should be done for *all*
- * file types.
*/
wtap_add_generated_idb(wth);