Commit graph

114 commits

Author SHA1 Message Date
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
Martin Kaiser
6ef5eb635c TABs -> spaces
add editor modelines

svn path=/trunk/; revision=52934
2013-10-28 21:49:56 +00:00
Martin Kaiser
5587250676 make Pointer filterable
svn path=/trunk/; revision=52925
2013-10-28 17:16:43 +00:00
Martin Kaiser
8367a1acbd packed_analysis_data_t -> packet_analysis_data_t
svn path=/trunk/; revision=52924
2013-10-28 17:13:13 +00:00
Martin Kaiser
1a7a05ab55 correct typos
svn path=/trunk/; revision=52923
2013-10-28 17:10:09 +00:00
Martin Kaiser
8a2b9d87f3 remove unnecessary return; lines
svn path=/trunk/; revision=52922
2013-10-28 17:08:55 +00:00
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Alexis La Goutte
9c43ccd371 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=51668
2013-09-02 23:13:12 +00:00
Evan Huus
14e6dddcdc Replace some emem with wmem.
svn path=/trunk/; revision=51512
2013-08-25 14:23:13 +00:00
Jakub Zawadzki
f4bcbeb9f2 Keep result of [new_]register_dissector in some dissectors. [2 of x]
(don't create new dissector handle if we can use already existing one)

svn path=/trunk/; revision=51159
2013-08-05 19:09:44 +00:00
Jakub Zawadzki
a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Chris Maynard
e37533ced7 Fix warnings: comma at end of enumerator list.
svn path=/trunk/; revision=50640
2013-07-15 21:37:55 +00:00
Jakub Zawadzki
2671b8a398 fix: packet-mp2t.c:489: warning: implicit declaration of function 'tvb_new_proxy'
svn path=/trunk/; revision=50581
2013-07-14 15:20:09 +00:00