aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cip.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-16Replace deprecated tvb_length APIsAndersBroman1-15/+15
Change-Id: Idfd3bed012e823de544fe4de483c8f095fc7c65d Reviewed-on: https://code.wireshark.org/review/8086 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-3/+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-21Have a heur_dissector_list_t be an opaque handle.Guy Harris1-1/+1
This allows dissector lists to be looked up by name, so they can be shared by multiple dissectors. (This means that there's no "udplite" heuristic dissector list, but there shouldn't be one - protocols can run atop UDP or UDPLite equally well, and they share a port namespace and uint dissector table, so they should share a heuristic dissector table as well.) Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7 Reviewed-on: https://code.wireshark.org/review/5936 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-12cip: Access FT_UINT16 hf_cip_sc_create_instance with proper encoding-arg.Bill Meier1-1/+1
Specifically: Use ENC_LITTLE_ENDIAN (not ENC_NA) to match all other integral fetches in the cip dissector. Change-Id: I5d330084168493f53135dbb97674a2dba9ed7477 Reviewed-on: https://code.wireshark.org/review/5732 Reviewed-by: Bill Meier <wmeier@newsguy.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-26Fix a number of dup hf[] filter-names probably resulting from cut/paste errs.Bill Meier1-1/+1
Change-Id: I9242300b2ace3155c1506b584a90f073100a305e Reviewed-on: https://code.wireshark.org/review/5512 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-03Eliminate proto_tree_add_text from some dissectors.Michael Mann1-41/+43
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f Reviewed-on: https://code.wireshark.org/review/3319 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-07G_GNUC_FORMAT encapsulates __attribute((format_arg(...))).Guy Harris1-4/+1
Change-Id: I9513c187ae4ce8b8cf8f6a926072b215e26ec64f Reviewed-on: https://code.wireshark.org/review/2907 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Squelch some compiler warnings.Guy Harris1-6/+20
Change-Id: Ie39c7b0c1fef8f862cec016a3a1a5bd1451a3df2 Reviewed-on: https://code.wireshark.org/review/2905 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24convert to proto_tree_add_subtree[_format]Michael Mann1-103/+61
Change-Id: I5f573dffabb8685a8e5a334ff2bfb24d9838daa6 Reviewed-on: https://code.wireshark.org/review/2601 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-16/+16
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-16/+16
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-6/+6
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-28Minor: use VALS macro (as per convention); Add editor modelines; Do ↵Bill Meier1-1/+1
whitespace changes. Change-Id: I6007c1b2098d06e4a892474dd07f06a7538f94ef Reviewed-on: https://code.wireshark.org/review/1843 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-28Add EtherNet/IP connection conversation filtersMichael Mann1-18/+31
Change-Id: Ia69cbe9fea364c735bde956d84a82404b46ec236 Reviewed-on: https://code.wireshark.org/review/1810 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-23tvb parameter should not be NULL as the lengths are nonzero.Michael Mann1-7/+7
Change-Id: If085a9fc69bbbf28a7c801930a664c412a4a5b7a Reviewed-on: https://code.wireshark.org/review/1734 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-2/+3
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> 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-06Add DeviceNet and J1939 dissectors. Both run on top of CAN (not necessarily ↵Michael Mann1-33/+33
always SocketCAN, but it did provide a good test environment) svn path=/trunk/; revision=53802
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-23/+23
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470) I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-5/+5
svn path=/trunk/; revision=52591
2013-09-22emem -> wmem conversion:Pascal Quantin1-1/+1
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-13Convert a few more dissectors to wmemPascal Quantin1-20/+21
svn path=/trunk/; revision=52013
2013-07-03expert_add_info_format_text + proto_tree_add_text = ↵Michael Mann1-3/+3
proto_tree_add_expert_format, where applicable. svn path=/trunk/; revision=50377
2013-05-24first batch of dissectors to use the new expert info API.Michael Mann1-60/+177
svn path=/trunk/; revision=49560
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-23/+23
svn path=/trunk/; revision=49259
2013-04-16dissect CIP-Safety application reply dataMichael Mann1-2/+56
svn path=/trunk/; revision=48887
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
2013-03-15[-Wmissing-prototypes]Anders Broman1-11/+14
Use explicit casts. svn path=/trunk/; revision=48313
2013-02-26it's ==> its & its ==> it's as needed.Bill Meier1-2/+2
svn path=/trunk/; revision=47891
2013-02-01follow/clean up to rev 47389. The causes of some of the unused hf_ was ↵Michael Mann1-17/+0
typos and refactoring. hf_cip_reserved16 was a "placeholder", so it can remain commented out. svn path=/trunk/; revision=47419
2013-01-31Comment out unused hf[] entries & etc.Bill Meier1-6/+18
(found by checkhf) svn path=/trunk/; revision=47389
2012-11-13ENIP/CIPMichael Mann1-37/+804
Added the start of IPv6 support for I/O conversations (waiting for spec definitions to complete). Added support for multiple messages in a single frame to be separated in the COL_INFO column. ENIP Added ListIdentity delay dissection remove check_col() CIP Added TimeSync object dissection svn path=/trunk/; revision=46020
2012-10-26Improve Modbus/TCP dissector, Part 1Michael Mann1-2/+11
This is a portion of the patch supplied in bug 7902 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7902). Breaking the functionality up into smaller chunks. This definitively breaks the Modbus dissection into 3 dissectors: Modbus - real protocol PDU Modbus/TCP - Encapsulation of Modbus over TCP (with a small header before PDU) Modbus RTU - Originally an encapsulation of Modbus over serial (with smaller header + CRC), but can also be sent over TCP. General cleanup/refactoring (including display filter names) based on the 3 dissectors. Also included: 1. Enhanced dissection to include preferences for register data to be dissected as UINT16, UINT32 or FLOAT 2. Dynamic port registration 3. Additional fields now filterable svn path=/trunk/; revision=45793
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-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-2/+2
svn path=/trunk/; revision=44871
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-6/+6
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-15/+15
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-08-09registered init routine actions need be done just once in ↵Bill Meier1-11/+6
proto_reg_handoff...(); localize two handles to proto_reg_handoff(); svn path=/trunk/; revision=44372
2012-08-07Add a sanity check so we don't unnecessarily allocate memory for a Multiple ↵Michael Mann1-18/+25
Service Packet message. Bugfix 7570 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7570) svn path=/trunk/; revision=44312
2012-07-11Explicit value_string array size specifier not required.Bill Meier1-2/+2
svn path=/trunk/; revision=43669
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-06-12Fix: code under 'if(tree)' (in)directly calls ↵Bill Meier1-21/+12
sub-dissector/col_...()/expert...() fcns svn path=/trunk/; revision=43226
2012-05-05Fix some more hf encodings.Jeff Morriss1-4/+4
svn path=/trunk/; revision=42434
2012-05-04value_string_ext: Reorder entries in value_string arrays to get Binary ↵Jakub Zawadzki1-1/+1
Search instead of Linear Search. svn path=/trunk/; revision=42418
2012-05-04Fix conflicting entries in CIP vendor list.Jakub Zawadzki1-1/+1
344 is registered to KEBA. (Ref: http://www.odva.org/Home/CIPSUPPLIERDIRECTORY/LicensedVendorList/tabid/86/lng/en-US/Default.aspx) svn path=/trunk/; revision=42417
2012-04-09Mark some function static.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=41999
2012-03-06Whitespace cleanup.Bill Meier1-352/+352
svn path=/trunk/; revision=41386
2012-03-06Fix incorrect packet-details display of a 1 bit FT_BOOLEAN field.Bill Meier1-1/+1
svn path=/trunk/; revision=41378
2012-03-02From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6893 :Jeff Morriss1-19/+21
The attached patches fix the following issues: 1. CIP-Motion shouldn't be a heuristic dissector. CIP-Motion packets are determined by specific fields in a CIP ForwardOpen. I ran into situations where CIP-Motion's "vague" heuristics incorrectly dissected packets meant for CIP-Safety. Of course this requires the ForwardOpen to be in the trace, but it is the most deterministic way to have CIP-Motion packets. 2. Minor bugfix to the CIP-Safety dissector. A couple of fields were "missing", causing errant malformed packets. svn path=/trunk/; revision=41283