Commit Graph

34 Commits

Author SHA1 Message Date
Ronnie Sahlberg edcaaee164 SCSI is fairly unique among the ethereal protocols in that it is sometimes normal for a PDU we receive back froma device to be truncated.
(report luns with allocation length 8 for example)

Therefore it is a bit wrong to mark these packets as [malformed packets]
Since they are truncated by scsi   and this is NOTY an error condition.


Add a new exception type  :  ScsiBoundsError
If this exception is caught by packet-frame, then print an appropriate message
instead of [malformed packet]

For SCSI, add helper macros TRY_SCSI_SHORT_PACKET   and END_...


If the packet was not short in the normal sense (snaplen < packetlen) then intercept the exception for BoundsError and rethrow it as ScsiBoundsError instead.





svn path=/trunk/; revision=17611
2006-03-13 10:29:00 +00:00
Anders Broman 9951fc2cff from Daniele Orlandi:
The attached patch adds support for LAPD frames captured using vISDN thru 
libpcap. The support has already been included in libpcap.

The patch adds a new wiretap encapsulation, the necessary glue to decode 
SLL-encapsulated frames, and some minor change in the LAPD dissector in order 
to support the remote-to-remote frames captured on the ISDN E-Channel.

Please apply ethereal-encap-table.diff before, as it fixes a misalignment in 
the encapsulation names table.

svn path=/trunk/; revision=17451
2006-03-02 21:29:15 +00:00
Ronnie Sahlberg ae52099756 fix for bug 718
dont play games with lnk_t
If the preference is set to unconditionally dissect everything as docsis   just call the docsis handler directly.



svn path=/trunk/; revision=17377
2006-02-23 09:11:00 +00:00
Ulf Lamping 84794a9bc3 from Gisle Vanem:
This file uses SEH which AFAIK is only available for MS Visual-C.
I build using MingW/gcc, so the attached patch is needed. 

svn path=/trunk/; revision=17102
2006-01-25 21:34:04 +00:00
Luis Ontanon e469d2af12 Use the right tree
svn path=/trunk/; revision=17099
2006-01-25 20:48:37 +00:00
Luis Ontanon 1ff8c4272f Add register_postdissector() to the API.
Dissectors registered with register_postdissector() will be called after all other dissectors have been called.

Use it to register mate.


svn path=/trunk/; revision=17089
2006-01-24 00:26:57 +00:00
Ulf Lamping c73ed3c6d5 add Win32 Structured Exception Handling (SEH) at the same place we're already doing the Portable Exception Handling.
This way we (hopefully) can continue dissecting with the next packet, even if a more serious exception had occured, e.g. a memory access violation or a divide by zero exception.

Obviously, not all problems solved, as SEH won't protect us from other problems, e.g. endless loops and such

svn path=/trunk/; revision=17070
2006-01-22 02:22:14 +00:00
Ulf Lamping 864edeb5ac add matched coloring rule name and string to the frame dissector output (or nothing if no coloring rule matched or none was set)
svn path=/trunk/; revision=17068
2006-01-21 17:49:00 +00:00
Ronnie Sahlberg 163252a41c From Stig B
Patch for COTP reassembly.

There does not seem to be any reasonable or cleaner way to fix COTP 
reassembly than adding the frame.[ch] patch.


svn path=/trunk/; revision=16813
2005-12-16 00:32:12 +00:00
Guy Harris f6ef22c553 Have show_exception() take a "const char *" as its exception message,
and not free the string to which it points.  Pass to
REPORT_DISSECTOR_BUG() strings allocated with ep_strdup_printf(), so
that they're freed automatically.

svn path=/trunk/; revision=16039
2005-09-28 16:16:37 +00:00
Ulf Lamping bed8f51d98 show the same [Packet size limited during capture] message in the column info, instead of the former (unintuitive) [Short Frame]
svn path=/trunk/; revision=15979
2005-09-23 18:05:36 +00:00
Ulf Lamping 497478bc99 as discussed in the Users list: replace "Short Frame" by "Packet size limited during capture" message
svn path=/trunk/; revision=15855
2005-09-18 11:18:42 +00:00
Ulf Lamping 7cc57ec40c add to the protocol item a short description what a "Short Frame" is
svn path=/trunk/; revision=15786
2005-09-13 18:40:58 +00:00
Ulf Lamping de0d7959ca don't simply remove the expert_info output at BoundsError, but add the comment from Guy why this (usually) isn't a bug (because of a short snapshot length).
svn path=/trunk/; revision=15781
2005-09-13 08:03:16 +00:00
Guy Harris aba53424dd Move the definition of GNUC_FORMAT_CHECK() to its own header, use it in
column-utils.h, and add it to expert.h, so we check the arguments to
"expert_add_info_format()", at least if the format argument is a
constant string.

Fix some more calls to "expert_add_info_format()" to pass it a format
string.

Don't record BoundsError exceptions as expert events - they merely
reflect a capture done with a snapshot length too short to capture all
of the packet (any case where it's caused by something else is a bug).

svn path=/trunk/; revision=15776
2005-09-13 04:00:47 +00:00
Ulf Lamping 642467ad5c I'm adding the "Expert Info" prototype now, as it seems to be in a state where others might have a look and probably already find it useful :-). Anyway, we can easily disable it at one or two places in the code if it get's in our way of a new release.
Please see: http://wiki.ethereal.com/Development/ExpertInfo for a complete overview of the intended feature and it's current state of implementation.

While I'm working on this, I've also added some more status result codes to the DCE/RPC and DCOM dissectors.

svn path=/trunk/; revision=15754
2005-09-11 16:55:34 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris 84cf5472e9 If a dissector writer directly throws DissectorError, don't punish the
user by crashing due to a null pointer dereference, punish the dissector
writer by saying he or she didn't bother providing an explanation of the
error.

The exception message isn't a const string any more; make the
"exception_message" argument to "show_exception()" a "char *", not a
"const char *".

svn path=/trunk/; revision=15251
2005-08-06 21:38:43 +00:00
Guy Harris f618b54d36 Support throwing an exception with a null message pointer, and have the
message not be const (as we generate messages with "g_strdup_sprintf()",
which means they need to be freed; using a null message means that we
don't have to use a special string for exceptions with no message, and
don't have to worry about not freeing that).

Have THROW() throw an exception with a null message pointer.  (This
means that you crash if you throw DissectorError with THROW().  Don't do
that - it means you don't get a more detailed explanation of the
dissector problem.  Use the DISSECTOR_ASSERT, etc. macros in
epan/proto.h instead.)

Free the exception message for DissectorError, as it's mallocated.

svn path=/trunk/; revision=15250
2005-08-06 19:58:45 +00:00
Gerald Combs b992c73391 In packet-frame.c, don't free static memory when we throw a
DissectorError.  In packet-kerberos.c, restore pinfo->private_data if
we throw an exception, which keeps the SMB dissector from throwing
a DissectorError.  Initialize variables in other places to squelch
valgrind warnings.

svn path=/trunk/; revision=15235
2005-08-06 03:43:42 +00:00
Gilbert Ramirez c8cd8f21a4 Exception handling fixes, and a fix to packet-frame.c,
from Richard van der Hoff.

svn path=/trunk/; revision=15205
2005-08-04 13:54:46 +00:00
Ronnie Sahlberg d9826d34d5 add a dummy variable frame_number to dissect_frame() and assign it the current frame number so that the crashdump that buildbot generates will show which frame the problem occured in.
this is useful since some bugs only trigger ia crash on some platforms.
example   bug 255 which does not trigger a crash on linux redhat 7.1



svn path=/trunk/; revision=14727
2005-06-22 08:41:58 +00:00
Ulf Lamping 76778cc78b mark some fields as generated and clarify some field descriptions
svn path=/trunk/; revision=14517
2005-06-01 21:28:40 +00:00
Gerald Combs 861dc4e340 More bug fixes from Steve Grubb. See bug 217 for details.
svn path=/trunk/; revision=14496
2005-05-30 20:58:20 +00:00
Michael Tüxen 23d022349d - Add support for libpcap files for MTP2 with a per packet header
indicating the direction, narrowband/broadband, and interface number.
- Add support to display the direction and interface number.
- Add support to packet-mtp2.c to use the broadband/narrowband indication.

svn path=/trunk/; revision=14265
2005-05-02 14:07:33 +00:00
Ronnie Sahlberg 2bc81b2a48 Major speed improvement for filtering and dissection.
It should not dump core as far as all my tests are concerned and Menu_Statistics/ProtocolHierStats work

It needs more testing and there might still be cases where it will crash that will need to be fixed  but I feel it will be worth it since it will decrease the time to filter very large capture files dramatically.

Real significant performance boost for very large captures.


(If we cant fix all the problems we can just revert this patch)



svn path=/trunk/; revision=14051
2005-04-11 08:43:51 +00:00
Guy Harris 3060dc91b6 Squelch some compiler warnings.
svn path=/trunk/; revision=13133
2005-01-20 07:58:23 +00:00
Gerald Combs 561fbc8b25 Add a field called "frame.protocols" which shows the protocols present
in the frame.   The filter "frame.protocols contains ip:icmp:ip" could
be used to find any ICMP packets containing IP headers.

Clean up whitespace.

svn path=/trunk/; revision=13118
2005-01-19 04:49:29 +00:00
Guy Harris 2bdef3c122 Rename the FieldError exception to DissectorError.
Add a DISSECTOR_ASSERT() macro, which is the usual type of assertion
macro, but throws a DissectorError exception with a message giving the
flien and line number and the failed test as a string.  Use that macro
in "alloc_field_info()".

Report that exception in the Info column and the protocol tree, as well
as logging the exception failure with g_warning().

svn path=/trunk/; revision=13078
2005-01-16 23:30:55 +00:00
Ulf Lamping 1c9781b4ec throw the new FieldError exception, if a dissector tries to add a field with invalid parameters
add a message parameter to the show_exception function

svn path=/trunk/; revision=13074
2005-01-16 16:06:15 +00:00
Anders Broman d607cdb1e4 From LEGO if Mate is pressent call it.
svn path=/trunk/; revision=12615
2004-11-28 20:52:52 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00