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 /ws_diag_control.h | |
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 'ws_diag_control.h')
-rw-r--r-- | ws_diag_control.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ws_diag_control.h b/ws_diag_control.h index 6f6aebad61..d168e8c7ee 100644 --- a/ws_diag_control.h +++ b/ws_diag_control.h @@ -187,6 +187,27 @@ extern "C" { #endif /* + * Suppress warnings about casting away constness. + * Do this only if you know that the pointer is to something that can + * be written and, in this context, should be writable. + */ +#if defined(__GNUC__) || defined(__clang__) + /* + * GCC or a compiler that claims to be GCC-compatible. + * We throw in Clang just in case clang-cl doesn't define + * __GNUC__; if it does, __GNUC__ should suffice. + */ + #define DIAG_OFF_CAST_AWAY_CONST DIAG_OFF(cast-qual) + #define DIAG_ON_CAST_AWAY_CONST DIAG_OFF(cast-qual) +#elif defined(_MSC_VER) + #define DIAG_OFF_CAST_AWAY_CONST + #define DIAG_ON_CAST_AWAY_CONST +#else + #define DIAG_OFF_CAST_AWAY_CONST + #define DIAG_ON_CAST_AWAY_CONST +#endif + +/* * For dealing with APIs which are only deprecated in macOS (like the * OpenSSL and MIT/Heimdal Kerberos APIs). * |