Commit Graph

138 Commits

Author SHA1 Message Date
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
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>
2015-01-27 15:14:12 +00:00
Graham Bloice 21697af636 Added DNP3 support for g13 and g43, output command events
Bug: 10347
Change-Id: Ic173f31d8cf3fd002454f4c22b85c19bae42d544
Reviewed-on: https://code.wireshark.org/review/6175
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-01 04:38:34 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
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-22 21:03:13 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
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-21 05:46:22 +00:00
Michael Mann 4f9af8608c Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.
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-12-01 08:52:03 +00:00
cbontje d330cd4ecb DNP3 Protocol Bugfix / Enhancement
- Fix for Single-bit Objects offset-pointer
- Enhancement for Obj 12 Var 2 (Pattern Control Block) and Var 3 (Pattern Mask) Decoding

Bug: 10558
Change-Id: I8d3f6cee4acbab09d0b93dab6b868cddd842b682
Reviewed-on: https://code.wireshark.org/review/4597
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 20:19:08 +00:00
Michael Mann 419de19c1d Create subdissector table for RTAC Serial and have dissectors register with it, rather than have the RTAC Serial dissector go find all of the dissectors its interested in.
Change-Id: I6b6a05ec242e4798fb56ffa43c661ec277aca955
Reviewed-on: https://code.wireshark.org/review/3984
Reviewed-by: Chris Bontje <cbontje@gmail.com>
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-09-07 01:45:12 +00:00
Guy Harris 57927c8a56 Fix compiler warning.
Change-Id: Idf275d89591558fd2ea082c886ce07e62523807a
Reviewed-on: https://code.wireshark.org/review/3506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 16:18:26 +00:00
Guy Harris 22ad90cdc8 Add routines for CRC-16 with a polynomial of 0x3D65.
There are routines that take a buffer and a length and that take a
tvbuff, offset, and length; use those routines in the DNP dissector
(which no longer needs its own table and loop), and use the tvbuff
routine instead of calling tvb_get_ptr().

Change-Id: Ic67b0f3b65b94ea47c0fdc2f3d3b6f88df77f9c6
Reviewed-on: https://code.wireshark.org/review/3505
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 15:58:06 +00:00
Graham Bloice ec08f3458e Added function dnp3_header_check() to check the validity of a DNP3
packet as far as possible, called from both dissect_dnp3_tcp and dissect_dnp3_udp.

Bug: 10287
Change-Id: Iaa988258b3614cb1b408dec41a987fbd61c9727c
Reviewed-on: https://code.wireshark.org/review/3096
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-27 17:41:30 +00:00
Graham Bloice ed043d753a When DNP3 heuristics are disabled, relax the conditions on
accepting a packet as DNP3.

Bug: 10287
Change-Id: I222ec885186447c8a72eaf11cebacff8b9b79fad
Reviewed-on: https://code.wireshark.org/review/3092
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-17 15:46:38 +00:00
Michael Mann 888f22de16 convert to proto_tree_add_subtree[_format]
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-25 16:35:14 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
AndersBroman c49be78f4e remove duplicated entries.
Change-Id: I1fcbda17cbc444eee04e975d60b371fc2fa4754c
Reviewed-on: https://code.wireshark.org/review/1184
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17 13:39:34 +00:00
AndersBroman 17a0b59e39 From Graham Bloice:
Fix A mismatch in the dnp3_al_obj_vals value string fixes bug
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9945

Change-Id: I3d0a423d7d2e4a711533debbd950e2976dd5115e
Reviewed-on: https://code.wireshark.org/review/1183
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-04-17 13:28:52 +00:00
Graham Bloice 8c5e9fcb82 Fixed display of IIN during reads and writes of IIN object.
Added (hidden) dnp3.addr field set by both source and destination dnp3
addresses to allow easier filtering.

Change-Id: I04980c24c1b9f30a2ee5a0d5ea4ac32ae877504e
Reviewed-on: https://code.wireshark.org/review/908
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2014-04-01 13:05:45 +00:00
cbontje 1b2559de3e Fix DNP3 Dissector DNP3 Read Requests and Direct Op No ACKs
This corrects a couple issues with the DNP3 Dissector:
- Refactored Read Object String lookups to use value_string
- Corrected issue with multiple object types in a single read not being processed
- Added processing for Direct Operate No ACK Messages

Fixes issues noted in Bug 9839

Change-Id: I9895e509a8d3931c805ce53b718a4951f8f8039e
Reviewed-on: https://code.wireshark.org/review/538
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-07 07:01:10 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Chris Maynard bd9b32ae3e Fix Visual Studio Code Analysis warning C6001: Using uninitialized memory 'obj_type'
svn path=/trunk/; revision=54008
2013-12-13 01:56:40 +00:00
Pascal Quantin 1c73d047b3 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9442 :
DNP3 bug fix for analog data sign bit bandling

svn path=/trunk/; revision=53399
2013-11-17 16:40:25 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "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-11-09 17:46:28 +00:00
Graham Bloice 1f278f036a Updated email address for Chris Bontje and myself.
svn path=/trunk/; revision=52369
2013-10-04 17:32:04 +00:00
Graham Bloice 2ab20bf491 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9195:
Added object decoding for Device Attributes
Added object decoding for IIN read
Improved decoding of Counter Freeze objects

svn path=/trunk/; revision=52353
2013-10-04 10:12:13 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- 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-22 15:50:55 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if 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-09-15 01:48:30 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Anders Broman dd12400161 From Chris Bontje:
Changes include:
- Detect previously-unknown object types.  No dissection is attempted of response messages, but at least the types are documented and labelled.  As Graham notes, if some examples are provided we can attempt a little more here.
- Change up info_column object label handling to add some of the new objects.  Also added in a few that would be present in 'write' messages.
- Add expert info field for abnormal IIN bits.  This will help me in my job of detecting unknown objects and unsupported function codes and will easily flag to the user that 'something is up' due to the color changes.
- Only detect Application Layer if we are on the Final Transport Layer frame.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9056

svn path=/trunk/; revision=51768
2013-09-05 05:34:40 +00:00
Pascal Quantin b46f9bebe2 Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
2013-08-19 14:55:41 +00:00
Graham Bloice 243a76b04f Improved info column with multiple pdu's in a frame
svn path=/trunk/; revision=50966
2013-07-28 09:57:52 +00:00
Jakub Zawadzki a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Alexis La Goutte dc00c8fc94 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50355
2013-07-03 16:44:08 +00:00
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Guy Harris a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman 263a9d0683 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48341
2013-03-16 16:25:41 +00:00
Guy Harris bf4e129f5f Get rid of unused string to squelch warning.
svn path=/trunk/; revision=47661
2013-02-14 22:27:04 +00:00
Pascal Quantin f244067727 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8333 :
Corrections to Recent DNP3 Control Code Changes in Bug ID 7865

svn path=/trunk/; revision=47660
2013-02-14 21:57:30 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Bill Meier 3a40f4d2a0 Fix [-Wuninitialized] warning.
svn path=/trunk/; revision=46237
2012-11-27 21:54:10 +00:00
Bill Meier 3617c83076 General cleanup:
- create/use extended variable string;
- #if 0 unused value_string arrays (instead of marking with _U_);
- "localize" some variable definitions;
- remove some uneeded variable initializers;
- reformat hf[] entries;
- do some whitespace and formatting changes to use a consistent style.


svn path=/trunk/; revision=46236
2012-11-27 21:48:15 +00:00
Anders Broman c1e5be52ad From Chris Bontje:
DNP3 - Incorrect Information Column Display for "Read" Function Code.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7977

svn path=/trunk/; revision=46039
2012-11-16 11:29:05 +00:00
Anders Broman be96ac69d7 The heuristic is to weak, add a preference if heuristics shoulld be used or not and default it to not used.
svn path=/trunk/; revision=45847
2012-10-31 12:47:24 +00:00
Michael Mann 0d5d45cf9f Enhancements to DNP3.0 Control Code Dissection (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7865)
minor updates to checked in patch (from rev 45583)

svn path=/trunk/; revision=45584
2012-10-16 14:21:05 +00:00
Anders Broman 3134b7d7f8 From Benjamin Stocks:
Enhancements to DNP3.0 Control Code Dissection.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7865

svn path=/trunk/; revision=45583
2012-10-16 14:15:11 +00:00
Michael Mann 97c808c75c replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45152
2012-09-26 18:10:29 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00