aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ff.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-20Remove init of proto variablesStig Bjørlykke1-878/+878
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-06-13Use `register_dissector()` for more protocolsDavid Perry1-2/+3
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-e*` to `packet-f*`. 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-04-06ff: fix bitmask for value_stringAlexis La Goutte1-12/+16
#18962
2023-01-20Fix some issues seen by tools/check_typed_item_calls.pyMartin Mathieson1-6/+6
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-65/+65
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-11-28Foundation Fieldbus: handle multiple PDUs per UDP payloadJaap Keuter1-17/+27
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-17/+17
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>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-413/+413
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-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>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-20/+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-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>
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-06-23Remove more deprecated tvb_length callsEvan Huus1-2/+2
Change-Id: Ie40a195db622ebfb096fa5088c5467a1385e69bf Reviewed-on: https://code.wireshark.org/review/9062 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-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-09-29Add editor modelines; fix indentation as needed.Bill Meier1-0/+13
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263 Reviewed-on: https://code.wireshark.org/review/4363 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-09proto_tree_add_text -> something filterable.Michael Mann1-942/+491
Most of the items fell under the same 3 filterable fields. Many got converted to proto_tree_add_bitmask. Also removed the superfluous return statements Change-Id: Ib429f986d1c3648e51add8ad3d208428b0ba898c Reviewed-on: https://code.wireshark.org/review/4044 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-26Fix several compilation warningsPascal Quantin1-0/+2
Followup of gf798709 Change-Id: I0afddfe2e9b9ac454377f2358a29b4ecdd011b91 Reviewed-on: https://code.wireshark.org/review/2668 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-26convert to proto_tree_add_subtree[_format]Michael Mann1-647/+288
Change-Id: I525ac2aae2bdbfd5f3a2f3b35f1bf10dde053f66 Reviewed-on: https://code.wireshark.org/review/2667 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-2/+2
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-2/+2
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-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-1/+2
svn path=/trunk/; revision=54135
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-7/+8
"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-10-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-1/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-92/+92
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-07-17Move Do not clear / Clear & Confirmed / Unconfirmed TFS to epan/tfs.[ch]Alexis La Goutte1-3/+0
svn path=/trunk/; revision=50695
2013-07-15Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+4
svn path=/trunk/; revision=50631
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-3/+1
svn path=/trunk/; revision=49920
2013-03-19From beroset:Anders Broman1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48426
2012-12-03General minor cleanup:Bill Meier1-12794/+12091
- create/use several extended value strings; - remove unneeded #includes; - remove unneeded code & variable initializers; - convert "4 space tabs" to spaces; - do some reformatting to use a consistent whitespace style. svn path=/trunk/; revision=46347
2012-09-25replaced decode_boolean_bitfield, decode_numeric_bitfield, and ↵Michael Mann1-487/+475
decode_enumerated_bitfield calls with itemized filters svn path=/trunk/; revision=45135
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
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-09-02length check "heuristics" for FF dissector (UDP + TCP)Michael Mann1-21/+23
Fix compiler error "Fix" WTP+WSP packets incorrectly dissected as Foundation FieldBus packets https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4822 svn path=/trunk/; revision=44735
2012-09-01RevertAnders Broman1-26/+27
length check "heuristics" for FF dissector (UDP + TCP) "Fix" WTP+WSP packets incorrectly dissected as Foundation FieldBus packets https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4822 As it fails with cc1: warnings being treated as errors packet-ff.c: In function 'dissect_ff_tcp': packet-ff.c:13061: warning: passing argument 7 of 'tcp_dissect_pdus' from incompatible pointer type svn path=/trunk/; revision=44724
2012-09-01From Michael Mann:Anders Broman1-27/+26
length check "heuristics" for FF dissector (UDP + TCP) "Fix" WTP+WSP packets incorrectly dissected as Foundation FieldBus packets https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4822 svn path=/trunk/; revision=44722
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-11/+11
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-01-19Fix some duplicate display filter names.Chris Maynard1-14/+14
svn path=/trunk/; revision=40591
2011-12-17Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-25/+25
svn path=/trunk/; revision=40235
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-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-65/+65
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-16/+16
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-264/+264
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-03-23value&0x03 does not need to be shifted to the right by two.Ronnie Sahlberg1-1/+1
cut-n-paste bug from a few lines above where value&0x0c do need to be shifted by two before printing as a value coverity 342 svn path=/trunk/; revision=36278
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-5/+5
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-04-06#include <string.h> not needed.Bill Meier1-1/+0
svn path=/trunk/; revision=32410
2010-01-13From Didier Gautheron:Anders Broman1-629/+138
col_clear.diff Remove calls to col_clear : - called twice. - before functions which also clear the column - by replacing col_clear + col_append_xxx with col_add_xxx https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394 svn path=/trunk/; revision=31517