Commit Graph

178 Commits

Author SHA1 Message Date
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Guy Harris b395a98305 Squelch a bunch of compiler warnings.
svn path=/trunk/; revision=31961
2010-02-23 04:35:23 +00:00
Anders Broman cd0147c004 Make sure we have a handle for the dissector.
svn path=/trunk/; revision=30824
2009-11-04 17:13:01 +00:00
Bill Meier adc374c903 Fix some indentation.
svn path=/trunk/; revision=30527
2009-10-12 01:31:01 +00:00
Kovarththanan Rajaratnam 1b668036d1 Move dissector add sanity check to separate function
svn path=/trunk/; revision=30346
2009-10-05 18:52:46 +00:00
Guy Harris 3a92e1e456 The data sources can be used even if the protocol tree isn't being built
or isn't visible.

Clean up some indentation.

svn path=/trunk/; revision=30158
2009-09-25 21:29:36 +00:00
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Kovarththanan Rajaratnam b3b9be09c7 We track all protocols that appear in each packet in the frame dissector. This is an expensive operation because we:
* Disable the TRY_TO_FAKE_THIS_ITEM optimization
* Use GString to store the protocols

We should only do this if the 'hf_frame_protocols' is referenced (unlikely)

svn path=/trunk/; revision=29733
2009-09-06 07:55:17 +00:00
Kovarththanan Rajaratnam 7d44262406 This patch introduces packet_add_new_data_source() which effectively deprecates add_new_data_source(). This is based on the following observation:
1) The tvb + name (aka. data_source) is only used when the protocol tree is visible

The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify.

A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated!

svn path=/trunk/; revision=29427
2009-08-15 06:38:10 +00:00
Bill Meier aed6451fff Remove 1 commented-out #include inadvertantly committed.
svn path=/trunk/; revision=29276
2009-08-03 18:06:36 +00:00
Bill Meier d8297e8312 Add some debug code (commented out) to check for duplicate dissector port registrations,
svn path=/trunk/; revision=29275
2009-08-03 17:25:17 +00:00
Gerald Combs 753e9f65e5 Zero out the packet_info struct for each packet instead of trying to
initialize everything by hand. Fixes a Valgrind warning.

svn path=/trunk/; revision=29122
2009-07-16 20:52:36 +00:00
Stig Bjørlykke 27572c22f4 From Kovarththanan Rajaratnam via bug 3702:
This patch optimizes the data source name processing in add_new_data_source()
by delaying it. We now simply store the constant string and lazily compute the
name when needed. This gives a performance boost because we only need the name
if we have multiple data sources.

svn path=/trunk/; revision=29066
2009-07-12 10:19:13 +00:00
Anders Broman c2509b0b3f Handle Detach and Service request, make it possible to set direction on link(UL/DL).
svn path=/trunk/; revision=28648
2009-06-06 17:03:34 +00:00
Anders Broman 3ab0c21cbc Introduce call dissector_try_port_new() to be used when no protocol entry is to be made in the protocols list. Used by asn2wrs dissectors to avoid multiple entrys as calls are made
multiple times for the same PDU.

svn path=/trunk/; revision=28106
2009-04-21 16:53:00 +00:00
Gerald Combs 844af38e54 size_t fixes.
svn path=/trunk/; revision=27990
2009-04-08 05:25:14 +00:00
Luis Ontanon 230d917776 Add a debug helper for EP memory corruption
if compiled in and the env var WIRESHARK_DEBUG_EP_CANARY is set:
will check for canary integrity at every call to EP_CHECK_CANARY()
if corruption is found it exits pronting the prior location and the location in which corruption was found.
Hopefully it stops running while the corruptor is still in the stack.

see EP_CHECK_CANARY() calls in packet.c as an example.




svn path=/trunk/; revision=25927
2008-08-05 02:23:35 +00:00
Jaap Keuter e86825b8f8 From Francesco Fondelli:
Attached is a patch for:
- PW Associated Channel Header dissection as per RFC 4385
- PW MPLS Control Word dissection as per RFC 4385
- mpls subdissector table indexed by label value
- enhanced "what's past last mpls label?" heuristic
- Ethernet PW (w/o CW) support as per RFC 4448

svn path=/trunk/; revision=25730
2008-07-13 17:19:33 +00:00
Jeff Morriss 35ff3c851b A slightly more complicated have_postdissector() (missed in my previous checkin--thanks Bill) which also checks if the postdissectors are enabled.
svn path=/trunk/; revision=25347
2008-05-21 20:20:37 +00:00
Bill Meier 59d2c9eb92 boolean -> gboolean
svn path=/trunk/; revision=25344
2008-05-21 16:56:50 +00:00
Bill Meier ad761ed3fd Add missing have_postdissector(); (Hopefully what was intended).
svn path=/trunk/; revision=25342
2008-05-21 16:40:15 +00:00
Stig Bjørlykke f60062dccc Call post dissectors with call_dissector_only() to avoid an extra Data entry
if post dissectors are disabled, as pointed out by LEGO.

svn path=/trunk/; revision=24109
2008-01-15 23:31:37 +00:00
Jaap Keuter 74cf6511fb Cleanup call_dissector / call_dissector_only
svn path=/trunk/; revision=23871
2007-12-15 13:20:17 +00:00
Anders Broman b421cc6a2c Apply yet another set of the optimization patches:
move the case where pinfo->in_error_pkt is true in its own function:
- it's not the common case.
- it needs a TRY block. ==> slow volatile and big stack footprint.
- call_dissector_work is called a lot and recursively.

svn path=/trunk/; revision=23413
2007-11-09 06:07:30 +00:00
Anders Broman f209667d93 From Andrew Feren:
return FALSE if dissector_try_string(...) is passed a NULL string pointer
arguably this should assert instead.

svn path=/trunk/; revision=23287
2007-10-27 15:02:07 +00:00
Ulf Lamping a8b2f589e9 be a bit more verbose, if the name given to register_dissector_table() is not unique (e.g. because of a buggy/duplicated plugin)
svn path=/trunk/; revision=23042
2007-10-02 05:07:13 +00:00
Mike Duigou f6b771c467 call_dissector() provides generic 'data' handler for unrecognized data types. call_dissector_only() fails gracefully for unrecognized types. The handler for generic 'data' should avoid the variant that potentially could result in recursively calling itself.
svn path=/trunk/; revision=22907
2007-09-19 16:34:06 +00:00
Ulf Lamping a11feafee6 don't use NULL to initialise an integer
svn path=/trunk/; revision=22474
2007-08-08 23:36:48 +00:00
Ulf Lamping 5c86e7fd4c add pinfo fields clnp_srcref and clnp_dstref to the clnp dissector, similar to the srcport / destport already existing. As simply using srcport / destport for this will confuse mixed protocol usage (like RFC1006 ISOonTCP), I've added explicit clnp fields.
This way, protocols on top of COTP / CLNP have at least a chance to do reassembling correct.

svn path=/trunk/; revision=22473
2007-08-08 22:53:14 +00:00
Luis Ontanon 7475efa0f6 from: Mike Duigou
Adds a heur_dissector_delete() function to allow heuristic dissectors to be
dynamically disabled based upon, for example, preference settings.

http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1697


svn path=/trunk/; revision=22463
2007-08-07 21:26:07 +00:00
Ulf Lamping 12aed7290c - add PDInterfaceFSUDataAdjust block
- start to implement an AR conversation handler

svn path=/trunk/; revision=22444
2007-08-03 19:29:34 +00:00
Sebastien Tandel 76729e5d0f From David Howells :
Fix compilation failures when building wireshark-0.99.6-SVN-21916 on an
x86_64-unknown-linux-gnu target with gcc version 4.1.2 20070403 (Red Hat
4.1.2-8).

The failures fall into two categories:
  (1) Casts between pointers and 32-bit integers without an intermediary cast
via 'long' or 'unsigned long'.  This results in a compiler warning complaining
about casts between a pointer and an integer of a different size.
  (2) Passing values to "%lld" or similar printf-style format options that the
compiler thinks are a different size.  Such values need to be cast to 'long
long' or 'unsigned long long'.

svn path=/trunk/; revision=21975
2007-05-29 02:43:18 +00:00
Guy Harris 6f4a938c64 Dissector table names should be pointed to by const pointers.
svn path=/trunk/; revision=21533
2007-04-23 17:40:33 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Sebastien Tandel 0854c90e87 epan/dissectors/Makefile is now building four libraries :
- asn dissectors : libasndissectors.la
  - pidl dissectors : libpidldissectors.la
  - normal dissectors : libdissectors.la *and* libcleandissectors.la. I
  separated it in two libraries temporarily. The source files used to build
  libcleandissectors.la do not generate warning anymore and the -Werror is used
  to compile them. If we patch a dissector and it doesn't generate warning
  anymore, we have to move the filename dissector from DISSECTOR_SRC to
  CLEAN_DISSECTOR_SRC in epan/dissectors/Makefile.common.

If you want to define specific cflags for one library type, let's say pidl, you
may define libpidldissectors_la_CFLAGS.

svn path=/trunk/; revision=21324
2007-04-03 19:50:04 +00:00
Luis Ontanon 5fa8e75149 packet_info.c and packet.c
add sccp_info to struct _packet_info (Sorry but the way private_data works and the fact that TCAP uses it and BSSAP/RANAP can be tunnelled on GSMMAP over TCAP makes it impossible to avoid)

SCCP
- Have SCCP to have a TAP,
- Fix associations so that every message belongs to the association.
- Export message type values so that they can be used by a tap listener

RANAP
 - Have RANAP information attached to the sccp_info 

BSSAP + GSM_A
- Have DTAP, BSSMAP and BSSAP info attached to the sccp_info

svn path=/trunk/; revision=21076
2007-03-21 00:48:46 +00:00
Ronnie Sahlberg 8ed1260c2c add a field in pinfo where dcerpc/pidl can store the name of the current dcerpc procedure
use this field in the policy handle helper to indicate not only which frames the handle was opened/close in but also the name of the function that opened it.
eventually, when other pidl support infrastructure is developed it would be nice if this could be expanded to also contain the name of the object/handle opened.



svn path=/trunk/; revision=20895
2007-02-21 20:21:11 +00:00
Ulf Lamping e3330fd922 instead of simply doing an assert when running out of memory in emem, throw a new OutOfMemoryError Exception, so file.c can show at least a better explanation to the user before Wireshark terminates
XXX - to prevent a busy wait, I need a portable way to wait for a short time period, like Sleep() for Windows

svn path=/trunk/; revision=20437
2007-01-15 05:16:13 +00:00
Jaap Keuter f8422ab7db Extending true_false_string support
- Separate tfs.[ch]
- Add larger sample collection
- Properly export DATA

svn path=/trunk/; revision=20373
2007-01-10 07:47:00 +00:00
Ronnie Sahlberg cd02551610 add a tcp_tree field to packet_info so that we can access the tree from tcp_dissect_pdus() (and others if need be)
in tcp_dissect_pdus()  add a field ( tcp.pdu.size ) to the tree that displays the pdu size.



svn path=/trunk/; revision=19655
2006-10-22 00:21:40 +00:00
Ronnie Sahlberg f956bad366 we need a new pinfo member field so that we can pass data from the core usb dissector to future class dissectors
svn path=/trunk/; revision=19576
2006-10-17 14:13:49 +00:00
Ulf Lamping d4499eb9a7 move value_strings from expert_dialogs into expert.c to remove duplicates
keep the highest severity level of the current file (experimental)

svn path=/trunk/; revision=19104
2006-08-31 22:56:38 +00:00
Jörg Mayer 41d8f13aec Neil Piercy:
I've just had a bug in one of our private dissectors which meant
that the handle passed to call_dissector was null. This seemed to give
varying behavior - on some Windows installations it hit wireshark's
in-built exception handling, and displayed that the dissector had an
error (correct), but on some installations it just crashed wireshark
(not helpful). I _think_ the difference was whether MSVC was installed
or not, but on a sample of only 3 machines.

Should call_dissector include explicit null handle checks, and if so,
should it:-

a) g_assert - the simple patch attached
b) fallback to doing a data decode (as disabled protocols do)
c) try to invoke the wireshark exception handling for the packet

Or is the correct answer none of the above - the exception handler
should already cope ?

        

svn path=/trunk/; revision=18869
2006-08-10 10:09:31 +00:00
Ulf Lamping f4c7cae6b0 add various enhancements to the CBA-ACCO dissector, including an added profinet_type field to the packet_info struct
svn path=/trunk/; revision=18615
2006-06-29 19:46:51 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ulf Lamping 0ef693174e fix some typos in a comment
svn path=/trunk/; revision=17653
2006-03-16 23:18:15 +00:00
Gerald Combs ac32d8875f Initialize a return value. Found by Coverity.
Fix up whitespace.

svn path=/trunk/; revision=17499
2006-03-07 16:28:25 +00:00
Lars Roland 307ba63d48 Fix a possible NULL pointer dereference discovered by coverity.
I'm not sure, if it is possible to get a NULL pointer here, but it is safer to fix it.

svn path=/trunk/; revision=17494
2006-03-07 13:48:54 +00:00
Luis Ontanon 48f8113d58 fix a typo
svn path=/trunk/; revision=17090
2006-01-24 02:11:38 +00:00