diff options
author | John Thacker <johnthacker@gmail.com> | 2023-06-03 11:48:37 -0400 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2023-06-03 12:29:47 -0400 |
commit | f4723eeb7e4228a306d25f671df08ac87eeeaa23 (patch) | |
tree | 3e7068983941dfdfbf1a4c6883e57beba52aeb75 /wiretap/file_access.c | |
parent | 9d6b2f5d8a0bc64b1b8214389583252fcf46b6f0 (diff) |
wiretap: Generate IDBs from packets when necessary
Add a routine to generate a dummy IDB from a packet record.
When pcapng is writing enhanced packet blocks and the source
doesn't provide an interface id, search through the list of
intereface ids for a match. If there isn't one, generate a new
one and use it.
This allows pcapng to write per-packet encapsulation when the
source doesn't provide IDBs.
Diffstat (limited to 'wiretap/file_access.c')
-rw-r--r-- | wiretap/file_access.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 0bc1a12577..4c56c57951 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -2337,11 +2337,13 @@ wtap_dump_init_dumper(int file_type_subtype, wtap_compression_type compression_t * means that there are no interfaces, or they will be * provided later when reading the file in single-pass mode.) * + * For WTAP_ENCAP_PER_PACKET, we'll have to generate IDBs + * from packet records as they come in. (pcapng does this now.) + * * XXX File types should provide their own IDBs (possibly * fake ones generated by wtap_add_generated_idb()), in * order to support being used as inputs for mergecap where - * pcapng is the output. This doesn't work for files with - * WTAP_ENCAP_PER_PACKET. + * pcapng is the output. */ descr = wtap_dump_params_generate_idb(params); g_array_append_val(wdh->interface_data, descr); |