aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pktc.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-27PKTC: Fix timestamp encoding errorsJoão Valverde1-4/+9
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-4/+4
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2021-12-03epan: Remove STR_ASCII and STR_UNICODEJoão Valverde1-1/+1
These display bases work to replace unprintable characters so the name is a misnomer. In addition they are the same option and this display behaviour is not something that is configurable. This does not affect encodings because all our internal text strings need to be valid UTF-8 and the source encoding is specified using ENC_*. Remove the assertion for valid UTF-8 in proto.c because tvb_get_*_string() must return a valid UTF-8 string, always, and we don't need to assert that, it is expensive.
2021-07-21First pass pinfo->pool conversionEvan Huus1-2/+2
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-1/+1
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>
2018-09-22Remove some unneeded headers.Gerald Combs1-1/+0
Move the contents of packet-clearcase.h, packet-fcp.h, packet-klm.h, packet-rquota.h, packet-rwall.h, and packet-spray.h to their respective .c files. packet-pktc.h didn't contain anything so just remove it. Change-Id: I019db0cb14bf527c5d73c6d18bee922dd822bc43 Reviewed-on: https://code.wireshark.org/review/29787 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-17Use proto_tree_add_item instead of proto_tree_add_xxx.Michael Mann1-2/+2
It's a little more efficient to use proto_tree_add_item, than proto_tree_add_xxx, passing it the returned tvb_get_xxx value. Change-Id: I22ddd7ab36e1ee5aae78fc693d7dbac4b4f802f2 Reviewed-on: https://code.wireshark.org/review/21691 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-2/+2
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-05-09Give the time_[m]secs_to routines names that begin with "[un]signed_".Guy Harris1-1/+1
Indicate whether they take a signed time delta or an unsigned time delta. Export unsigned_time_secs_to_str() while we're at it. Change-Id: I0fbe87f1825efa886364caa61a3358b79d285947 Reviewed-on: https://code.wireshark.org/review/15324 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-31replace dangerous tvb_get_ptr with safer string function.Jaap Keuter1-2/+2
Using tvb_get_ptr to get a string is always dangerous in the face of malformed packets. Instead using string functions allow for safe handling of these. Bug: 12242 Change-Id: I059c186032492aae9c90a69858ea3fc59e21313f Reviewed-on: https://code.wireshark.org/review/14714 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-21Bugfix "typo" from I9b04837f93Michael Mann1-2/+2
Change-Id: Iafc67ced1af0fbb27545acb0e1569b8b8ccd9451 Reviewed-on: https://code.wireshark.org/review/14544 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-20URL for the document in question.Guy Harris1-0/+1
Change-Id: Id92c484099bdcd71c0ff194abeefda4bab8dcd6e Reviewed-on: https://code.wireshark.org/review/14543 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-20PKTC must be stricter with its Kerberos application choices.Michael Mann1-2/+19
The PKTC dissector calls the Kerberos dissector assuming certain application values. Because different application values can have different "private" data, corruption can occur. Ensure the Kerberos application values match the preceding comments by checking the ber identifier before calling the Kerberos dissector. Bug: 12206 Change-Id: I9b04837f93a56681cae3816278315cf01da17544 Reviewed-on: https://code.wireshark.org/review/14520 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-05pktc: don't THROW() an exception from a dissectorMartin Kaiser1-6/+0
in the switch-case statements, we already show an expert info it should be sufficient to exit and report to the caller how many bytes we dissected as for the string, we can just calculate the length and let proto_tree_add_item() throw an exception if that length is invalid Change-Id: I310a4011cb112f3ed70e804c5b44d58f275fab6b Reviewed-on: https://code.wireshark.org/review/13745 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
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-11-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-6/+8
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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-10-08Replace or rename "duplicate" UDP protocols shown in Decode AsMichael Mann1-5/+8
Change-Id: I8cfd1c223c70c7e03728af8b2f7cbf9354d7ad86 Ping-Bug: 3949 Reviewed-on: https://code.wireshark.org/review/10865 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-20replace some deprecated tvb_length callsEvan Huus1-1/+1
Change-Id: I18152e75aec2eedccad4d393c1b4b493cd7b406d Reviewed-on: https://code.wireshark.org/review/8125 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-13Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-2/+2
(for some dissectors which fetch all other integral fields using ENC_BIG_ENDIAN). Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56 Reviewed-on: https://code.wireshark.org/review/5748 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-05Add editor modelines; Adjust whitespace as needed.Bill Meier1-99/+112
Change-Id: I6e70c933ae61a97377235d67b2f6a1b3d67dc155 Reviewed-on: https://code.wireshark.org/review/4484 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16Fix spelling: cant-->can't, wont-->won't, etcBill Meier1-6/+6
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6 Reviewed-on: https://code.wireshark.org/review/4124 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-06Eliminate proto_tree_add_text from some of the dissectors.Michael Mann1-18/+32
Other minor cleanups while in the area. Change-Id: I8ea59205cfe6fab643d8fe01b75ce91532004fd9 Reviewed-on: https://code.wireshark.org/review/4004 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-09Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.Michael Mann1-2/+2
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions. Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree. Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141 Reviewed-on: https://code.wireshark.org/review/3500 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05convert to proto_tree_add_subtree[_format]Michael Mann1-27/+18
Change-Id: I8df48b25de784a48a25f0e48aac1e1545ed92c35 Reviewed-on: https://code.wireshark.org/review/2865 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-1/+1
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-1/+1
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-1/+1
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
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-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-1/+1
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-12- Forward declaration of register functions.Anders Broman1-0/+5
svn path=/trunk/; revision=53971
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-09-30Convert some proto_tree_add_string_format calls to something more appropriate.Michael Mann1-3/+2
There seem to be several cases of proto_tree_add_string_format where a "string" value/filter doesn't really make sense because it's always empty, and is just being used as a "filterable subtree header (placeholder)". They appear to be more for "presense" than "value" and should probably be FT_NONE, although I'd almost argue for removing the filter in favor of proto_tree_add_text. svn path=/trunk/; revision=52296
2013-09-29Convert proto_tree_add_time_format to either proto_tree_add_time or ↵Michael Mann1-4/+6
proto_tree_add_time_format_value. Only proto_tree_add_time_format calls remaining are in packet-ncp2222.inc, which may just need some additional filters. svn path=/trunk/; revision=52269
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-9/+3
svn path=/trunk/; revision=49921
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-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-2/+2
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-4/+4
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
2011-10-10 Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-4/+4
non-autogenerated epan/dissectors: Specifically: Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as the encoding parameter for proto_tree_add_item() calls which directly reference an item in hf[] which has a type of: FT_BOOLEAN FT_IPv4 FT_EUI64 FT_GUID FT_UINT_STRING Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260) svn path=/trunk/; revision=39328
2011-10-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-10/+10
non-autogenerated epan/dissectors: Specifically: Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as the encoding parameter for proto_tree_add_item() calls which directly reference an item in hf[] which has a type of: FT_UINT8 FT_UINT16 FT_UINT24 FT_UINT32 FT_UINT64 FT_INT8 FT_INT16 FT_INT24 FT_INT32 FT_INT64 FT_FLOAT FT_DOUBLE svn path=/trunk/; revision=39288
2011-10-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵Bill Meier1-8/+8
reference an hf item (in hf[] with types: FT_NONE FT_BYTES FT_IPV6 FT_IPXNET FT_OID Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN svn path=/trunk/; revision=39260
2011-01-16There's no need to pass the result of tvb_get_ptr() as the 'value' inJeff Morriss1-1/+1
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or tvb_get_const_stringz(). Use tvb_memeql() & tvb_memcmp(). svn path=/trunk/; revision=35558
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-3/+3
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-05-21Have abs_time_to_str() and abs_time_to_str_secs() take an additionalGuy Harris1-1/+1
argument indicating whether to include the time zone in the string. If we're constructing a display filter, don't include the time zone, otherwise do. Fixes bug 4756. svn path=/trunk/; revision=32913
2010-02-27Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with theGuy Harris1-1/+1
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
2009-12-19For fields of type FT_ABSOLUTE_TIME, have the "display" value be one ofGuy Harris1-1/+1
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL == (int)BASE_NONE, so there's no source or binary compatiblity issue, although we might want to eliminate BASE_NONE at some point and have the BASE_ values used with integral types start at 0, so that you can't specify BASE_NONE for an integral field. svn path=/trunk/; revision=31319
2009-12-10Add an argument to abs_time_to_str() and abs_time_secs_to_str()Guy Harris1-1/+1
indicating whether the time should be shown as local time or UTC. For now, always pass FALSE, meaning "show as local time". Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str() for times with one-second resolution, and update a comment in various macros in the WSP dissector, while we're at it. svn path=/trunk/; revision=31227