aboutsummaryrefslogtreecommitdiffstats
path: root/debian
AgeCommit message (Collapse)AuthorFilesLines
2021-09-08epan: export epan_set_always_visible()Developer Alexander1-0/+1
Exports (DLL) epan_set_always_visible() to make it accessible for plugins. This enables post dissection taps to access all fields.
2021-09-08tvblist: explicitly scope memoryEvan Huus1-1/+1
Allocate the root node in the same pool as the list itself, and make that pool explicit so we can pass the pinfo scope instead of using the global packet pool.
2021-09-01tvbuff: convert helper methods to pinfo->poolEvan Huus1-2/+2
A few of them just needed scratch memory, so allocate and free it manually after doing any exception-raising checks. A few others were returning memory, and needed conversion to accept a wmem scope argument.
2021-08-30pcapng: write packet and Netflix custom blocks the same as other blocks.Guy Harris1-2/+4
Use compute_options_size() to get the total size of all the options, and use write_options() to write out the options for those blocks, as we do for other blocks. Get rid of wtap_block_option_get_value_size() and wtap_block_get_options_size_padded(); they're no longer needed, and their notion of an option's "size" is "size in a pcapng file", so that doesn't belong in code that's intended to support all file types.
2021-08-27Version: 3.5.0 → 3.5.1.Gerald Combs1-1/+1
2021-08-27pcapng: export routines to do the option-section processing.Guy Harris1-0/+7
That way, add-on modules to handle block types not handled by the core pcapng code can use pcap_process_options() to process a block's options and can use the routines to handle the "standard" option value types to handle particular options. Also, allow both everything-is-little-endian and everything-is-big-endian Custom Block types in pcap_process_options().
2021-08-27Thrift: Complete handling of Binary & Compact protocolsTriton Circonflexe1-3/+10
- Make sure reassembly requests & errors are properly propagated from any point in the PDU, no matter how many sub-structure levels. - Handle the sub-dissection methods as well: - Ensure the sub-dissection methods handle errors from previous calls. - Reduce the error handling needed in sub-dissector implementations. - Add missing sub-dissection methods for list, set, and map. - Add the handling of sub-structure. - Handle Compact protocol in addition to the existing binary protocol. - Include and improve MR !3171 - Handle reassembly the same way as for binary protocol. - Handle sub-dissection with the same functions. => Sub-dissectors only depend on .thrift files. Additional changes: - Use of constants instead of hard-coded values. - Removed U64 support (never supported by thrift code generator, only referenced in the C++ thrift library header but not supported in reality. - Removed references to UTF-8 and UTF-16 string for the same reason. - Replaced references to UTF-7 string with just string (same reason). - Replaced references to byte with i8 as the documentation explicitly states that byte is a compatibility name. Documentation reference: - https://thrift.apache.org/developers - https://thrift.apache.org/docs/idl.html - https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md - https://erikvanoosten.github.io/thrift-missing-specification/ - https://diwakergupta.github.io/thrift-missing-guide/ Closes #16244 Additional changes: - Add authors and improve consistency - Fix typo and clarify documentation
2021-08-27Add initial support for BBLog filesMichael Tuexen1-0/+2
2021-08-10[#17478] free blocks in more placesDavid Perry1-0/+1
Bug 17478 was caused by `wtap_rec.block` being allocated for each packet, but not freed when it was done being used -- typically at the end of a loop. Rather than requiring each caller of `wtap_read()` to know to free a member of `rec`, I added a new function `wtap_rec_reset()` for a slightly cleaner API. Added calls to it everywhere that seemed to make sense. Fixes #17478
2021-07-29wslog: Add function to log directly without filteringJoão Valverde1-0/+1
Used to write custom logging functions.
2021-07-29wsutil: rename bytestring_to_str() -> bytes_to_str_punct()João Valverde1-1/+1
2021-07-29wsutil: Add max length argument to bytes_to_str()João Valverde1-2/+2
2021-07-29Move bytes_to_str() to wsutilJoão Valverde2-3/+4
This utility function is useful outside of epan. Move it to wsutil and export the interface. The move isn't completely clean as it requires duplicating two small inline functions but that was necessary to avoiding moving too much at once.
2021-07-28Debian: Fixup our symbols.Gerald Combs1-3/+0
wmem_epan_scope wmem_file_scope, and wmem_packet_scope are still in epan.
2021-07-26Remove duplicate format_size() functionJoão Valverde2-2/+2
We have two format_size()s, with and without wmem scoped memory. Move the wmem version to wsutil and add a convenience macro to use g_malloc()ed memory.
2021-07-26Move epan/wmem/wmem_scopes.h to epan/João Valverde1-1/+0
This header was installed incorrectly to epan/wmem_scopes.h. Instead of creating additional installation rules for a single header in a subfolder (kept for backward compatibility) just rename the standard "epan/wmem/wmem.h" include to "epan/wmem_scopes.h" and fix the documentation. Now the header is installed *correctly* to epan/wmem_scopes.h.
2021-07-26Move wmem to wsutilJoão Valverde3-103/+112
This allows wmem to be used from other libraries, namely wsutil. It is often the case that a funtion exists in wsutil and cannot be used with a wmem scope, requiring some code duplication or extra memory allocations, or vice-versa, code in epan cannot be moved to wsutil because it has a wmem dependency. To this end wmem is moved to wsutil. Scope management remains part of epan because those scope semantics are specific to dissection.
2021-07-13prefs_register_protocol_obsolete protocols with only obsolete prefsChuck Craft1-0/+1
Related to #17465 and !3526
2021-07-08Consistently refer to blocks that have been modified as "modified".Guy Harris1-1/+1
"User" sounds as if the blocks belong to the user; at most, the current user might have modified them directly, but they might also have, for example, run a Lua script that, unknown to them, modified comments. Also, a file might have "user comments" added by a previous user, who them wrote the file and and provided it to the current user. "Modified" seems a bit clearer than "changed".
2021-07-07Use wtap_blocks for packet commentsDavid Perry2-2/+15
Mostly functioning proof of concept for #14329. This work is intended to allow Wireshark to support multiple packet comments per packet. Uses and expands upon the `wtap_block` API in `wiretap/wtap_opttypes.h`. It attaches a `wtap_block` structure to `wtap_rec` in place of its current `opt_comment` and `packet_verdict` members to hold OPT_COMMENT and OPT_PKT_VERDICT option values.
2021-07-07QUIC: improve "Follow QUIC Stream" supportNardi Ivan1-0/+2
This functionality has been added in d2a660d8, where its limitations are described. Improvements: * the Substream index menu now properly filters for available stream numbers; * Follow Stream selects the first stream in the current packet Known issue (which is still there): if a packet contains multiple QUIC streams, then we will show data also from streams other than the selected one (see #16093) Note that there is no way to follow a QUIC connection. Close #17453
2021-07-07wmem: add a GCompareFunc implementation to compare unsigned integer 64 bits longNardi Ivan1-0/+1
2021-06-26wslog: Check environment initialization for errorsJoão Valverde1-1/+2
Initialiaze the cmdarg error stream earlier. Dumpcap also needs to know earlier if it is running in capture child mode.
2021-06-25wsutil: Rewrite ws_assert() to minimize dependenciesJoão Valverde1-0/+1
This includes as little as possible in the assertion header, so that it can be included globally in every file without pulling any unwanted definitions. In particular pulling stdlib.h is avoided because that can have side effects if it wants to include non-portable extensions. It is possible to have side-effects from include glib.h too, for example because of G_LOG_DOMAIN. These side-effects are usually avoidable with careful ordering of pre-processor directives but with multiple levels of indirections it can be hard to track. Better to make it robust to these kinds of failures in the first place. Also integrate with our logger for a cohesive experience (but keep it a private dependency).
2021-06-23pcapng: add support for custom optionsMichael Tuexen1-0/+1
2021-06-21NGAP: fix dissection of multiple NGAP messages in the same HTTP2 packetPascal Quantin1-0/+3
Also add dissection for more containers
2021-06-21wslog: Shorten ws_log_message_is_active() nameJoão Valverde1-1/+1
2021-06-18wslog: Add support for inverted debug matchesJoão Valverde1-1/+1
The --log-debug and --log-noisy now accepts a '!' to invert the match and disable the debug (noisy respectively) log level for the listed domains. Note this is different from --log-domains, that option enables/disables the entire log domain itself, regardless of log level.
2021-06-17wslog: Add more documentationJoão Valverde1-0/+1
2021-06-17wslog: Add a noisy debug levelJoão Valverde1-2/+3
This is intended to replace logging in dissectors that has a debug level with #ifdef DEBUG_foo and an extra level guarded by a #ifdef DEBUG_EXTRA_foo. But generally it can be used as another level of granularity for debugging output, to avoid flooding the log with too much information with typical usage. Rename the filter functions without the unnecessary 'str' suffix.
2021-06-17wslog: Add a new log-debug optionJoão Valverde1-0/+1
Option --log-debug or WIRESHARK_LOG_DEBUG is a list of domains that are set to a "debug" log level. This takes precedence over the normal log level and domain filter options.
2021-06-17wslog: Add a new log-fatal optionJoão Valverde1-0/+2
Enviroment variable WIRESHARK_LOG_FATAL and command line option --log-fatal set the fatal log level. Messages with fatal or highr priority cause the program to abort. By default the fatal level is "error", but it can be set to "critical" or "warning" with this option.
2021-06-15tvbuff: add tvb_ensure_reported_length_remaining().Guy Harris1-0/+1
It is to tvb_reported_length_remaining() as tvb_ensure_captured_length_remaining() is to tvb_captured_length_remaining() - it throws an exception if the offset is out of range. (Note that an offset that's just past the end of the {reported, captured} data is *not* out of range, it just means that there is no data remaining. Anything *past* that is out of range and thus invalid.)
2021-06-15wslog: Add ws_logv_full()João Valverde1-0/+1
2021-06-15Debian: Remove a symbol.Gerald Combs1-1/+0
Remove ws_log_fprint.
2021-06-14wslog: Use buffered I/OJoão Valverde1-0/+1
Use standard buffered I/O instead of printing to a string. This is more efficient, cleaner and allows custom output per stream.
2021-06-14wslog: Parse cmd line options in one passJoão Valverde1-2/+1
2021-06-14wslog: Add support for domain filteringJoão Valverde1-1/+2
A domain filter can be given in the environment variable 'WS_LOG_DOMAINS' or in a command-line options "--log-domains". The filter is specified as a comma separated case insensitive list, for example: ./tshark --log-domains=main,capture Domain data type switches from an enum to a string. There is no constaint on adding new domains, neither in code or at runtime. The string format is arbitrary, only positive matches will produce output.
2021-06-14wslog: Improve code modularity and efficiencyJoão Valverde1-1/+1
Also tweak format for readability.
2021-06-13Remove lingering circuit API from stream.hJohn Thacker1-2/+2
The circuit API was removed and replaced with the conversation "_by_id" API that uses a single uint32 value by commit 800b26edbe34e135cc9be1d4395db2c13ae1213f Remove the lingering references to circuits from the stream API, since it's just used with conversations now.
2021-06-11Refactor our logging and extend the wslog APIJoão Valverde1-0/+13
Experience has shown that: 1. The current logging methods are not very reliable or practical. A logging bitmask makes little sense as the user-facing interface (who would want debug but not crtical messages for example?); it's computer-friendly and user-unfriendly. More importantly the console log level preference is initialized too late in the startup process to be used for the logging subsystem and that fact raises a number of annoying and hard-to-fix usability issues. 2. Coding around G_MESSAGES_DEBUG to comply with our log level mask and not clobber the user's settings or not create unexpected log misses is unworkable and generally follows the principle of most surprise. The fact that G_MESSAGES_DEBUG="all" can leak to other programs using GLib is also annoying. 3. The non-structured GLib logging API is very opinionated and lacks configurability beyond replacing the log handler. 4. Windows GUI has some special code to attach to a console, but it would be nice to abstract away the rest under a single interface. 5. Using this logger seems to be noticeably faster. Deprecate the console log level preference and extend our API to implement a log handler in wsutil/wslog.h to provide easy-to-use, flexible and dependable logging during all execution phases. Log levels have a hierarchy, from most verbose to least verbose (debug to error). When a given level is set everything above that is also enabled. The log level can be set with an environment variable or a command line option (parsed as soon as possible but still later than the environment). The default log level is "message". Dissector logging is not included because it is not clear what log domain they should use. An explosion to thousands of domains is not desirable and putting everything in a single domain is probably too coarse and noisy. For now I think it makes sense to let them do their own thing using g_log_default_handler() and continue using the G_MESSAGES_DEBUG mechanism with specific domains for each individual dissector. In the future a mechanism may be added to selectively enable these domains at runtime while trying to avoid the problems introduced by G_MESSAGES_DEBUG.
2021-06-07wsutil: Add filesystem write_file_binary_mode()Stig Bjørlykke1-0/+1
Add a generic function to write content to file. Use this on write TLS session keys from UI and tshark, and for export objects. Remove the now unused export_object_ui.[ch].
2021-06-06wslog: Include function name in ws_debug() output formatJoão Valverde1-0/+1
The GLib documentation says G_STRLOC includes the function name but that is a lie[1]. Change ws_debug() to not use G_STRLOC and receive __FILE__, __LINE__ and G_STRFUNC separately instead. [1]https://bugzilla.gnome.org/show_bug.cgi?id=69097
2021-05-31wiretap: un-export some routines.Guy Harris1-2/+0
wtap_file_get_shb_for_new_file() and wtap_file_get_nrb_for_new_file() are intended to be used only internally to libwiretap and by libwiretap plugins.
2021-05-08http: Add dissection of HTTP2-SettingsAnders Broman1-0/+1
Closes #17370
2021-04-02maxmind: add optional synchronous lookupsDavid Perry1-0/+1
When tshark enables synchronous resolution of IP addresses to names, forces calls to maxmind_db_lookup_ipv4()/_ipv6() to block-wait for the maxmind response. Proposed fix for #14691.
2021-03-25wsutils: add local implementation of g_memdup2.Dario Lombardo1-0/+1
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68, we provide our own copy of g_memdup2() for older GLib versions.
2021-03-15Add more error-reporting routines that call through a function pointer.Guy Harris1-0/+6
Have routines to report capture-file errors, using libwireshark error codes and strings, that call through a pointer, so they can pop up dialogs in GUI apps, print a message to the standard error on command-line apps, and possibly do something different on server programs. Have init_report_message() take a pointer to structure containing those function pointers, rather than the function pointers themselves, as arguments. Make other API changes to make that work.
2021-03-14libwiretap: make wtap_wtap_encap_to_pcap_encap() private to the library.Guy Harris1-1/+1
Only a tiny amount of code outside libwiretap needs to know about pcap/pcapng LINKTYPE_ values, and all that code needs to know is, for a given LINKTYPE_ value, what the corresponding WTAP_ENCAP_ value is. Nothing should need to know, for a given WTAP_ENCAP_ value, what its LINKTYPE_ value is. Make it the case that nothing *does* need to know, for a given WTAP_ENCAP_ value, what its LINKTYPE_ value is. Export wtap_dump_can_write_encap() and use *that*, in the "import hex dump" code, what formats can be written to a pcap file.
2021-03-13debian: wtap_register_backwards_compatibility_lua_name isn't a public API.Guy Harris1-1/+0
It's *not* for use by plugins, it's *only* for use by existing built-in file type/subtype modules to provide support for an old deprecated mechanism in Lua code.