aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-devicenet.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27devicenet: fix 'buf_len' was marked unused but was used ↵Alexis La Goutte1-1/+1
[-Wused-but-marked-unused] Change-Id: Id16edc055ed675076fe015b84bf37f1bef90ddbf Reviewed-on: https://code.wireshark.org/review/23241 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-07-09Don't use uint_to_str_back when you need guint32_to_str_buf.Michael Mann1-5/+3
It will end up eventually crashing column buffers because memory behind the address is trounced. Change-Id: Id6b5a42effc503e4b8bf5e1deb2135241e2893f3 Reviewed-on: https://code.wireshark.org/review/22563 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-06can: remove duplicated can_identifier struct.Jakub Zawadzki1-5/+2
Change-Id: Ib6f0bcd1bec9a1fc5cbcd797a1f418270ae74a0e Reviewed-on: https://code.wireshark.org/review/21537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-12uat: add a reset callback.Dario Lombardo1-0/+1
This function will free the resources allocated by the caller. Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4 Reviewed-on: https://code.wireshark.org/review/19375 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: Michael Mann <mmann78@netscape.net>
2016-06-22Add address_to_bytes API.Michael Mann1-1/+1
This will copy an address's "byte format" into a buffer. The original intended design is for export_pdu functionality, which tries to do this "manually" for many address types (and creates undesired dependencies) The default functionality if a "byte format function" isn't provided (currently the case for all address types) is a memcpy of the address data. Providing "address to byte" functions to aid export PDU functionality will be provided later. Change-Id: I3703f9e617a8cef09165ad53a0f98c6372676b9b Reviewed-on: https://code.wireshark.org/review/16070 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-06-06*_stdup_printf -> strdup for "single string only" formatting.Michael Mann1-1/+1
Done for performance improvements. This could probably be done in checkAPIs.pl, but this was just a quick manual check with grepping. Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d Reviewed-on: https://code.wireshark.org/review/15751 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: Jaap Keuter <jaap.keuter@xs4all.nl>
2015-12-28Eliminate more unnecessary casting away of constness.Guy Harris1-1/+1
Change-Id: I3d2d83d60f798703ea3fa16ba2d6e95a00f88469 Reviewed-on: https://code.wireshark.org/review/12885 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
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-12-07Spelling fixes for errors found by lintianBalint Reczey1-3/+3
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20 Reviewed-on: https://code.wireshark.org/review/11945 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-4/+4
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.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-10-19If it's used by dissectors, it belongs in to_str.h, not to_str-int.h.Guy Harris1-1/+1
Assuming *any* of the routines that generate printable strings should be thought of as "for internal use by libwireshark routines only, not by dissectors", the ones that *are* used by dissectors obviously shouldn't be. The ability for dissectors to register address types certainly expands the list of routines they would use. Move everything used by dissectors from to_str-int.h into to_str.h, and have dissectors not include to_str-int.h. (Perhaps we should just get rid of to_str-int.h altogether.) Change-Id: I3c583351f038233c9bcd8f9216188f82630267fa Reviewed-on: https://code.wireshark.org/review/11149 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-19Replace enumerated preference for choosing subdissector with a subdissector ↵Michael Mann1-2/+14
table and Decode As functionality. This makes it much easier for other subdissectors (and plugins) to associate themselves with CAN. Change-Id: I49dd832af51651d0c91f9850c100e544d178b8c4 Reviewed-on: https://code.wireshark.org/review/7734 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-02-19Add some casts to satisfy the various compilers.Jeff Morriss1-1/+1
Change-Id: Ic6a1124da986555d07cfeb71167b74f192c1c062 Reviewed-on: https://code.wireshark.org/review/7253 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-02-19Add name resolution support to address type.Michael Mann1-3/+4
Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string. Convert AT_FCWWN to using proper name resolution format First use of address_with_resolution_to_str with field types in proto.c Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2 Reviewed-on: https://code.wireshark.org/review/7196 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-02-18Make UAT record update callbacks return a success/failure indication.Guy Harris1-2/+5
Have them return TRUE on success and FALSE on failure. Check the return value rather than whether the error string pointer is null or not. Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c Reviewed-on: https://code.wireshark.org/review/7222 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-09Add fixed length function for address types.Michael Mann1-1/+6
This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c. Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file. Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4 Reviewed-on: https://code.wireshark.org/review/7038 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-02-09Add "column filter string" support to address types.Michael Mann1-1/+1
Information about dissector (filter) fields should be kept in a dissector as much as possible. Supporting "column filter string" also allows other dissectors to create their own "address types" with different column filters (because AT_ETHER isn't always an "Ethernet" address). This feature also allowed a few "dissector specific" address types to be moved to their own dissector. Change-Id: Ie9024af4db62bc2ee4f8c9d28a1d807f706f45bf Ping-Bug:7728 Reviewed-on: https://code.wireshark.org/review/7029 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-02-09Add address type registration.Michael Mann1-5/+25
Now address types are setup just like field types and must be registered with a structure that provides its string representation (and more things in the future). Address types that are limited to a single dissector are registered by the dissector. More "common" ones are globally registered. There are still a few that really belong in a dissector, but have other dependencies currently not accounted for in the address type support. Many of the "address to string" conversions that involved g_sprintf have be changed to use more "performance friendly" methods (some at the cost of needing to_str-int.h) Leaving all comments regarding this "solution" in address_to_str.c in until all have been implemented Change-Id: I494f413e016b22859c44675def11135f228796e0 Reviewed-on: https://code.wireshark.org/review/7019 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-13UAT error string pointers should not be const pointers.Guy Harris1-1/+1
UAT error strings are usually allocated by g_strdup() or g_strdup_printf(), and must ultimately be freed by the caller. Make the pointer-to-error-string-pointer arguments to various functions be "char **", not "const char **". Fix cases that finds where a raw string was being used, as that won't work if you try to free it; g_strdup() it instead. Add a missing free of an error string. Remove some no-longer-necessary casts. Remove some unnecessary g_strdup()s (the string being handed to it was already g_malloc()ated). Change some variable declarations to match. Put in XXX comments for some cases where the error string is just freed, without being shown to the user. Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0 Reviewed-on: https://code.wireshark.org/review/6525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-10Add preference to display spaces between bytes for FT_BYTES fields.Michael Mann1-12/+6
I think this can make fields more readable (for a small amount of bytes). Converted DeviceNet dissector to use proto_tree_add_item for some FT_BYTES field as tvb_bytes_to_str_punct was used to create this effect "manually". Change-Id: I59e2acf9b00a4eb1279e6c2b2b7bd8ecef20db9b Reviewed-on: https://code.wireshark.org/review/6304 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07tvb_bytes_to_ep_str_punct -> tvb_bytes_to_str_punctMichael Mann1-6/+6
Also change bytestring_to_str to match bytes_to_ep_str_punct functionality (limiting byte string size) Change-Id: Idb958c7f0c203d103629469302b81fa922714f7e Reviewed-on: https://code.wireshark.org/review/6369 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-1/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.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-13Use ENC_LITTLE_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-27/+27
(for some dissectors which fetch all other integral fields using ENC_LITTLE_ENDIAN). Change-Id: Ica72a68ac560f2920d61e0769de83130557c46fd Reviewed-on: https://code.wireshark.org/review/5752 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05Eliminate proto_tree_add_text from some dissectors.Michael Mann1-4/+18
Other minor cleanup while in the area. Change-Id: Id8d957d3d68a2e3dd5089f490bd59d773e1be967 Reviewed-on: https://code.wireshark.org/review/3427 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>
2014-06-25convert to proto_tree_add_subtree[_format]Michael Mann1-23/+10
Change-Id: I2ea1892b5963cc5578cbdd2b03029ca8424f2267 Reviewed-on: https://code.wireshark.org/review/2640 Tested-by: Michael Mann <mmann78@netscape.net> 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-03-06Ue TFS & VALS macros for certain 'fieldconvert' fields.Bill Meier1-1/+1
Change-Id: I8d7468e62d5de99eb68b554134be71b17d1b87c8 Reviewed-on: https://code.wireshark.org/review/525 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.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>
2014-02-25Fix packet-devicenet.c:619:17: error: will never be executed ↵Alexis La Goutte1-1/+0
[-Werror,-Wunreachable-code] Change-Id: I3e7cc60e1844dcb1eab87060f6338bd4ba08e9b3 Reviewed-on: https://code.wireshark.org/review/322 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-1/+1
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-6/+6
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=54135
2013-12-12Fix Coverity CID 1135557: Structurally dead code, by moving the break ↵Chris Maynard1-4/+4
statement to the most sensible place. svn path=/trunk/; revision=53973
2013-12-09Fix warningsJakub Zawadzki1-1/+1
svn path=/trunk/; revision=53885
2013-12-06Fix indent (use 4 spaces) Remove trailing whitespace Add ModelinesAlexis La Goutte1-188/+201
svn path=/trunk/; revision=53814
2013-12-06Fix (-W)unused-const-variable error found by ClangAlexis La Goutte1-0/+4
svn path=/trunk/; revision=53812
2013-12-06Update svn propertiesPascal Quantin1-1033/+1033
svn path=/trunk/; revision=53811
2013-12-06Fix unused parameter 'pinfo'Alexis La Goutte1-4/+4
svn path=/trunk/; revision=53804
2013-12-06Add DeviceNet and J1939 dissectors. Both run on top of CAN (not necessarily ↵Michael Mann1-0/+1033
always SocketCAN, but it did provide a good test environment) svn path=/trunk/; revision=53802