aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-alljoyn.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-22alljoyn: fix signature length adjustmentsPeter Wu1-13/+18
Ensure that the signature pointer and length always matches, otherwise a buffer overrun (read) is possible. Tested with the original captures from bug 12953, the PDML output is still the same while the fuzzed capture does not crash anymore. Bug: 12953 Change-Id: I8843a5daf98a79fb19906e824326cdf619164484 Reviewed-on: https://code.wireshark.org/review/18347 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-13/+9
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-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-12/+7
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-19Improve support for single-character fields and filter expressions.Guy Harris1-2/+2
Add an FT_CHAR type, which is like FT_UINT8 except that the value is displayed as a C-style character constant. Allow use of C-style character constants in filter expressions; they can be used in comparisons with all integral types, and in "contains" operators. Use that type for some fields that appear (based on the way they're displayed, or on the use of C-style character constants in their value_string tables) to be 1-byte characters rather than 8-bit numbers. Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135 Reviewed-on: https://code.wireshark.org/review/17787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-27tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_stringMichael Mann1-56/+53
Also some other tricks to remove unnecessary tvb_get_string_enc calls. Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914 Reviewed-on: https://code.wireshark.org/review/16158 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>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-11/+11
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 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: Michael Mann <mmann78@netscape.net>
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-19AllJoyn: prevent an infinite loopPascal Quantin1-0/+19
Display an expert error when the argument is empty Bug: 11607 Change-Id: I8682eab8fe1822f784e848220ff90de4eb5e13ff Reviewed-on: https://code.wireshark.org/review/11132 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: Michael Mann <mmann78@netscape.net>
2015-03-06alljoyn: more robust signature handlingEvan Huus1-1/+3
There were two bugs in the handling of all-joyn struct signatures: - we were advancing the pointer without decrementing the length remaining - we were not checking for the string's null-terminator (which is only necessary if the string is malformed, but that's entirely possible) Bug: 11028 Change-Id: I38b98cf3f43681f709846e3cb9068d20c4fdce82 Reviewed-on: https://code.wireshark.org/review/7552 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-2/+1
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid the following warning: warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic] We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be more consistent with the other macros in proto.h. Update each instance of BASE_CUSTOM to use CF_FUNC. Adjust a dummy variable name generated by asn2wrs.py that was triggering an invalid error in checkhf.pl. Fix an encoding arguement in packet-elasticsearch.c found by fix-encoding-args.pl. Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22 Reviewed-on: https://code.wireshark.org/review/7150 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-07Improved handling of ARDP fragmented packets.Joseph Huffman1-19/+66
With the AllJoyn Reliable Datagram Protocol large packets are fragmented in a way that Wireshark doesn't desegment. The AllJoyn dissector now detects this situation and reports things to the user in a manner which indicates things are behaving normally rather than an error condition. Change-Id: I1f2aa722b6e0d1ed3572ff332b4dd8c0e5c5a765 Signed-off-by: Joseph Huffman <jhuffman@codeaurora.org> Reviewed-on: https://code.wireshark.org/review/6344 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-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+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-02alljoyn: Rename some filters; Fix some filter types.Bill Meier1-25/+25
Details: - Rename various "alljoyn.header..." display filter names releated to the alljoyn "message header" to "alljoyn.mess_header..." to distinguish the fields from actual alljoyn "header" fields. This also fixes the duplicate use of the display filter name "alljoyn.header". - Don't use FT_PROTOCOL for a field type. Change-Id: Id4e78f36716cf6064638aecd5faf561bcbc88b46 Reviewed-on: https://code.wireshark.org/review/5561 Petri-Dish: Bill Meier <wmeier@newsguy.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Joe Huffman <jhuffman@codeaurora.org> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-28AllJoyn: fix warning: no previous prototype for 'add_padding_item' ↵Alexis La Goutte1-1/+1
[-Wmissing-prototypes] Change-Id: Id18ac125390efa22638845083f7d0d5eaf71cb97 Reviewed-on: https://code.wireshark.org/review/4955 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-26Added support for AllJoyn Reliable Datagram Protocol.Joseph Huffman1-40/+488
Change-Id: I3ec37d7aec0c51f9bd0791c8fa0c5ef3dabc9fbf Signed-off-by: Joseph Huffman <jhuffman@qce.qualcomm.com> Reviewed-on: https://code.wireshark.org/review/4414 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: Michael Mann <mmann78@netscape.net>
2014-10-13Fixed missing padding. Fixed ENC_NA/ENC_BIG_ENDIAN errors.Joseph Huffman1-6/+74
There was no tree items for padding in the many instances where there were bytes added to make certain data types align on even boundaries of 2, 4, or 8 bytes. These instances now show up as "Padding" in the display. There were many instances where ENC_NA was used for fields of more than one byte. This wasn't noticed before because ENC_NA was ENC_BIG_ENDIAN for historical reasons and all these fields are big endian fields. Change-Id: Iabadd46eacc9ceb8ca85f4a5ba42b6583375c5f0 Signed-off-by: Joseph Huffman <jhuffman@codeaurora.org> Reviewed-on: https://code.wireshark.org/review/4413 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-19Do encoding-arg changes (all benign)Bill Meier1-5/+5
For: - FT_BYTES: Always use just ENC_NA - integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN Also: - FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...) - Change one case of incorrect '||' to '|' Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0 Reviewed-on: https://code.wireshark.org/review/4184 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-18AJTOOLS-4 Data field not being parsed properly by WireShark plugin if two or ↵Joseph Huffman1-117/+265
more AllJoyn Messages are combined in single TCP packet. Fixed bugs where multiple messages are combined in a single packet. Fixed bugs where a single message is distributed across multiple packets. Fixed bug where arrays of zero length were not dissected properly. Change-Id: Icfb83e73519d8217d6c477edf531ba6d3f3dcd48 Reviewed-on: https://code.wireshark.org/review/4159 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-21Define a function as 'static' (Fixes [-Wmissing-prototypes] warning).Bill Meier1-1/+2
Change-Id: Ia0a5c05c953053691837c5795c8204e2144d8067 Reviewed-on: https://code.wireshark.org/review/1241 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-21Fix some bugs; Do more cleanup;Bill Meier1-389/+585
Bugs fixed: - DISSECTOR_BUG (reported by proto.c) when displaying "Parameters" (Apparently introduced in I8de7a19 (gc538b44)) - Incorrect byte pane highlighting for ARG_ARRAY container type (In dissector code as originally committed) - "uint32uint32" should be "uint32" in packet details. (In dissector code as originally committed) Cleanup: - Remove unneeded #includes; - Simplify some code; - Remove unneeded initializers; - Fix: "warning: no previous prototype...[-Wmissing-prototypes]" - Reformat hf[] array entries; - Fix some spelling; - Do indentation, whitespace & formatting style changes. Change-Id: If1f488f10ba83b27f75a1f71cf4bce7d5279e87c Reviewed-on: https://code.wireshark.org/review/1238 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-15remove unused variable 'tree'Martin Kaiser1-1/+1
Change-Id: Icd39b32aa61fd9fc39c7a15d22134350582b9de6 Reviewed-on: https://code.wireshark.org/review/1160 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-04-15Cleanup Alljoyn dissector.Michael Mann1-795/+404
Change-Id: I8de7a196ad068506f8e7312021879d20be4063d2 Reviewed-on: https://code.wireshark.org/review/1156 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Joe Huffman <jhuffman@codeaurora.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-15Fix check*.pl errorsMichael Mann1-11/+8
Change-Id: Id0526cd9b6b724a8f125574507f9ce6302db540d Reviewed-on: https://code.wireshark.org/review/1129 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-14Addition of AllJoyn packet dissector. Bug 9361Joseph Huffman1-0/+2536
Change-Id: Ia582732ee27ce9c1e4280afef5a6b3e3be959d23 Reviewed-on: https://code.wireshark.org/review/1127 Reviewed-by: Michael Mann <mmann78@netscape.net>