Commit Graph

126 Commits

Author SHA1 Message Date
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Martin Kaiser 40312bf2eb [mp2t] add an expert info for invalid adaptation_field_control values
use it for docsis and for null packets
do some other minor cleanup while at it

Change-Id: I605f0a9291aa7715d1fe68449c39a2e18e03fa18
Reviewed-on: https://code.wireshark.org/review/12853
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-23 17:47:50 +00:00
Martin Kaiser 1308189348 [mp2t] adaptation_field_control for NULL packets should not be 0
just remove the wrong statement, I'll add some expert info later...

Bug: 11921
Change-Id: I1a4f2e32e9c7c32c54b251445f8750d7c3f5ab6f
Reviewed-on: https://code.wireshark.org/review/12850
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-23 17:17:48 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 8faf5c80b3 register_dissector -> new_register_dissector
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I25fe6a0aac93980333217d007702799d16946563
Reviewed-on: https://code.wireshark.org/review/11816
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-14 18:00:00 +00:00
Jeff Morriss 7f591e4c07 Clean up more unnecessary use of the 'volatile' key word.
Change-Id: I3e72fddc6ed380780d7e2e1c8df87e580138188d
Reviewed-on: https://code.wireshark.org/review/11271
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-26 11:28:41 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Jeff Morriss b9001b0f90 Tell the user (via COL_INFO) when a frame is a fragment (reassembled later).
See:

https://www.wireshark.org/lists/wireshark-users/201508/msg00023.html

(Also set a fence on COL_INFO so we can see each packet's contribution to
the column.)

Change-Id: I9a4b1f60c5ad7065c2f025bbcca1dd2d09fec9de
Reviewed-on: https://code.wireshark.org/review/10471
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-10 23:10:27 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Michael Mann be7d295fbf Add "user presentable" and "unique string ids" to heuristic table entries.
This allows better presentation of heuristic dissectors to the end user.

Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6
Reviewed-on: https://code.wireshark.org/review/9602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12 03:14:38 +00:00
Peter Wu 80f7ee063d Call reassembly_table_destroy for some dissectors
This patch adds reassembly_table_destroy calls as cleanup function for
dissectors which have a simple init routine that just calls
reassembly_table_init (comments are ignored).

The changes were automatically generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e
(with the if and assignment parsers disabled).

The only difference from the autogenerated output is that the XXX
comments from the init routines in smb-pipe and tds dissectors are kept.

Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7
Reviewed-on: https://code.wireshark.org/review/9222
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:34:28 +00:00
Michael Mann 74e526f196 Add proper "Decode As" mechanism for L2TPv3 subdissectors instead of preference.
Change-Id: I87f6f9f40e1c33148de43b53a8881d51416f5d2c
Reviewed-on: https://code.wireshark.org/review/7898
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 16:42:28 +00:00
Pascal Quantin 436a064513 MP2T: restore addresses once fragments are added to the hash table
It allows to have "Follow UDP stream" context menu working again

Bug: 11055
Change-Id: I8eae15bfddb45ea033eb8dd2e3f7ca038057421a
Reviewed-on: https://code.wireshark.org/review/7662
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-12 22:29:30 +00:00
Michael Mann 8d16ac46d5 Add name resolution support to address type.
Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string.

Convert AT_FCWWN to using proper name resolution format

First use of address_with_resolution_to_str with field types in proto.c

Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2
Reviewed-on: https://code.wireshark.org/review/7196
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-19 13:09:41 +00:00
Michael Mann 8ff944d4ab Add fixed length function for address types.
This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c.  Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file.

Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4
Reviewed-on: https://code.wireshark.org/review/7038
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 03:49:13 +00:00
Michael Mann 2875cd382f Eliminate the hf member out of the address structure.
Using the new address type registration, dissectors can create their own address types with their own (column) filters attached to them, eliminating the need for an address to keep track of a hf_ field.

Change-Id: I2bbec256a056f403a7ac9880d5d76a0b2a21b221
Ping-Bug: 7728
Reviewed-on: https://code.wireshark.org/review/7037
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 03:48:53 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Guy Harris 2b006ad30e Have a heur_dissector_list_t be an opaque handle.
This allows dissector lists to be looked up by name, so they can be
shared by multiple dissectors.

(This means that there's no "udplite" heuristic dissector list, but
there shouldn't be one - protocols can run atop UDP or UDPLite equally
well, and they share a port namespace and uint dissector table, so they
should share a heuristic dissector table as well.)

Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7
Reviewed-on: https://code.wireshark.org/review/5936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21 04:14:24 +00:00
Bill Meier 425bc304fe eth,mp2t: Rename ei[] filter names duplicating hf[] filter names.
Change-Id: I1a9e8344866ce5a5bbd48b07c49baa398ce161f7
Reviewed-on: https://code.wireshark.org/review/5724
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-11 19:08:17 +00:00
Evan Huus f9d4e0a815 Replace deprecated tvb_length calls
And a few other misc. cleanups while in the neighbourhood.

Change-Id: Ic0d6836dec9c36d31ea244a6adc74d4713565090
Reviewed-on: https://code.wireshark.org/review/4047
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-10 07:54:00 +00:00
Evan Huus a23bbaf268 Revert "Explicitly lengthen some constants to 64 bits"
Guy already fixed the issue, I was looking at a stale buildbot page.

This reverts commit f9bfa976e6.

Change-Id: I04e2f1ddfae9558b6cec40740ffbb66a16c3fecb
Reviewed-on: https://code.wireshark.org/review/4046
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-09 00:00:18 +00:00
Evan Huus f9bfa976e6 Explicitly lengthen some constants to 64 bits
Hopefully squashes the mac buildbot error

packet-mp2t.c:993: warning: implicit conversion shortens 64-bit value into a
32-bit value

Change-Id: I9ca6420925442b56cfdf5db629b63d6ead7bdfbd
Reviewed-on: https://code.wireshark.org/review/4045
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-08 23:54:26 +00:00
Guy Harris 7143bd72f9 Do the PCR and the original PCR the same way.
In both cases, make the extension a 16-bit variable, cast the result of
extracting the extension to guint16 to clarify that only the 9 bits
visible through the mask matter.

While we're at it, there's no need to use
"proto_tree_add_uint64_format_value() if the format is just the standard
format for a 64-bit unsigned integer.

Change-Id: I8f1f48595830d4672984f3797be1c9d994e64ea0
Reviewed-on: https://code.wireshark.org/review/4043
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-08 21:51:25 +00:00
Martin Kaiser 4af01a8f30 don't skip another 6 bytes after OPCR
Bug: 10446

simplify OPCR calculation while we're at it

Change-Id: I8590e409895e712fe6bbb64ab23093caf5795fa7
Reviewed-on: https://code.wireshark.org/review/4040
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-08 20:53:28 +00:00
Michael Mann d68d0e88b4 Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.

Change-Id: If73a029f564219782c313d4154c24c7ce7458b52
Reviewed-on: https://code.wireshark.org/review/3574
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-14 04:21:05 +00:00
Martin Kaiser c21a8a7624 remove some more unnecessary initializations
Change-Id: I74b082b7644f36efc3dc220ff92f1bfff524c408
Reviewed-on: https://code.wireshark.org/review/3119
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-19 12:21:41 +00:00
Martin Kaiser 7d0ad3f9d2 no need to initialize these pointers
Change-Id: I0791ca2fc9a7a87dafbdf15f51d9f1a9d12aa89e
Reviewed-on: https://code.wireshark.org/review/3118
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-19 12:20:24 +00:00
Martin Kaiser 6885cc71d3 use gboolean for detected_drop
Change-Id: Ice0c68541604c5566cc807c17faf534cd6628262
Reviewed-on: https://code.wireshark.org/review/3117
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-19 12:20:04 +00:00
Michael Mann c7a6e6fa13 convert to proto_tree_add_subtree[_format]
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc
Reviewed-on: https://code.wireshark.org/review/2852
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:59:14 +00:00
Guy Harris ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +00:00
Martin Kaiser 1e9bc6e483 handle TS packet reassembly for PES packets with 0 length field
(unknown length)

this fixes bug 9527

Change-Id: I255ae9662dfeea06e61e4b0891e0ea8eaa254d0f
Reviewed-on: https://code.wireshark.org/review/2462
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-06-19 21:52:44 +00:00
Martin Kaiser 0c0bd541a1 no need to initialize these two vars
Change-Id: Ie1a71046b791bcbbf3cf02ddd1c4ddc88b388302
Reviewed-on: https://code.wireshark.org/review/2461
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-06-19 21:52:25 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Martin Kaiser 653dd75483 simplify PCR calculation
Change-Id: I892088e158519e331cba89be3c8d7c71f38a8925
Reviewed-on: https://code.wireshark.org/review/1964
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-05 04:12:33 +00:00
Martin Kaiser cd4ba3d271 make the PCR value filterable
this fixes bug #10158

Change-Id: Ic67b074c464c52ac523e835b9815a5c3a3fa14d9
Reviewed-on: https://code.wireshark.org/review/1925
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-03 13:09:24 +00:00
Guy Martin eb3cdb925c Zero out pinfo->src and dst before adding a frag.
If an mp2t packet contains one full subpacket and the fragment of
another one, it happens that the first subpacket will set src or dst to
an ethernet or IP address. Adding the fragment of the second subpacket
will then use this information for calculating the hash in the fragment
table. However, later fragments in other mp2t packets will not have
these info and reassembly will fail.

Change-Id: Ic52763017cb854851b6686654c2d8a1624305d65
Reviewed-on: https://code.wireshark.org/review/1692
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-23 12:47:48 +00:00
Guy Martin 78ba6e45c2 Fix warning about the adaptation field control for docsis packet. The specs actually say that it should be set to 1.
Change-Id: I136b48c6284c09798ee8e88f012a20e2cb16cd5e
Reviewed-on: https://code.wireshark.org/review/1693
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-19 17:22:09 +00:00
Guy Martin 69623c92d7 Increase frag_id for self contained subpackets in mp2t packets. This fix length calculation on second pass.
Change-Id: I6224657c0765fa9696829844b4819f6ab0a3d3f4
Reviewed-on: https://code.wireshark.org/review/1690
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-19 17:14:46 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki d6b35d5c6b mp2t: return offset when dissecting AF (continuation of r54396)
svn path=/trunk/; revision=54476
2013-12-27 17:42:46 +00:00
Jakub Zawadzki 37ec8781bb mp2t: rework dissecting adaptation field
- move dissecting adaptation field length to dissect_mp2t_adaptation_field()
- return offset, not delta.

svn path=/trunk/; revision=54396
2013-12-23 18:07:28 +00:00
Jakub Zawadzki 8c870995f0 mp2t: avoid calling get_mp2t_conversation_data()
svn path=/trunk/; revision=54395
2013-12-23 18:06:33 +00:00
Anders Broman e8b935ad6e Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54209
2013-12-18 06:51:09 +00:00
Jakub Zawadzki 5c79cbf152 Fix some trivial warnings.
svn path=/trunk/; revision=54085
2013-12-14 10:29:26 +00:00
Jakub Zawadzki 82e2675f45 Avoid including <wiretap/wtap.h> in dissectors.
svn path=/trunk/; revision=53655
2013-11-29 20:53:00 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Martin Kaiser 733713b4b1 if pointer==0, the section starts immediately
don't add an empty fragment to the list

this should fix the asserts reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9325
and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8352

svn path=/trunk/; revision=52969
2013-10-29 21:50:21 +00:00
Martin Kaiser 41182561dd separate function for dissecting the adaptation field
svn path=/trunk/; revision=52967
2013-10-29 21:40:09 +00:00