Commit Graph

42 Commits

Author SHA1 Message Date
Guy Harris c9342873e5 Clarify dissector description, protocol short name, and protocol ong name.
Rename dissector_handle_get_long_name() and
dissector_handle_get_short_name() to
dissector_handle_get_protocol_long_name() and
dissector_handle_get_protocol_short_name(), to clarify that they fetch
names for the protocol that the dissector dissects, not for the
dissector *itself*.  Leave a deprecated
dissector_handle_get_short_name() wrapper, and export
dissector_handle_get_protocol_long_name(), as it's now used in some
dissectors.

Change some calls to dissector_handle_get_description() back to
dissector_handle_get_protocol_short_name(), as they appear to be made in
order to display a *protocol* name.

Rename some methods, variables, enums, and table column names to reflect
cases where the dissector description is being used.
2022-09-13 00:47:24 -07:00
Guy Harris d4394de669 Give dissectors a descriptive string.
It defaults to the short name of the protocol dissected by the
descriptor, but it's now possible to register a dissector with an
explicit description.

This is mainly for use in the Decode As UI.  It handles the case where
the same protocol might have different "Decode As..."-specifiable
dissectors for different situations.
2022-09-12 21:05:14 +00:00
Guy Harris 022dfd56f3 Fix bogus tvbuffs to make sure reported length >= captured length.
A reported length less than a captured length is bogus, as you cannot
capture more data than there is in a packet.

Fixes #18313.
2022-09-03 21:04:55 +00:00
John Thacker 95b45b2555 Qt: Add percent-encoding to Show Packet Bytes
Add Percent-encoding to the list of encoding types that Show
Packet Bytes can handle.

There's a function added to glib 2.66 to handle this for arbitrary
bytes that might have internal nulls (and which allows the result
to be non UTF-8), but we don't require that version yet, so extend
the existing function.

Related to #1084
2022-09-03 17:25:28 +00:00
Guy Harris 308e295669 conversation: bring back conversation_pt_to_endpoint_type().
It may be used by third-party code, and it may be useful on its own, at
least for now.
2022-09-02 00:07:53 -07:00
Guy Harris a6ee179427 conversation: speak of the "conversation key" as just address/port endpoints.
It's not a general key for looking up arbitrary conversations - that's
what an array of conversation elements is for - it's just a pair of
address/port endpoints.  (It's not even hijacked for conversations
identified by a circuit ID any more.)
2022-08-29 19:19:59 -07:00
John Thacker fe22512461 debian packaging: Fix missing symbols for renamed routines
Commit deb95a275d and
commit 8195bdd340 renamed several
conversation related routines. Update the names for debian/ubuntu
2022-08-27 14:46:40 +00:00
Guy Harris d9e662bc54 Rename some functions and types for endpoint tables.
The "conversation table" mechanism supports two types of tables, one for
the "Conversations" menu item under "Statistics" and one for the
"Endpoints" menu item under "Statistics".  The first of them shows
statistics for conversations at various layers of the networking stack;
the second of them shows statistics for endpoints at various layers of
the networking stack.

The latter is *not* a table of hosts; an endpoint might be a host,
identified by an address at some network level (MAC, IP, etc.), or it
might be a port on a host, identified by an address/port pair.

Some data types, function names, etc. use "host" or "hostlist" or other
terms that imply that an endpoint is a host; change them to speak of
endpoints rather than hosts, using names similar to the corresponding
functions for conversations.

Provide wrapper functions and typedefs for backwards source and binary
compatibility; mark them as deprecated in favor of the new names.

Clean up some comment errors found in the process.
2022-08-23 09:55:14 +00:00
John Thacker 0749873c70 decode as: Add data dissector to all tables that support Decode As
Register the data dissector to all dissector tables that support
Decode As. This provides a way to disable decoding for table
entries that have a default dissector registered to a value.
It is particularly useful when a dissector is registered by default
to several values (e.g. HTTP), to be able to disable decoding
for one port without disabling the dissector in general.

It is also useful to prevent payloads from being handed off
to heuristic dissectors, and is thus distinguished from the
fallback to data when no dissector is set.  N.B.: that this has no
effect on dissectors that have a "Try heuristic sub-dissectors first"
preference set to TRUE.

It does not solve a second issue for table entries with a default
dissector - setting the dissector to "none" in order to force
payloads to be sent to heuristic dissectors without setting a
preference as above. (Note that in some cases one will wish to
send dissection on some ports to heuristics without enabling
heuristics first for _all_ ports.)

Fix #17518. Fix #15717. Related to #12098, which also needs the
last issue mentioned above addressed.
2022-07-16 16:02:36 -04:00
Gerald Combs 3a989f2e72 Debian: Add missing symbols. 2022-07-15 13:10:26 -05:00
Joakim Karlsson bf8577b88c pfcp: change to utilize proto_tree_add_bitmask_list 2022-07-14 12:46:09 +00:00
Chuck Craft e12954a637 epan: ws_debug log for heuristic that claims frame (len != 0)
It's possible for a dissector to claim a frame without adding to
the tree or being added to frame.protocols (see !6669)
Log a debug message showing the pinfo layers and the dissector that
claimed the tvb (frame/packet).
2022-07-12 14:15:33 +00:00
John Thacker 8ac995578c epan: Respect custom column resolved/unresolved status everywhere
Add a function to get the column text of the nth column, taking
into account whether the column is resolved or unresolved. Use
this function in the GUI, as well as in tshark, when writing
PSML, exporting dissection to PSML, etc., instead of accessing
col_data directly.

This removes the direct accesses of col_data from outside
column.c and column-utils.c

Fix #18168.
2022-07-12 00:22:11 +00:00
Anders Broman fed641fc27 http: Add path components to tree 2022-07-04 17:45:08 +00:00
João Valverde d8140e92c9 Fix Debian symbols 2022-06-21 18:03:04 +01:00
João Valverde e89784a577 Fix Debian symbols 2022-06-20 20:24:06 +00:00
John Thacker f1cbc6b662 epan: Remove fragment_get_reassembled()
Because completed reassemblies are hashed in the reassembled_table for
all the frame numbers that contributed fragments,
fragment_get_reassembled_id() works wherever fragment_get_reassembled()
does, and also works where the fragment id is not the frame number.

However, since the reassembled_table hash key only depends on the
fragment id and the frame number, it only allows a frame to have
one reassembly with a given fragment id. Some protocols can have
more than one reassembly with a given fragment id (that differ on
addresses or other keys), such as GSM SMS, and the wrong reassembly
is retrieved on the second pass in those cases.

For this reason, we might want to add additional key elements to
reassembled_table, such as layer number. fragment_get_reassembled_id
already takes packet_info as a parameter and can accommodate that
without further changes, but fragment_get_reassembled cannot, so
remove the latter in favor of the former.
2022-06-14 00:59:34 +00:00
Triton Circonflexe 1e8beaa245 Add support for UUID type in Thrift
Closes #18125
2022-06-12 08:56:25 +00:00
John Thacker a3e0d93bed debian: Remove removed symbols
Commit 5cd591129f removes a number
of conversation related functions. Remove them from the debian
symbol list.

The commit also removed the implementation of conversation_hash_exact,
so remove the declaration from the header file.
2022-06-05 22:48:43 -04:00
Dario Lombardo 941539b6a2 debian: add missing symbol. 2022-05-27 23:04:50 +00:00
Gerald Combs be929e162d epan: Allow conversations based on arbitrary element lists.
Add conversation_new_full and find_conversation_full, which take
arbitrary element lists instead of fixed addresses and ports.

Update the comments in conversation.h to be more Doxygen-conformant.
Update README.dissector.

Use the new functionality to add initial conversation support to the
Falco Bridge dissector.
2022-05-23 18:12:26 +00:00
Dario Lombardo a6dcf70f68 debian: add missing symbol. 2022-04-27 20:58:11 +00:00
Gerald Combs 87b0288b8d epan: Add the ability to add conversation filter protocols.
Convert our conversation protocols to a dynamic list and add
add_conversation_filter_protocol(). Use it in the Falco Bridge plugin to
add protocols with conversation filters.
2022-04-19 22:25:32 +00:00
João Valverde eb2a9889c3 dfilter: Add abs() function
Add an absolute value function for ftypes.
2022-04-18 17:09:00 +01:00
Anders Broman 096947337e PER:Add function to add "PER encoded lable" to the tree. 2022-04-12 08:33:36 +02:00
Gerald Combs 3b8ea97731 Debian: Add missing symbols. 2022-04-11 11:41:17 -07:00
Gerald Combs 4b556d6bc6 Qt+epan: Get log conversation filters working.
In conversation_filter.h, add a separate log_conv_filter_list. Use it in
register_log_conversation_filter and add conversation_filter_from_log.
It looks like we no longer use find_conversation_filter externally, so
remove it from the API.
2022-04-11 17:26:50 +00:00
João Valverde 4d9470e7dd dfilter: Add location tracking to scanner and use it to report errors
Add location tracking as a column offset and length from offset
to the scanner. Our input is a single line only so we don't need
to track line offset.

Record that information in the syntax tree. Return the error location
in dfilter_compile(). Use it in dftest to mark the location of the
error in the filter string. Later it would be nice to use the location
in the GUI as well.

$ dftest "ip.proto == aaaaaa and tcp.port == 123"
Filter: ip.proto == aaaaaa and tcp.port == 123
dftest: "aaaaaa" cannot be found among the possible values for ip.proto.
	ip.proto == aaaaaa and tcp.port == 123
	            ^~~~~~
2022-04-10 10:09:51 +01:00
John Thacker 444e3f230c tcp reassembly: Add fragment_add_out_of_order 2022-04-06 07:53:02 -04:00
João Valverde c98df5eef5 dfilter: Print syntax tree using dftest + format enhancements
Add argument to dfilter_compile_real() to save syntax tree text
representation.

Use it with dftest to print syntax tree.

Misc debug output format improvements.
2022-04-05 12:04:37 +01:00
Dario Lombardo 45268efd0a
debian: add missing symbol. 2022-03-31 14:08:18 +02:00
João Valverde 260942e170 dfilter: Refactor macro tree references
This replaces the current macro reference system with
a completely different implementation. Instead of a macro a reference
is a syntax element. A reference is a constant that can be filled
in the dfilter code after compilation from an existing protocol tree.
It is best understood as a field value that can be read from a fixed
tree that is not the frame being filtered. Usually this fixed tree
is the currently selected frame when the filter is applied. This
allows comparing fields in the filtered frame with fields in the
selected frame.

Because the field reference syntax uses the same sigil notation
as a macro we have to use a heuristic to distinguish them:
if the name has a dot it is a field reference, otherwise
it is a macro name.

The reference is synctatically validated at compile time.

There are two main advantages to this implementation (and a couple of
minor ones):

The protocol tree for each selected frame is only walked if we have a
display filter and if the display filter uses references. Also only the
actual reference values are copied, intead of loading the entire tree
into a hash table (in textual form even).

The other advantage is that the reference is tested like a protocol
field against all the values in the selected frame (if there is more
than one).

Currently the reference fields are not "primed" during dissection, so
the entire tree is walked to find a particular reference (this is
similar to the previous implementation).

If the display filter contains a valid reference and the reference is
not loaded at the time the filter is run the result is the same as a
non existing field for a regular READ_TREE instruction.

Fixes #17599.
2022-03-29 12:36:31 +00:00
Gerald Combs 499a33c709 Debian: Add a symbol. 2022-03-28 18:53:27 +00:00
João Valverde 0335ebdc3a dfilter: ftype_is_true -> ftype_is_zero 2022-03-23 11:04:41 +00:00
Gerald Combs e06864e777 Falco Bridge: Miscellaneous fixes.
Fix some issues found by the pre-commit script. Add a missing Debian
symbol. Update the README.
2022-03-22 17:51:32 +00:00
Dario Lombardo a3877af990
debian: add missing symbol. 2022-03-22 17:14:38 +01:00
Jaap Keuter bdb460ef69 Bluetooth: have BT specific global names contain bluetooth 2022-03-14 20:02:10 +00:00
Gerald Combs 1b8d2bcf37 Debian: Update our symbols. 2022-03-05 16:05:09 -08:00
John Thacker cbf76ea22f Export PDU: Allow native encapsulations / strip headers
Allow export PDU taps to be registered with a wiretap encapsulation
instead of always using WTAP_ENCAP_WIRESHARK_UPPER_PDU. This allows
creating normal capture files that aren't tied to wireshark without
having to do a "editcap -C -L -T", as well as creating files in
formats other than pcapng and pcap with tshark.

Provide a couple sample implementations in Ethernet (WTAP_ENCAP_ETHERNET)
and IP (v4 and v6, WTAP_ENCAP_RAW_IP) that are the most common use cases.
(I can imagine a few others; WTAP_ENCAP_MPEG_2_TS could probably be
useful, for example.) Fixes #15141
2022-02-25 20:29:16 -05:00
Michał Łabędzki d1e5ae8385 Bluetooth: make dissect_bluetooth_common() public API
It creates bluetooth_data_t what is The Center of the Bluetooth World in Wireshark,
most important is that bluetooth_data_t must provide shared trees (resources) to enable
dissection for non trivial relations in Bluetooth, for example mapping BDADDR to name.

Issue: 17570
Change-Id: Ice17b804ab6d4dcf0f77f1b2356a6712ce7e64b1
2022-02-25 02:13:18 +00:00
David Perry e2fab18853 wsutil: New API to gather compile/runtime info 2022-02-24 13:27:08 +00:00
Gerald Combs 79da670bd1 Packaging+GitLab CI: Move debian to the packaging directory.
We keep our various packaging assets in the "packaging" directory. Move
the Debian assets there. dpkg-buildpackage doesn't seem appear to have a
"debian directory path" option, but symlinking worked in my test
container.
2022-02-13 13:21:58 -08:00