aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-isns.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-20Remove init of proto variablesStig Bjørlykke1-115/+115
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-09-22Make tfs_true_false the default for booleansJoão Valverde1-18/+8
Instead of adding a TFS(&tfs_true_false) to every boolean field, make it the default if "strings" is NULL. This seems to match the already existing documentation: If the Boolean field is to be displayed as "False" or "True", the 'strings' field would be set to NULL.
2023-06-14Use `register_dissector()` for more protocolsDavid Perry1-3/+4
Changes several calls of `create_dissector_handle()` to instead call `register_dissector()` with a name for the dissector. This should handle all dissectors in `epan/` from `packet-g*` to `packet-i*`. This change allows affected dissectors to be findable by calls to `find_dissector()`. In turn, this opens up more command-line use for these protocols, including fuzzshark and rawshark, as well as lua use via `Dissector.get()`. Where needed, move the call from the protocol handoff function to the protocol register function, save the result in a static variable, and use that variable in the handoff function. There were some calls to `create_dissector_handle()` or `register_dissector()` which passed `-1` as the protocol argument. When I saw those I corrected them to pass the actual `proto_foo` identifier instead. Partially addresses #5612
2023-02-12Try to check that all items in bitmask set have same widthMartin Mathieson1-19/+19
2022-08-25Rename a bunch of things with "conversation".Guy Harris1-5/+5
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-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-14/+14
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.
2020-10-11check_tfs.py: Also match case insensitivelyMartin Mathieson1-11/+3
Fix up some issues where the words were the same except for captitalisation.
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-4/+4
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>
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>
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-5/+5
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-04-01Check before setting the length of a protocol item.Guy Harris1-1/+6
Don't assume that 8 + {32-bit unsigned integer} won't overflow. Use tvb_ensure_bytes_exist() to ensure that the data in question is present; it also checks for overflows. Also, set the length after we've succeeded in dissecting the item - if we throw an exception, it's because we don't have all the data, so the tvb_ensure_bytes_exist() would have failed, but this way we at least get to dissect what data we *do* have. Change-Id: If27a2e3ed7978c2051ccb2ddba0d498255d0e350 Reviewed-on: https://code.wireshark.org/review/20840 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-05dissectors: fix this statement may fall through ↵Alexis La Goutte1-1/+1
[-Werror=implicit-fallthrough=] found by gcc7 Change-Id: Iba6238988ded675cba328ab512232d1919d93b4a Reviewed-on: https://code.wireshark.org/review/20415 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-1/+1
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-1/+1
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-06-13isns: fix dead codeMartin Kaiser1-9/+9
do the special handling for len==0 and tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG before going into the different attributes Bug: 12503 Change-Id: I4dd6dcea25aba2e4963811a7a85f1eed1b906bcd Reviewed-on: https://code.wireshark.org/review/15875 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-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-2/+2
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-08Fix a lot of typos and misspellingsmoshekaplan1-1/+1
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-04[isns]: use proto_tree_add_bitmask() for the iscsi node typeMartin Kaiser1-20/+10
Change-Id: I9ba0ca0cfa7e0547b535bfe80c042f541047fc4e Reviewed-on: https://code.wireshark.org/review/10784 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-10-02[isns] replace THROW() with an expert infoMartin Kaiser1-48/+58
this removes 37 THROW() calls do some minor reformatting while at it Change-Id: Ib1611d9a9e7cca9c59451b4040bbaa26cd300aa0 Reviewed-on: https://code.wireshark.org/review/10733 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-30[isns] refactor the attribute parsing codeMartin Kaiser1-341/+132
* go through the data only once, increment offset along the way * remove tag, length dissection from the payload functions * handle all undecoded elements in the default case * don't bring up an exception for an invalid ip address length, proto_tree_add_item() already does this for us * replace the payload functions for string, integer, ip address with proto_tree_add_item() Change-Id: I2a96cb0b22961f63256d7bf0dfe138c6d8100fde Reviewed-on: https://code.wireshark.org/review/10682 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-09-28[isns] re-indent the AddAttribute() functionMartin Kaiser1-314/+314
hopefully, this will make my further patches easier to review Change-Id: If9fe4aa03c08dd38eccae3d4a0accdcbb5d62111 Reviewed-on: https://code.wireshark.org/review/10681 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-24Remove another batch of deprecated tvb_length callsEvan Huus1-2/+2
Change-Id: Icfdde38e40cca05d0705a081153a4ea3e8782ee7 Reviewed-on: https://code.wireshark.org/review/9086 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-23Replace more deprecated tvb_length callsEvan Huus1-3/+3
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-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+1
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+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-23ISNS: Missing break in switch (CID 280460)Alexis La Goutte1-0/+1
Change-Id: Iaaa56e17e49cd42e18e55e316c691a22bbbdf8f1 Reviewed-on: https://code.wireshark.org/review/5989 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-01Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.Michael Mann1-45/+37
Part 2 of many Change-Id: I50815e7738b011382392f3078a7107d3d9eec4ec Reviewed-on: https://code.wireshark.org/review/5542 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-02Reformat hf[] entries; Add editor modelines & adjust whitespace.Bill Meier1-862/+882
Change-Id: I30b25db89d3fbae5f3913ede8bf7bd66fd2516da Reviewed-on: https://code.wireshark.org/review/4432 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-10Eliminate proto_tree_add_text from some dissectors.Michael Mann1-30/+28
Other minor cleanup while in the neighborhood. Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f Reviewed-on: https://code.wireshark.org/review/3537 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-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-21Add missing includesJakub Zawadzki1-1/+2
svn path=/trunk/; revision=54332
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54135
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=53230
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-30/+27
"new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-1/+1
hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly. The script didn't catch as many as I would have liked, but it's a start. The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum. svn path=/trunk/; revision=52045
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-1/+0
svn path=/trunk/; revision=49920
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-2/+2
was done using textual search+replace, not anything syntax-aware, so presumably it got most comments as well (except where there were typos). Use a consistent coding style, and make proper use of the WS_DLL_* defines. Group the functions appropriately in the header. I ended up getting rid of most of the explanatory comments since many of them duplicated what was in the value_string.c file (and were out of sync with the recent updates I made to those in r48633). Presumably most of the comments should be in the .h file not the .c file, but there's enough churn ahead that it's not worth fixing yet. Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467 svn path=/trunk/; revision=48634
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-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-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-05-04AFAICT sys/types.h & netinet/in.h #includes are not needed for these files.Bill Meier1-8/+0
(Let's see if any of the buildbots give any errors). Also: remove trailing whitespace on lines. svn path=/trunk/; revision=42429
2012-03-10Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=41465
2012-01-19Fix some duplicate display filter names.Chris Maynard1-2/+2
svn path=/trunk/; revision=40592
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-07-25Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warning.Bill Meier1-323/+288
Also: various minor cleanup and a few minor bug fixes: svn path=/trunk/; revision=38204