aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wsp.c
AgeCommit message (Collapse)AuthorFilesLines
2022-08-25Rename a bunch of things with "conversation".Guy Harris1-4/+4
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-06-10tap: Adding flags for tap_packetRoland Knall1-1/+1
This allows flags to be passed by the registering listener to the collection of information
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-2/+2
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.
2022-01-04Some (trivial) cppcheck fixes.Martin Mathieson1-4/+4
2021-12-19Replace g_strdup_printf() with ws_strdup_printf()João Valverde1-1/+1
Use macros from inttypes.h.
2021-09-01tvbuff: convert helper methods to pinfo->poolEvan Huus1-2/+2
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-02-08wsp: create and populate the stats table only onceMartin Kaiser1-33/+55
Use the new stat_tap_find_table function during init to check if our statistics table already exists. If so, we can safely assume that its rows have already beend initialized. All we have to do is clear the data that was collected by the tap.
2021-02-07wsp: (trivial) use consistent indentationMartin Kaiser1-104/+104
Use the indentation as defined in the editor modelines (expand TAB to 4 spaces) throughout the file.
2021-01-27More checking of non-static symbols.Martin Mathieson1-1/+1
2020-10-15WSP: add application/octet-stream content typePascal Quantin1-0/+1
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-3/+3
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-07Replace instances of wmem_alloc with wmem_newMoshe Kaplan1-1/+1
This commit replaces instances of (myobj *)wmem_alloc(wmem_file_scope(), sizeof(myobj)) and replaces them with: wmem_new(wmem_file_scope(), myobj) to improve the readability of Wireshark's code. The replacement locations were identified with grep and replaced with the Python script below. grep command: egrep "wmem_alloc0?\(wmem_file_scope\(\), sizeof\([a-z_]+\)\)" . -R -l python script: import re import sys import fileinput pattern = r'\(([^\s]+) ?\*\) ?wmem_alloc(0?)\((wmem_[a-z]+_scope\(\)), sizeof\(\1\)\)' replacewith = r'wmem_new\2(\3, \1)' fname = sys.argv[1] for line in fileinput.input(fname, inplace=1, mode='rb'): output = re.sub(pattern, replacewith, line) sys.stdout.write(output) Change-Id: Ieac246c104bf01e32cbc6e11e53e81c7f639d870 Reviewed-on: https://code.wireshark.org/review/37158 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-03-06wsp: Remove lwm2m.dm length checkStig Bjørlykke1-3/+2
Remove length check when detected x-wap lwm2m.dm because the CoAP message is not always 15 bytes. Change-Id: Ib1e58a997a906a6723abae6f86fe4306bd5061c6 Reviewed-on: https://code.wireshark.org/review/36310 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
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>
2019-01-01Add a "failed" return for tap packet routines.Guy Harris1-2/+2
This allows taps that can fail to report an error and fail; a failed tap's packet routine won't be called again, so they don't have to keep track of whether they've failed themselves. We make the return value from the packet routine an enum. Don't have a separate type for the per-packet routine for "follow" taps; they're expected to act like tap packet routines, so just use the type for tap packet routines. One tap packet routine returned -1; that's not a valid return value, and wasn't one before this change (the return value was a boolean), so presume the intent was "don't redraw". Another tap routine's early return, without doing any work, returned TRUE; this is presumably an error (no work done, no need to redraw), so presumably it should be "don't redraw". Clean up some white space while we're at it. Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8 Reviewed-on: https://code.wireshark.org/review/31283 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-27wsp: remove a bunch of if (tree) checksMartin Kaiser1-117/+76
and the comments saying that those checks are a good idea Change-Id: Ie2d6ee769abb76fd83df97cebdd896686dee5db9 Reviewed-on: https://code.wireshark.org/review/30395 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-09Fix handling of text headers with non-text values.Guy Harris1-1/+14
Determine the length of non-text values in the standard fashion for WSP, and treat the value as having that length, rather than running to the end of the packet. Change-Id: If3501cf726df4d8338e86515906f67790a773b02 Reviewed-on: https://code.wireshark.org/review/28167 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-13Get rid of some GTK+-only stuff.Guy Harris1-3/+3
Change-Id: I85806476246a567f747e3911e3d15716e9cfe06b Reviewed-on: https://code.wireshark.org/review/27514 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-28packet-wsp: Adding x-wap-application:lwm2m.dm supportIvan Severin1-2/+18
Added x-wap-application:lwm2m.dm support according Open Mobile Alliance docs. See docs: (page 141), http://www.openmobilealliance.org/release/LightweightM2M/V1_0_2-20180209-A/OMA-TS-LightweightM2M-V1_0_2-20180209-A.pdf Change-Id: I0026ae3f7e03b28242a3a7cb3091ba32c91c4edb Reviewed-on: https://code.wireshark.org/review/26565 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-03-21packet-wsp: fixed incorrect invalid header handlingIvan Secerin1-2/+2
In function 'add_header' coгple of if-statements didn't corespond to comments above. Change-Id: Idd846cebf7e17d0e2f49c7c7d3de466b899c73c6 Reviewed-on: https://code.wireshark.org/review/26573 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-03-09WSP: check tvb_get_guintvar() successPascal Quantin1-1/+3
4630b4fcf8 sets octetCount to 0 in case of error. Let's check this return value to avoid an infinite loop Bug: 14519 Change-Id: Ie3519067d609afb1bbf9e67f7f15f95911d2b173 Reviewed-on: https://code.wireshark.org/review/26388 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-19Get rid of more new_ prefixes for statistics functions and types.Guy Harris1-18/+18
There are no "old" versions of them that we're keeping around. Change-Id: I3c76a14d0ec1a06df39c547da37f4dea9987df4d Reviewed-on: https://code.wireshark.org/review/25892 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-10-29Add conversation endpoint typeMichael Mann1-4/+4
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-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-1/+1
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-02WSP: allocate content type string in wmem poolPascal Quantin1-2/+2
Let's use the pinfo pool as the string can be added to pinfo structure. Bug: 14032 Change-Id: I195b6e216c89e22c8011886826adbbbd1cd32b11 Reviewed-on: https://code.wireshark.org/review/23358 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-11packet-wsp.c: Fix WSP dissector loop (add_capabilities)Michael Mann1-1/+3
Bug: 13581 Change-Id: I8b9f2df47fabb25d8851debc616fee1091d49f31 Reviewed-on: https://code.wireshark.org/review/21018 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-10WSP: fix addition of x-up-proxy-tod in treePascal Quantin1-4/+6
Regression introduced in gcf7979c Bug: 13579 Change-Id: Ia2c0d95eec45937ffcdbee52022466a30ebab1f8 Reviewed-on: https://code.wireshark.org/review/20988 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>
2017-04-02WSP: fix addition of X-Wap-Tod header in treePascal Quantin1-6/+7
Bug: 13546 Change-Id: Ie1e78cc7ada338b17a21a32714fed4816724a4f8 Reviewed-on: https://code.wireshark.org/review/20850 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-25wsp: Sanity check capability lengthMichael Mann1-1/+9
Bug: 13348 Change-Id: I64abc79475087f1c971419629b5c86e646123f3f Reviewed-on: https://code.wireshark.org/review/19776 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>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-10/+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-07-26WAP: check that tvb_get_guintvar does not overflowPascal Quantin1-27/+29
Bug: 12661 Change-Id: I2ef857d6be6595fd89f3dbb8d41c1c70d550ad93 Reviewed-on: https://code.wireshark.org/review/16665 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-09packet-wsp.c: Fix infinite loop in add_headersMichael Mann1-0/+15
Bug: 12594 Change-Id: Id86d1e5f2db12871bc1b345721e79e57192f01e1 Reviewed-on: https://code.wireshark.org/review/16355 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-06-16qt: move free_stat_tables from SimpleStatisticsDialog::fillTree to ↵Dario Lombardo1-1/+2
~SimpleStatisticsDialog. Add a reference count to stat_tap_table_ui to prevent bad deallocations. Bug: 12437 Change-Id: Ib9b1f929d08a574c306dc755ec416ab94a3fd6d3 Reviewed-on: https://code.wireshark.org/review/15920 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-26Remove some proto_item_append_stringMichael Mann1-26/+31
These calls to proto_item_append_string were not taking into account all of the special treatment needed to use it, so proto_item_append_text (or similar) was probably intended. Change-Id: I5d1f092f8162a87d30fc8dc694f6124dc81372b5 Reviewed-on: https://code.wireshark.org/review/15575 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-08Remove the MIBenum stuff from the WAP code.Guy Harris1-3/+4
MIBenum values are from an IANA registry, not a WAP specification; add <epan/iana_charsets.h> to declare the MIBenum -> Wireshark encoding mapper routine and the value_string_ext for MIBenum values, and epan/iana_charsets.c to define them. Change-Id: I6d9c82cd011bd5211c688322e6423de38e161f41 Reviewed-on: https://code.wireshark.org/review/15298 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08Show MIBenum values for character sets as decimal.Guy Harris1-1/+1
http://www.iana.org/assignments/character-sets/character-sets.xhtml is the official IANA registry for character sets, including MIBenum values, and it shows MIBenum values in decimal, not hex, so show them in decimal, not hex. Change-Id: Id00a0d351a1f758401232aba621cc60aeccf360a Reviewed-on: https://code.wireshark.org/review/15292 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-3/+3
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-4/+4
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>
2015-12-29Rename new_stat_tap_ui to stat_tap_table_ui.Guy Harris1-3/+3
A "new" statistics tap UI is a statistics tap UI where the statistics are maintained as tables and common code handles the tables; what matters is the tables, not that it's "new". Change-Id: I7a0e63cfac98c24cd5e7dce973b9a0cc5b6a03ba Reviewed-on: https://code.wireshark.org/review/12897 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-29There's no "old" stat_tap_table, so remove "new_" from the name.Guy Harris1-7/+7
Change-Id: I1a0349d5d9d47210a97ff7a99fb358e59fd70e72 Reviewed-on: https://code.wireshark.org/review/12896 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-2/+2
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> 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-11-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-7/+9
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-11-14register_dissector -> new_register_dissectorMichael Mann1-6/+8
Picking off "easy" dissectors that only have one or two exit points at most. This concludes a "first pass" over the dissector directory. Change-Id: If5ce5484214be50fe541cba478da1de62e354297 Reviewed-on: https://code.wireshark.org/review/11830 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-0/+2
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-14Change proto_tree_add_ipv6() to take a struct e_in6_addr pointerJoão Valverde1-1/+1
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too. Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88 Reviewed-on: https://code.wireshark.org/review/10953 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: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-09WSP: Fix add_addresses()João Valverde1-2/+2
Change-Id: I25d84c725559f5f077dcc03fb425a89d87e90f55 Reviewed-on: https://code.wireshark.org/review/10897 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-01Convert the WSP stats to generic stat API.Gerald Combs1-0/+156
Add support for multiple tables to SimpleStatisticsDialog. Change-Id: I843d901db092d2f2856d3d1a16f29f85fb41374b Reviewed-on: https://code.wireshark.org/review/10339 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>