aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-udp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-07-04store tcp/udp port names in epan scopeEvan Huus1-1/+1
This causes them to be freed on shutdown, cleaning up ~800KB of "reachable" memory according to valgrind. The fact that we even need to construct these as value_strings is questionable IMHO, but that's a problem for a later date. Switch epan_scope to the BLOCK allocator now that we're using it for so much more, this gives a small but measurable increase in startup time. Change-Id: I187460b769e28da3c6629abac1d9196727ae7dde Reviewed-on: https://code.wireshark.org/review/9483 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-10Provide port names for UDP ports so they can be used in filter expressions.Michael Mann1-4/+26
Change-Id: I134290624d40b7a14c3aaeb2f0793838a411805e Reviewed-on: https://code.wireshark.org/review/8876 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>
2015-01-08ep_<protocol>_port_to_display -> <protocol>_port_to_displayMichael Mann1-2/+2
Adjust any other ep_ related APIs related to the transition. Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c Reviewed-on: https://code.wireshark.org/review/6388 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-02tshark: Add endpoints statisticsMichael Mann1-7/+1
"stat name" has been official changed to "endpoints" for all dissectors, rather than a mixture of "host"/"endpoints" based on dissector. Change-Id: If34bcb5165b493948e784ba038ab202803a59843 Reviewed-on: https://code.wireshark.org/review/6154 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> 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-12-29Add ability to follow UDP stream by indexPascal Quantin1-1/+1
-z "follow,udp" tshark cli command now supports a stream index It is now possible to select the UDP stream displayed in Qt GUI (like for TCP) Change-Id: Ia367f36ea4f60db0fddb997a7e0903c09e172f2d Reviewed-on: https://code.wireshark.org/review/6083 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-28Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.Michael Mann1-2/+2
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b Reviewed-on: https://code.wireshark.org/review/6060 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26UDP: fix 'Follow Stream' button from conversations tabPascal Quantin1-1/+1
Add stream index to conversation table Change-Id: Id63b2cc0000d89297c8638b9a89315096fc5458b Reviewed-on: https://code.wireshark.org/review/6062 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-26Fix assertion when applying conversation colorPascal Quantin1-2/+2
Packet scoped memory cannot be used here; let's use the pinfo pool Change-Id: If76605f7a3021f5900fd46ce7d1c642a518c902f Reviewed-on: https://code.wireshark.org/review/6061 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-26Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.Michael Mann1-2/+2
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-3/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+0
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-21Have a heur_dissector_list_t be an opaque handle.Guy Harris1-2/+1
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-19Use new color_dissector_filters.[ch] to refactor (color) conversation ↵Michael Mann1-1/+1
generation in GTK menus. Change-Id: I5868a40b71a989a3a1522cb091064bb0aaec6daf Reviewed-on: https://code.wireshark.org/review/5828 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-12-10Refactor "color" conversation filtersMichael Mann1-0/+31
Have dissectors register their desire to be part of "color" conversation filters and have the GUI use that registered list. GUI actually using API will come in a separate commit. Change-Id: I5ffe922d97894fe7bf3182056b76ab5839a9461a Reviewed-on: https://code.wireshark.org/review/5658 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-28Endpoint: wrong filter when select a UDP endpoint (INVALID == a.x.y.z ...)Alexis La Goutte1-2/+23
Change-Id: Ie46d6c201df0b0164a8bf96c02d6430734fd2948 Reviewed-on: https://code.wireshark.org/review/5518 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>
2014-08-31conv is always used, remove _U_ (unused) flagAlexis La Goutte1-1/+1
Change-Id: I648b365b662bd902e26e0c61f6d3499e8543e504 Reviewed-on: https://code.wireshark.org/review/3935 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-27TCP/UDP/SCTP: fix Dereference of null pointer found by Clang AnalyzerAlexis La Goutte1-0/+4
The warning coming after change in g018b84de8 Change-Id: Ia96cdb2993a6283d8de2647c6723ec6b2b0977eb Reviewed-on: https://code.wireshark.org/review/3752 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-18Refactor "common" hostlist/endpoint table functionality.Michael Mann1-4/+32
This is very similar in architecture to the changes made to the Conversation table functionality. Since all conversations have endpoints/hostlists, the "registered" list is shared for both. Change-Id: Ie8c6910a68a1b3f27c5b18c4494f49b9404a7b31 Reviewed-on: https://code.wireshark.org/review/3214 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-09Clean up Internet checksum handling.Guy Harris1-9/+5
Add macros to set entries of a vec_t, one for use when you have a pointer to private data, and one for use when you have data in a tvbuff. The latter wraps the use of tvb_get_ptr(), so that you're not directly calling it in a dissector. Move ip_checksum() to epan/in_cksum.c, and add an ip_checksum_tvb() that wraps the use of tvb_get_ptr(). In the CARP dissector, give the length variable an unsigned type - there's no benefit to it being signed, and that requires some casts to be thrown around. In the DCCP dissector, check only against the coverage length to see if we have enough data, combine the "should we check the checksum?" check with the "*can* we check the checksum?" check in a single if, and throw a dissector assertion if the source network address type isn't IPv4 or IPv6. Get rid of inclues of <epan/in_cksum.h> in dissectors that don't use any of the Internet checksum routines. In the HIP dissector, make sure we have the data to calculate the checksum before doing so. Change-Id: I2f9674775dbb54c533d33082632809f7d32ec8ae Reviewed-on: https://code.wireshark.org/review/3517 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03Fix TCP/UDP/SCTP conversations broken by g59ef97d and g31ecdf5Pascal Quantin1-0/+21
Bug: 10336 Change-Id: Ia0dbe3abfade59a1c9714eacd8a854eafa6cf879 Reviewed-on: https://code.wireshark.org/review/3379 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: Anders Broman <a.broman58@gmail.com>
2014-07-30Apply refactored "conversation" (tap) data to TShark.Michael Mann1-1/+1
I intentionally left the fields displayed alone (so they don't exactly match Wireshark GUI), because as Guy points out in bug 6310, not sure its A Bug or A Feature. But at least all types of conversations allowed are in sync with Wireshark GUI. Bug:6310 Change-Id: I722837df510a39dadc1f9a07a99275509516698c Reviewed-on: https://code.wireshark.org/review/3212 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-26Refactor "common" Conversation table functionality.Michael Mann1-0/+29
Refactor (non-GUI) conversation table functionality from gtk/Qt to epan. Also refactor "common GUI" conversation table functionality. The idea is to not have to modify the GUI when a dissector adds a new "conversation type" Change-Id: I11f08d0d7edd631218663ba4b902c4a4c849acda Reviewed-on: https://code.wireshark.org/review/3113 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-07convert to proto_tree_add_subtree[_format]Michael Mann1-2/+1
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144 Reviewed-on: https://code.wireshark.org/review/2904 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-21/+18
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-19udp: display calculated checksumPeter Wu1-1/+14
This patch adds a new "udp.checksum_calculated" field that can be used for display in a column or tshark. Based on d7c4bde2799084aee717dbaa04d7fd4be06cd989 ("tcp: display calculated checksum"). Change-Id: Iefcfd8395adeff7a3ac58a1bfff1a3c97976aa56 Reviewed-on: https://code.wireshark.org/review/1675 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-18Only call ep_tcp_port_to_display/ep_udp_port_to_display once for sorce andAndersBroman1-7/+11
destination ports. Change-Id: I490a716b7991d0d7dfcaecd722a267c77af2e776 Reviewed-on: https://code.wireshark.org/review/1682 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17Introduce col_add_lstr(), use it instead of slower col_add_fstr.Jakub Zawadzki1-2/+4
We have callgrind benchmarks which shows that col_add_fstr() takes 5% of Ir count cause of formatting done in g_vsnprintf(). New col_add_lstr() can be used in few dissectors without much ugliness, and it should be a little faster. Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c Reviewed-on: https://code.wireshark.org/review/1629 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-14- curr_layer_num got wrong for STUN.AndersBroman1-6/+4
- Change depreciated API. Change-Id: I6f83f45d2d007d42efc9d81cbaa58c50e67373f1 Reviewed-on: https://code.wireshark.org/review/1636 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-19More name changes.Guy Harris1-5/+5
Add ep_ to routines that may return ephemeral strings. Change "get_XXX" to "XXX_to_display" if the routine returns a formatted string if it can't get a name. Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88 Reviewed-on: https://code.wireshark.org/review/1217 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-23Fix up casing and code formatting in the UDP Decode-As code.Jeff Morriss1-8/+13
svn path=/trunk/; revision=54392
2013-11-29Enable by default UDP conversation (Needed by udp.stream)Alexis La Goutte1-4/+3
svn path=/trunk/; revision=53641
2013-11-29Add udp.stream display filterAlexis La Goutte1-0/+32
The result is the same filter used by Follow UDP (may be reuse the new filter in Follow) svn path=/trunk/; revision=53640
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-3/+3
(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-20Provide "Decode As" functionality through dissectors themselves instead of ↵Michael Mann1-0/+39
the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table. When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog. This patch includes just the dissector portion of the functionality (minus packet-dcerpc.[ch] because it has hooks to the current GUI) svn path=/trunk/; revision=53445
2013-11-07Add infrastructure for section-initializing protocol hfis (without array).Jakub Zawadzki1-0/+2
configure implementation later. svn path=/trunk/; revision=53146
2013-11-01Allow try_conversation_dissector() to pass data to subdissectors.Michael Mann1-1/+1
svn path=/trunk/; revision=53035
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-2/+2
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster. - same for replace col_append_fstr and col_append_str - remove col_clear() when it's redundant: + before a col_set/col_add if the dissector can't throw an exception. - replace col_append() after a col_clear() with faster col_add... or col_set https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344 svn path=/trunk/; revision=52948
2013-10-27Remove iplen and iphdrlen from struct _packet_info.Michael Mann1-1/+1
Dissectors should just use (reported) tvb length and taps have other ways to get the data. svn path=/trunk/; revision=52899
2013-10-24Pascal:s patch from 52759 is needed here too.Anders Broman1-5/+6
curr-num_layer is not always incremented by 1 when calling the subdissector. svn path=/trunk/; revision=52811
2013-10-22curr-num_layer is not always incremented by 1 when calling the subdissectorPascal Quantin1-2/+3
svn path=/trunk/; revision=52759
2013-10-18- Remove hf_ integers from few more dissectorsJakub Zawadzki1-6/+4
- udp: remove proto_udp. svn path=/trunk/; revision=52678
2013-10-16Fix inconsistent indentation & formatting, trailing blanks.Bill Meier1-195/+209
Add some parens. Add editor modelines. svn path=/trunk/; revision=52652
2013-10-15Don't try heuristic dissectors on second pass if no match was found in the ↵Anders Broman1-5/+40
first one. svn path=/trunk/; revision=52631
2013-09-16Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-22/+22
hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either: 1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098
2013-09-12emem -> wmem ("tshark -v" tested)Jörg Mayer1-5/+5
svn path=/trunk/; revision=51979
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-5/+5
svn path=/trunk/; revision=51852
2013-08-17Convert few more dissectors to new proto API.Jakub Zawadzki1-141/+153
svn path=/trunk/; revision=51403
2013-06-12Batch of filterable expert infos with some minor cleanup I noticed while ↵Michael Mann1-7/+24
doing the filter conversions. svn path=/trunk/; revision=49893
2013-03-20[-Wmissing-prototypes]Anders Broman1-2/+5
Use explicit casts. svn path=/trunk/; revision=48439