Commit Graph

45 Commits

Author SHA1 Message Date
Tomas Kukosa a063a87af5 - "next tvb" list moved from h225 to new file next_tvb.[ch]
- h225 updated and regenerated
- restore calling subdissectors for SNMP variables which was broken with new SNMP

svn path=/trunk/; revision=18451
2006-06-13 13:21:12 +00:00
Anders Broman d17dad9ead Atempt to fix bug 967 crash on fuzzed SNMP capture. I can't reproduce the Bug.
svn path=/trunk/; revision=18216
2006-05-23 20:36:49 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Guy Harris aa4b59de6f Don't throw an exception in oid_to_subid_buf() if the generated OID is
zero-length - oid_to_subid_buf() can be called when we're not in the
middle of a dissection, and throwing a "dissector bug" assertion in that
case is itself a bug.

svn path=/trunk/; revision=18164
2006-05-15 17:58:39 +00:00
Anders Broman e49fe267e6 Remove stupid code.
svn path=/trunk/; revision=18148
2006-05-14 08:17:39 +00:00
Anders Broman 396a33dbee snmp: Hopfully fix bug Bug 925.
Add packet-ulp.c missing from last commit.

svn path=/trunk/; revision=18144
2006-05-13 22:18:08 +00:00
Anders Broman 9740278a1d Fix bug 926 OID wrongly decoded.
svn path=/trunk/; revision=18106
2006-05-08 17:30:24 +00:00
Anders Broman abbbc2c4da Use the asn2eth generated snmp dissector.
svn path=/trunk/; revision=18086
2006-05-03 19:09:03 +00:00
Ulf Lamping 297ed538fc mark parser error messages as Ethereal generated
svn path=/trunk/; revision=17593
2006-03-11 20:19:20 +00:00
Anders Broman b4d028c47e Fix:
Coverity CID19 Remove an uneccesarry line
CID20 Use the code from the asn2eth generated dissector while at it.

svn path=/trunk/; revision=17532
2006-03-08 18:56:13 +00:00
Ronnie Sahlberg 590d27a8c0 add new dissect_ber_integer64() that can handle 8,16,24,32 and 64bit integers.
use proto_tree_add_[u]int[8,16,24,32,64]() instread of proto_tree_add_item()
since BER integers may well be encoded in less bytes than the type requires.
(i do not think the old code with proto_tree_add_item() could have handleded negative values very well    or at all.)




svn path=/trunk/; revision=17425
2006-02-28 09:39:53 +00:00
Ronnie Sahlberg 8cf12717d5 make the old style SNMP dissector handle 64 bit integers better
fixes bug 723


svn path=/trunk/; revision=17369
2006-02-22 10:45:23 +00:00
Gerald Combs f816511ea9 In packet-cops.c use proto_item_append_text() instead of creating a
separate buffer.  Fixes the current Buildbot failure.

Don't let the sprint_realloc_* functions reallocate ep_allocated memory.
Add comments warning against this in the future.

In emem.c, make sure we don't use an extra 100k every stinkin' time
someone wants to allocate memory when debugging is enabled.

Fixup whitespace.

svn path=/trunk/; revision=17051
2006-01-18 20:02:19 +00:00
Jaap Keuter 055d695edc Fixes bug 679.
The offset wasn't passed to the PDU dissector so it always started dissection
from the start of the TVB.

svn path=/trunk/; revision=17020
2006-01-12 16:17:07 +00:00
Guy Harris 322999c545 Note that we should redo the handling of OIDs when
"dissect_ber_object_identifier()" can return the OID in a binary form.

svn path=/trunk/; revision=16036
2005-09-28 08:01:54 +00:00
Guy Harris ab2dca9114 Move some headers for stuff defined by a dissector into epan/dissectors
- and rename smb.h to packet-smb.h, as it's packet-smb.c's header file.

svn path=/trunk/; revision=15845
2005-09-17 00:31:15 +00:00
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Guy Harris b8ae3f1988 If we've enabled the display of BER encapsulation tokens, only put them
into the protocol tree once.

Fix the offsets and lengths used to put the variable binding values into
the protocol tree.

svn path=/trunk/; revision=15837
2005-09-16 09:47:18 +00:00
Anders Broman 6e979407ef Fix a warning.
svn path=/trunk/; revision=15801
2005-09-14 19:11:23 +00:00
Anders Broman 9a7de2ab43 Do the variable binding with dissect_ber_x() routines rather than asn1 ones.
svn path=/trunk/; revision=15798
2005-09-14 17:08:41 +00:00
Guy Harris 33d72d3b9d Fail somewhat gracefully if malloc() fails.
svn path=/trunk/; revision=15701
2005-09-06 17:43:22 +00:00
Gerald Combs efdef9c5aa For SNMP, malloc memory that we're going to free later. Fixes bug 406.
For RTP, don't free se_allocated memory.

svn path=/trunk/; revision=15694
2005-09-05 21:38:10 +00:00
Guy Harris 1d861e5f58 Use "free()", not "g_free()", to free strings allocated with "malloc()".
Don't free strings allocated with "ep_alloc()".

svn path=/trunk/; revision=15571
2005-08-27 18:22:53 +00:00
Guy Harris bd8c6df460 "sprint_realloc_objid()" expects to be handled a malloced buffer, so
hand it one (and check for malloc failures), and it returns a malloced
or realloced buffer, so free it when we're done.

That means that routines that use it can return/supply back a null
pointer, so check for that.

Don't ep_allocate fixed-length buffers for formatted OID information,
allocate one that's 'big enough".

svn path=/trunk/; revision=15524
2005-08-25 03:28:31 +00:00
Ronnie Sahlberg 4e088df2b4 no more g_malloc or sprintf in snmp
svn path=/trunk/; revision=15444
2005-08-19 22:44:56 +00:00
Ronnie Sahlberg d0408f5583 more gmalloc sprintf removals
svn path=/trunk/; revision=15443
2005-08-19 22:34:28 +00:00
Ronnie Sahlberg 68db27d05b remove two gmalloc and some sprintf
svn path=/trunk/; revision=15442
2005-08-19 22:26:10 +00:00
Gerald Combs 4d9c7cfa0d Flip the separators in the MIBS environment variable between ":" and
";" depending on our platform.  This is a modified version of a patch
that Jaap Keuter sent in.  Leave the preferences tooltip as-is in case
we want to be more strict about separators in the future.

Add a link to an email from Wes explaining that we shouldn't use a
default MIB list.

svn path=/trunk/; revision=15395
2005-08-17 22:27:15 +00:00
Jörg Mayer 69dcb66cd9 More char -> const char warning fixes
svn path=/trunk/; revision=15218
2005-08-05 00:23:22 +00:00
Luis Ontanon 7796905fd8 From Thomas Anders:
SNMP Engine ID dissection according to RFC3411


svn path=/trunk/; revision=15073
2005-07-25 23:33:44 +00:00
Guy Harris 554f620001 Constify to remove a bunch of warnings. Add some casts to squelch
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst
warnings.

In the TACACS dissector, clean up the variables used in option parsing
to avoid some const-to-nonconst warnings.

Clean up some white space.

svn path=/trunk/; revision=15043
2005-07-24 19:01:28 +00:00
Guy Harris ab797734dd Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have
"match_strval()" call it.

Make those routines, and "val_to_str()", return a "const" pointer. 
Update dissectors as necessary to squelch compiler warnings produced by
that.

Use "val_to_str()" rather than using "match_strval()" and then, if the
result is null, substituting a specific string.  Clean up some other
"match_strval()"/"val_to_str()" usages.

Add a null pointer check in the NDPS dissector's "attribute_value()"
routine, as it's not clear that "global_attribute_name" won't be null at
that point.

Make some global variables in the AFS4INT dissector local.

Make some routines not used outside the module they're in static.

Make some tables "static const".

Clean up white space.

Fix Gerald's address in some files.

svn path=/trunk/; revision=14786
2005-06-26 19:56:52 +00:00
Ulf Lamping fdb5b1af02 just to get things straight: a dissector should *never* do any g_assert() calls!
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED()

this will replace application crash by showing a dissector bug, which is the desired behaviour

there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too

one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain.

svn path=/trunk/; revision=14608
2005-06-10 18:28:22 +00:00
Ronnie Sahlberg fcab322ada Some applications do very naughty things like reusing a port for a different protocol during different stages of an application cycle.
This is very naughty and will cause problems when we have assigned a dissector to a dynamic port using conversation_set_dissector().


To make ethereal handle this case I have changed the try_conversation_dissector() to allow it to fail and return 0,   meaning   yes there is indeed a protocol registered for this conversation but that protocol rejected this packet.
(which only happens for "new" style dissectors, "old" style dissectors will never reject a packet that way)

When this happens  the decode_udp_port() helper will still allow other dissectors to be tried, in the hope that the conversation is now used for some other protocol and thus someone else might be able to decode the packet.


Update SNMP and TFTP dissectors to  check that even if there already is a conversation but that conversation does NOT have snmp/tftp registered as the dissector for it, then create a new conversation anyway and attach the proper dissector.

Since ethereal keeps track of which frame number a conversation started in, this actually works really well.



svn path=/trunk/; revision=14345
2005-05-11 10:40:53 +00:00
Ronnie Sahlberg 39e517a9b3 make SNMP over UDP a new style dissector and add some heuristics to check if this is SNMP or not,
svn path=/trunk/; revision=14339
2005-05-10 08:49:27 +00:00
Lars Roland ec9ca01616 Move the following files from /trunk to /trunk/epan:
asn1.[ch]
follow.[ch]
ptvcursor.[ch]
reassemble.[ch]
xmlstub.[ch]

fix #include statements accordingly.

svn path=/trunk/; revision=13366
2005-02-09 23:38:00 +00:00
Anders Broman 851ecd2ac4 From Jon Ringle:
1) Added a setup_frame parameter to conversation_t
2) Used the conversation_t next to maintain a list of conversations with the 
same src/dest tuple but different setup_frame number.
3) Changed the signature of find_conversation() and conversation_new() to pass 
in the frame number.
4) Adjusted packet-sdp to select RTP conversation if both m=audio and m=image 
are present, and T.38 conversation if only m=image is present. I expect that 
RTP/T.38 dissecting to be better, but I don't have a way to generate T.38 
packets.

svn path=/trunk/; revision=13243
2005-02-02 20:07:03 +00:00
Gerald Combs 3bbde0ecd2 The standard environment separator character under Windows is ";".
Net-SNMP expects this in the MIBS environment variable, so don't use
":" in the default MIB list if we're running under Windows.

svn path=/trunk/; revision=12681
2004-12-07 21:06:55 +00:00
Gerald Combs a0ad7be1d1 The recent length check added to proto_tree_add_string() revealed a
couple of problems when reading the PROTOS SNMP captures.  Check for
integer overflows in dissect_snmp_pdu and asn1_null_decode.

svn path=/trunk/; revision=12609
2004-11-28 04:21:30 +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
Guy Harris b39caf4b49 From Tomas Kukosa:
- pass only value (not tag and length) to subdissectors from the
	  snmp.variable_oid table
	- register the SNMP dissector

svn path=/trunk/; revision=12093
2004-09-25 07:41:58 +00:00
Guy Harris f23f4ecf04 Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;
according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is.

svn path=/trunk/; revision=11972
2004-09-11 23:03:36 +00:00
Ulf Lamping d530bd4e14 Prevent the word "desegmentation" at the GUI, but use reassembling at that places, as we also use "defragmentation" and "reassembling". Use reassembling as the general term for such actions.
I (hopefully) didn't changed any protocol fields or preference file names, but only the GUI labels appearing in the protocol display and the protocol preferences.

Also added a note to the protocol preferences (where appropriate), that you have to enable "Allow subdissectors to reassemble TCP streams" at the corresponding protocol settings for TCP reassembling to take effect.

If you encounter any mistakes I've made here, please let me know...

svn path=/trunk/; revision=11784
2004-08-21 09:02:52 +00:00
Guy Harris f4c650946b From Tomas Kukosa: add a dissector table for OIDs in variable bindings,
so the variable value can be dissected by a subdissector.

svn path=/trunk/; revision=11717
2004-08-11 19:11:16 +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