diff options
author | Guy Harris <gharris@sonic.net> | 2021-02-21 14:18:04 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-02-21 23:18:35 +0000 |
commit | 842a7cccf9ec96ab7ce8945d4de77537f69efc2f (patch) | |
tree | 8e27dfa6aed434b1e0cd5e6ba7a0078c310ab829 /wiretap/tnef.c | |
parent | b8ce02e6fb43dedb8d1a480a154cc7cca0c5c353 (diff) |
wiretap: have file handlers advertise blocks and options supported.
Instead of a "supports name resolution" Boolean and bitflags for types of
comments supported, provide a list of block types that the file
type/subtype supports, with each block type having a list of options
supported. Indicate whether "supported" means "one instance" or
"multiple instances".
"Supports" doesn't just mean "can be written", it also means "could be
read".
Rename WTAP_BLOCK_IF_DESCRIPTION to WTAP_BLOCK_IF_ID_AND_INFO, to
indicate that it provides, in addition to information about the
interface, an ID (implicitly, in pcapng files, by its ordinal number)
that is associated with every packet in the file. Emphasize that in
comments - just because your capture file format can list the interfaces
on which a capture was done, that doesn't mean it supports this; it
doesn't do so if the file doesn't indicate, for every packet, on which
of those interfaces it was captured (I'm looking at *you*, Microsoft
Network Monitor...).
Use APIs to query that information to do what the "does this file
type/subtype support name resolution information", "does this file
type/subtype support all of these comment types", and "does this file
type/subtype support - and require - interface IDs" APIs did.
Provide backwards compatibility for Lua.
This allows us to eliminate the WTAP_FILE_TYPE_SUBTYPE_ values for IBM's
iptrace; do so.
Diffstat (limited to 'wiretap/tnef.c')
-rw-r--r-- | wiretap/tnef.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wiretap/tnef.c b/wiretap/tnef.c index 593fe09ced..f81b3ddac2 100644 --- a/wiretap/tnef.c +++ b/wiretap/tnef.c @@ -44,9 +44,18 @@ wtap_open_return_val tnef_open(wtap *wth, int *err, gchar **err_info) return WTAP_OPEN_MINE; } +static const struct supported_block_type tnef_blocks_supported[] = { + /* + * This is a file format that we dissect, so we provide only one + * "packet" with the file's contents, and don't support any + * options. + */ + { WTAP_BLOCK_PACKET, ONE_BLOCK_SUPPORTED, NO_OPTIONS_SUPPORTED } +}; + static const struct file_type_subtype_info tnef_info = { "Transport-Neutral Encapsulation Format", "tnef", NULL, NULL, - FALSE, FALSE, 0, + FALSE, BLOCKS_SUPPORTED(tnef_blocks_supported), NULL, NULL, NULL }; |