aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ositp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-22Convert proto_tree_add_boolean to ↵Michael Mann1-22/+14
proto_tree_add_bitmask_[value|value_with_flags|list] Part 2 of a few Change-Id: Ic1f1aafe2ed02dce95b15c03a91cbd68807a5cf4 Reviewed-on: https://code.wireshark.org/review/8165 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-03Replace tvb_get_ptr calls with a better API choice.Michael Mann1-12/+6
Just reduces the overall tvb_get_ptr usage count in the dissector directory. Change-Id: I455dc4cc9b082ecccdd254a2e5121f3353b5a812 Reviewed-on: https://code.wireshark.org/review/7491 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-05OSITP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-4/+0
Change-Id: Ied8e931541e8e570ef32376eec61779a32bbd493 Reviewed-on: https://code.wireshark.org/review/6322 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-02ositp: fix some BASE_ errors from g7935ba9f5beEvan Huus1-3/+3
Change-Id: I71639f95f8efff9619e00dae45763ff863f0ca21 Reviewed-on: https://code.wireshark.org/review/6237 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-02Eliminate proto_tree_add_text from packet-ositp.cMichael Mann1-178/+178
Change-Id: If97f1b17bf8dbd6bac708b7dfbef6df73fad0f30 Reviewed-on: https://code.wireshark.org/review/6218 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: Evan Huus <eapache@gmail.com>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-3/+0
Fourth batch (packet-mac-lte.c -> packet-rtp.c). Will look at cleaning up and committing script afterwards. Change-Id: Id921f07f4b274f0cfb77ce81abe4a285fdb8b644 Reviewed-on: https://code.wireshark.org/review/6023 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-6/+4
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-3/+3
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-10-20Get rid of unnecessary includes of ctype.h.Guy Harris1-2/+0
Change-Id: I2cf49f808558147ce77e7d086558966cfb2defca Reviewed-on: https://code.wireshark.org/review/4850 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-17Remove unnecessary includesMichael Mann1-2/+0
Change-Id: Ib1a90a07b2d467a81927c53917e05a1af6ba4ee6 Reviewed-on: https://code.wireshark.org/review/3666 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-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-6/+6
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-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-6/+6
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-17/+20
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-03-05Fix some code remove by 296591399f90a9d89be958d91047aa724a77ee6dAlexis La Goutte1-0/+1
(Copyright or info about file...) Change-Id: I90ba8b1c3ec8406b0c3365a69a8555837fc4bbb1 Reviewed-on: https://code.wireshark.org/review/515 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.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-21isascii(x) && isprint(x) -> g_ascii_isprint(x)Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54328
2013-12-15Fix some const/ not const warnings.Jakub Zawadzki1-4/+4
svn path=/trunk/; revision=54114
2013-12-14Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+4
svn path=/trunk/; revision=54095
2013-12-13Do one or more of the following:Bill Meier1-40/+40
- Convert "4 space tabs" to spaces; - Remove some unneeded initializers; - 'offset++' --> 'offset += 1' for consistency; - Reformat hf[] entries; - Rework/add whitespace; - Adjust editor modelines (set tab-width to 8). svn path=/trunk/; revision=54005
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-2/+2
(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-10-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-0/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-09-15A few more dissectors converted to wmemPascal Quantin1-3/+3
svn path=/trunk/; revision=52071
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-4/+4
svn path=/trunk/; revision=51852
2013-09-07Batch of filterable expert infoMichael Mann1-20/+22
svn path=/trunk/; revision=51823
2013-08-20Fix several instances of clang warnings: Value stored to 'length' is never readChris Maynard1-513/+581
Also, whitespace changes (tabs ->spaces, indentation) and add modelines. svn path=/trunk/; revision=51439
2013-07-17Remove fragment_data, add fragment_head, fragment_item - for now alias it to ↵Jakub Zawadzki1-1/+1
the same structure. This is begin of work to split fragment head and fragments items. svn path=/trunk/; revision=50708
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-32/+18
svn path=/trunk/; revision=49921
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-2/+2
svn path=/trunk/; revision=49259
2013-03-22Don't wire into the reassembly code the notion that reassemblies shouldGuy Harris1-8/+14
be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491
2013-03-19From beroset:Anders Broman1-7/+7
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48412
2013-02-19calc_checksum() should be passed the length of the block to beGuy Harris1-11/+42
checksummed, which is the length of the TPDU, not that length + 1. Calculate the TPDU length correctly - use tvb_reported_length_remaining(), not tvb_length_remaining() (we want the *actual* length, not the amount of captured data we have), and take the offset handed to the dissector routine into account. Don't take the length indicator into account for TPDUs with user data, as they run to the end of the lower-level packet containing the TPDU(s). The CLTP UD TPDU contains user data. Note that this dissects both COTP *and* CLTP (that's why it's "packet-ositp.c", not "packet-cotp.c"). Separate some groups of #includes with blank lines. svn path=/trunk/; revision=47745
2013-02-19Whitespace tweaks.Guy Harris1-5/+6
svn path=/trunk/; revision=47743
2013-02-19Bugfix OSITP - Incorrect TP4 checksum calculation (ATN extended checksum) in ↵Michael Mann1-24/+31
case of multiple TPDU's per frame. Bug 8293 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8293) svn path=/trunk/; revision=47741
2012-11-29Make an enum_val_t static.Jeff Morriss1-1/+1
svn path=/trunk/; revision=46293
2012-11-18More TODOs:Guy Harris1-0/+8
We hand the user data in a CR or CC packet to the subdissectors, but don't tell the subdissectors that - do we need to? We don't hand the data in an ED packet to the subdissectors - should we, and do we need to tell them that it's an ED packet? svn path=/trunk/; revision=46067
2012-11-17Squelch another warning.Guy Harris1-1/+1
svn path=/trunk/; revision=46062
2012-11-17Squelch a warning (not enough data flow analysis is done to know thatGuy Harris1-1/+1
cotp_tree actually never will be used uninitialized). svn path=/trunk/; revision=46061
2012-11-17Handle the pseudo-trailer for the ATN extended checksums by passing inGuy Harris1-81/+79
the source and destination address lengths and data, and adding them in, rather than by copying those fields to a fixed-size static buffer - that gets rid of a global variable (global variables considered harmful), and also means that we don't try to copy 24 bytes of length+address from packets that don't *have* 24 bytes of length+address (which caused exceptions to be thrown on some OSI captures I have). Construct some LI #defines out of other LI #defines, to make it a bit clearer why they have the values they do. Support the "additional information related to the clearing of the connection" variable part parameter of the COTP DR packet (which just means giving it a name, as its contents are user-defined - some HP-UX OSI stack appears to just stick in a string saying that it's said stack). Make the code that decodes the variable part of a DR packet look like the code that decodes the variable part of most other packets. For COTP CR packets, determine the class up front by checking whether the length is > 2. (At some point we might want to associate a class indication with the COTP connection, if we see the connection setup, and, if we have that indication, use it in preference to the heuristics.) Make the code to handle various length indicator values in the ATN case more like the code in the non-ATN case. Dissect the variable part of COTP ER packets. Fix tpyos (TDPU->TPDU, tdpu->tpdu) and typpoes (accross->across). Clean up white space. svn path=/trunk/; revision=46060
2012-11-17Default to *not* decoding the ATN flavor of COTP, so that, for example,Guy Harris1-1/+1
we don't, by default, break the dissection of RDP (or anything else that happens to run atop class 0 or 1). svn path=/trunk/; revision=46056
2012-11-17Get rid of extra blank lines and trailing white space.Guy Harris1-11/+6
svn path=/trunk/; revision=46054
2012-11-17Clean up white space.Guy Harris1-556/+562
Add a comment noting that the value of the length indicator in a DT TPDU is not as constrained as one might think. svn path=/trunk/; revision=46053
2012-11-17Get rid of /* FALLTHROUGH */ comments that don't refer to fallingGuy Harris1-19/+31
through a clause in a switch statement to the following clause (that's what /* FALLTHROUGH */ is for - it was originally a comment to tell lint not to complain about the lack of a break statement). Use guint8 rather than guchar for an 8-bit binary value. Add a comment noting the weird stuff Microsoft does with RDP atop ISO COTP atop TPKT. svn path=/trunk/; revision=46052
2012-11-17Fix checksum handling (using val_to_str() on a Boolean is overkill, andGuy Harris1-36/+57
calc_checksum() doesn't return a Boolean, it returns a cksum_status_t, which has more values than just "checksum OK" and "checksum not OK", such as "not enough data available to check the checksum). Fix typoes (Transport Protocol Data Unit is TPDU/tpdu, not TDPU/tdpu). svn path=/trunk/; revision=46051
2012-11-16Missed a ","Anders Broman1-1/+1
svn path=/trunk/; revision=46045
2012-11-16Fix:Anders Broman1-0/+1
Error: packet-ositp.c : {..., NULL} is required as the last XXX_string array entry: value_string tp_vpart_checksum_vals[] svn path=/trunk/; revision=46044
2012-11-16From guettler:Anders Broman1-168/+620
ATN decoding fixes for CLNP and COTP dissectors (configurable by option). ATN decoding fixes for CLNP and COTP dissectors (configurable by option). ATN specifics may be selected/deseleted per CLNP/COTP dissector configuration (as requested). CLNP dissector 1) configurable decoding of "ATN security label" COTP dissector 1) configurable decoding of ATN TPDU's 2) checksum calculation (none,OSI,ATN 16-bit, ATN 32-bit) 3) VP decoding for DR TPDU's https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5622 svn path=/trunk/; revision=46043
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-09-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-4/+4
svn path=/trunk/; revision=44871
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-2/+2
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-09-07From Robert Bullen via ↵Jeff Morriss1-0/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 : The reassembled fragments tree in the Packet Details view is awesome, but it lacks one thing: a field that exposes the reassembled data. tcp.data already exists for exposing a single TCP segment's payload as a byte array. It would be handy to have something similar for a single application layer PDU when TCP segment reassembly is involved. I propose tcp.reassembled.data, named and placed after the already existing field tcp.reassembled.length. My primary use case for this feature is outputting tcp.reassembled.data with tshark for further processing with a script. The attached patch implements this very feature. Because the reassembled fragment tree code is general purpose, i.e. not specific to just TCP, any dissector that relies upon it can add a similar field very cheaply. In that vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which expose reassembled fragment data as a single byte stream for IPv4 and IPv6, respectively. All other protocols that use the reassembly code have been left alone, other than inserting NULL into their initializer lists for the newly introduced struct field reassemble.h:fragment_items.hf_reassembled_data. svn path=/trunk/; revision=44802