aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldss.c
AgeCommit message (Collapse)AuthorFilesLines
2022-08-25Rename a bunch of things with "conversation".Guy Harris1-3/+3
A conversation in Wireshark might have two endpoints or might have no endpoints; few if any have one endpoint. Distinguish between conversations and endpoints.
2022-05-15epan: Fix our conversation flagsGerald Combs1-1/+1
Make sure we pass NO_ADDR2 and NO_PORT2 to conversation_new and NO_ADDR_B and NO_PORT_B to find_conversation.
2021-09-01tvbuff: convert helper methods to pinfo->poolEvan Huus1-1/+1
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-07-21First pass pinfo->pool conversionEvan Huus1-1/+1
Automated find/replace of wmem_packet_scope() with pinfo->pool in all files where it didn't cause a build failure. I also tweaked a few of the docs which got caught up.
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-16/+16
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-03ldss: add checks on file digest.Dario Lombardo1-16/+3
Bug: 15620 Change-Id: I600c262f42414dd50c0cf4c1230acfb2a8042212 Reviewed-on: https://code.wireshark.org/review/32520 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-09-08Initialize broadcast_addr at compile time.Guy Harris1-2/+1
Change-Id: I068823f9941a8d1f47bcbaec30ace402e8271d0e Reviewed-on: https://code.wireshark.org/review/29497 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-30LDSS: Fix a read overrun in dissect_ldss_transfer.Darius Davis1-1/+1
dissect_ldss_transfer had a trivial read overrun: "line" was not NUL-terminated, and strtol/g_ascii_strtoull will keep reading and discarding any leading whitespace, so a malformed LDSS packet (with only whitespace characters following the tag on a "Size:"/"Start:"/"Compression:" line) could trigger a read overrun. Let's replace the tvb_memdup with tvb_get_string_enc, which does some checking of the input characters (which, it seems, must always be ASCII), and produces a neat NUL-terminated string. Testing Done: On Linux x64, ran "valgrind tshark -r fuzz-2018-04-23-14422.pcap" without the fix (to reproduce the failure), and then with the fix, and observed that no errors were reported anymore after the fix. 60,000 iters of fuzz-test with ldss_filtered.pcap as input, plus 1,000 iters under valgrind. Launched wireshark and opened ldss_filtered.pcap, and examined the dissection of the "ldss and tcp" packets; All looks good. Bug: 14615 Change-Id: I3fccc4ffbe315a3cff6ea03cc7db37f884b0582c Reviewed-on: https://code.wireshark.org/review/27204 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-03-07dissectors: more SPDX license convertions.Dario Lombardo1-13/+1
Change-Id: I96e1f1cdbaaf49d65705ecacc903f73cf0e47d7c Reviewed-on: https://code.wireshark.org/review/26334 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2017-10-29Add conversation endpoint typeMichael Mann1-3/+3
For the moment this mirrors the port_type enumeration (PT_XXX), but the intent is to move away from using "port types", eliminating most (if not all) Added conversation_pt_to_endpoint_type() so that conversations deal with the correct enumeration. This is for dissector that use pinfo->ptype as input to conversation APIs. Explicit use of port types are converted to using ENDPOINT_XXX type. Change-Id: Ia0bf553a3943b702c921f185407e03ce93ebf0ef Reviewed-on: https://code.wireshark.org/review/24166 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-26ldss: Ensure ldss_file_request_t structure gets allocatedMichael Mann1-23/+3
Bug: 13346 Change-Id: I83175fefeef5035039e378dd68ffdcd0787970b8 Reviewed-on: https://code.wireshark.org/review/19775 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-26/+3
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67, convert dissectors that use "udp.port". More cleanup done on dissectors that use both TCP and UDP dissector tables, so that less preference callbacks exist. Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3 Reviewed-on: https://code.wireshark.org/review/18120 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-22LDSS: fix a memory leak caught by ASanPascal Quantin1-1/+1
Change-Id: I988b0ac0fbadb782c1ba499a086c29522a564618 Reviewed-on: https://code.wireshark.org/review/17869 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-07-25LDSS: check if a conversation already exists before recreating itPascal Quantin1-11/+14
Bug: 12662 Change-Id: I81d91d54544e5865336dc08ffda9fe109fc643ed Reviewed-on: https://code.wireshark.org/review/16660 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-16LDSS: Add an assertion (CID280539,CID280540)João Valverde1-0/+2
Change-Id: I18082a4d45f0c320b8ee0e11139295eb1aee2c89 Reviewed-on: https://code.wireshark.org/review/15968 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-05-01ldss: remove if (tree) checksMartin Kaiser1-151/+138
Change-Id: Ib453a247eb1a2b6e88b3a4abab301bdc7c18bdb0 Reviewed-on: https://code.wireshark.org/review/15209 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-01ldss: return -1 (not 0) if we need more data from TCPMartin Kaiser1-1/+1
If a dissector returns 0, it rejects the packet ("this is not my protocol"). This is in contradiction to requesting more data from TCP. Bug: 12359 Change-Id: Ib0da7fc3ef92b35b3950e74f50484d9e21a93a6f Reviewed-on: https://code.wireshark.org/review/15198 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-22Do not mix wmem and glib allocatorsPascal Quantin1-2/+2
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1 Reviewed-on: https://code.wireshark.org/review/15044 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>
2016-04-04Rename "libz" to "zlib"João Valverde1-1/+1
Change-Id: I12f92c983d587c2a4751428cdf299635090c9f0b Reviewed-on: https://code.wireshark.org/review/14748 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-8/+8
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23Add more fields to packet_info structure and use them.Guy Harris1-3/+3
Add fields for the absolute time stamp (and another field for a presence flag for the absolute time stamp) and the packet encapsulation for the packet. This lets us remove the field for the packet encapsulation in the frame_data structure; do so. Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39 Reviewed-on: https://code.wireshark.org/review/13499 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-2/+2
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-3/+3
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-08-27Remove calls of tvb_ensure_length_remaining.Michael Mann1-3/+1
The remaining calls seem to fall into 3 categories: 1. passing it to tvb_find_line_end when -1 (for length) will do. 2. duplicating the checking of tvb_reported_length_remaining, which is already in use near the tvb_ensure_length_remaining call. 3. Those that (probably) need tvb_ensure_capture_length_remaining Change-Id: I1e77695251e055644bcbbb89f3c181c65d1671ca Reviewed-on: https://code.wireshark.org/review/10268 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-06-24Remove a bunch more deprecated tvb_length callsEvan Huus1-9/+9
(getting really close!) Change-Id: Ibf22a5f727c4dc0070b78144a4b0ab8e0c5e1bce Reviewed-on: https://code.wireshark.org/review/9081 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-23Replace more deprecated tvb_length callsEvan Huus1-2/+2
The return values of new-style dissectors always use the captured length, so replace those automagically with sed. Change-Id: Ic43072ee4a80d433cd4264444583a0e670adc26a Reviewed-on: https://code.wireshark.org/review/9065 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-02-10Do not iterate over reported length when using tvb_find_line_endPascal Quantin1-1/+1
if captured length < reported length, this will trigger an infinite loop Change-Id: I6557b455e7bbff12658a934e5bb13a42c023e133 Reviewed-on: https://code.wireshark.org/review/7053 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-4/+0
Third batch (packet-icmpv6.c -> packet-mac-lte.c). Will look at cleaning up and committing script afterwards. Change-Id: Ib91e36ad200db01c3000605f6a7a21125b96a640 Reviewed-on: https://code.wireshark.org/review/6018 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+1
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-08-14Eliminate proto_tree_add_text from some dissectors.Michael Mann1-6/+13
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-06-29proto_tree_add_subtree[_format]Michael Mann1-5/+2
Change-Id: Id00f456479415adf0a219af6c9a2108d4b3642d0 Reviewed-on: https://code.wireshark.org/review/2702 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-11/+11
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_ensure_length_remaining -> ↵Michael Mann1-1/+1
tvb_ensure_captured_length_remaining" See https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 021e7afc9fcba09094d0e2143cc434a34e3b09dc. Change-Id: I0640eabce5ce8c4ff3a88ebf848b499f8bb8ed2f Reviewed-on: https://code.wireshark.org/review/2429 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remainingDario Lombardo1-1/+1
Change-Id: I0228f3b6b7067bc0ce51f9d359f99fd18feb2b66 Reviewed-on: https://code.wireshark.org/review/2378 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-11/+11
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-28Minor: use VALS macro (as per convention); Add editor modelines; Do ↵Bill Meier1-4/+17
whitespace changes. Change-Id: I6007c1b2098d06e4a892474dd07f06a7538f94ef Reviewed-on: https://code.wireshark.org/review/1843 Reviewed-by: Bill Meier <wmeier@newsguy.com>
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-15Add a MIN() to avoid reading past the end of a buffer in LDSS. Caught byEvan Huus1-1/+1
valgrind fuzzing. svn path=/trunk/; revision=54120
2013-12-10In dissect_ldss_transfer(), reject the packet if data is NULL. Fix some typos.Chris Maynard1-7/+10
svn path=/trunk/; revision=53905
2013-11-02Mark unused arguments.Guy Harris1-1/+1
svn path=/trunk/; revision=53038
2013-11-02Pass struct tcpinfo into all TCP subdissectors instead of through ↵Michael Mann1-23/+17
pinfo->private_data. svn path=/trunk/; revision=53036
2013-09-22emem -> wmem conversion:Pascal Quantin1-2/+2
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-21Add _g_ to the names of functions that allocate glib memory. This is a bit moreEvan Huus1-2/+2
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures that take the appropriate wmem pool. Majority of the conversion done with sed. svn path=/trunk/; revision=52164
2013-09-15More wmem conversion (leaving uat related functions aside)Pascal Quantin1-7/+8
svn path=/trunk/; revision=52055
2013-06-14Removed check_col() and the occasional tree.Michael Mann1-6/+2
svn path=/trunk/; revision=49938
2013-03-18From beroset:Anders Broman1-11/+11
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48400
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-1/+1
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-2/+2
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438