Commit Graph

59 Commits

Author SHA1 Message Date
Gerald Combs 180852ed7c From Mark Cave-Ayland: Fix a crash in the PCNFSD dissector.
From me: Apply Mark's fix to the ident string. Add public #defines for
the special strings that dissect_rpc_* might return and use them in
PCNFSD.  Replace a manual buffer allocation with ep_strdup_printf.

svn path=/trunk/; revision=28128
2009-04-22 17:42:47 +00:00
Gerald Combs 4403f89243 More size_t fixes.
svn path=/trunk/; revision=27976
2009-04-06 19:30:48 +00:00
Gerald Combs 6d04f793f0 Back out r27047 and r27053.
svn path=/trunk/; revision=27062
2008-12-19 17:39:52 +00:00
Gerald Combs fc71188963 Update calls to proto_tree_add_bytes_format to reflect r27047.
svn path=/trunk/; revision=27053
2008-12-18 20:19:49 +00:00
Bill Meier 97e7747d42 Small cleanup of proto_reg_handoff & etc
- 'once-only' not req'd in some cases
- use find_dissector as appropriate
- remove unneeded code

svn path=/trunk/; revision=26284
2008-09-27 13:38:59 +00:00
Bill Meier afd857957a Fix a few Emacs "file variables" to have "safe" values.
That is: indent-tabs-mode: tabs --> indent-tabs-mode: t
Also: fix a typo: set-tabs-mode --> indent-tabs-mode

svn path=/trunk/; revision=26113
2008-09-02 11:17:03 +00:00
Bill Meier 38eb4d6ce3 Use const with value_string array definitions
svn path=/trunk/; revision=26028
2008-08-14 23:51:52 +00:00
Jeff Morriss 6946f1878f From https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2723
Tigran Mkrtchyan: decode and display fattr4_fs_layout_types.

Thijs Stuurman: Synchronize names used by wireshark with those used in
latest pnfs draft.

J. Bruce Fields: Use large default max_rpc_tcp_pdu_size setting
The linux server will do up to 1M these days, so the current default is
very likely to discard all reads and writes from such a server.
Thanks to Jim Rees for catching this.

Jeff Morriss: limit the max_rpc_tcp_pdu_size increase to 4M instead of the 16M
proposed.  Memory is cheap but still not unlimited.

svn path=/trunk/; revision=25769
2008-07-19 20:17:42 +00:00
Sake Blok 1984f23e28 Fix for the "Malformed packet: RPC" that is encountered in bug 1392:
Don't call a RPC subdissector if there is no more data in the packet.


svn path=/trunk/; revision=25058
2008-04-15 22:53:34 +00:00
Sake Blok 3751e74f67 From Didier (bug 1392):
Add port to conversation key so that RPC reassembly works when relative
sequence numbers are used.


svn path=/trunk/; revision=25055
2008-04-15 21:12:38 +00:00
Jeff Morriss bb323055b2 match_strval() may return NULL so don't blindly pass its return value into col_add_*() or proto_add_*(); use val_to_str() (returning "Unknown (%d)" if no match is found) instead.
svn path=/trunk/; revision=24557
2008-03-04 21:05:21 +00:00
Ronnie Sahlberg d55f6955d6 the GSS Checksum in secure onc-rpc contains the same blobs as GSS Tokens
does.

make wireshark decode these blobs


svn path=/trunk/; revision=23759
2007-12-05 08:37:51 +00:00
Gerald Combs 13a01fef37 Add a bounds check in order to try to fix bug #1998.
svn path=/trunk/; revision=23517
2007-11-20 19:17:19 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Guy Harris d83b345266 Fix indentation.
svn path=/trunk/; revision=22112
2007-06-15 23:07:10 +00:00
Guy Harris 1d73cea470 Add a header that redefines g_array_index() to throw in a "void *" cast
to work around the "data" field of a GArray being a guint8 *, and
defines a g_array_data() macro to extract that field and cast it to void
*.

Use that header where needed.

svn path=/trunk/; revision=21627
2007-04-30 19:24:25 +00:00
Ronnie Sahlberg b0ecf3f745 From: Burlyga, Alex
Hi,

Attached is a patch for packet-rpc.c and packet-rpc.h.
Update support for pseudo-flavors that used in RPCSEC_GSS
Also fixed a problem where rpc.reqframe and rpc.repframe where
reversed.

Alex.




svn path=/trunk/; revision=19946
2006-11-21 08:53:11 +00:00
Guy Harris 3f7a918917 If the length of a GSS token is zero, it's a null token, and the opaque
data shouldn't be dissected.

svn path=/trunk/; revision=19027
2006-08-25 08:10:35 +00:00
Ronnie Sahlberg 3d5a81b7e9 remove two hashtables and replace with binary trees
svn path=/trunk/; revision=18971
2006-08-21 12:41:59 +00:00
Gerald Combs 8b315480f1 In new_format_oid(), handle a zero-length OID.
Fix a bug introduced recently in packet-rpc.c.

Replace DISSECTOR_ASSERT() with THROW(ReportedBoundsError) in my recent 
checkins, since fuzz-test.sh sets WIRESHARK_ABORT_ON_DISSECTOR_BUG.

svn path=/trunk/; revision=18693
2006-07-09 22:12:02 +00:00
Gerald Combs 545236879f Fix more bugs reported by Ilja van Sprundel.
packet-pktc.c:
  Catch an underflow.

packet-ospf.c:
  Don't burn CPU cycles unnecessarily.

packet-rpc.c:
  Catch an overflow.

packet-mq.c:
  Check a header size.

Fix up whitespace.

svn path=/trunk/; revision=18685
2006-07-07 22:39:23 +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
Ronnie Sahlberg f331077a60 waste a couple of bytes per tcp conversation and make the tree for acked_packets (i.e. packets that have interesting tcp properties such as being retransmissions etc) hang off the per conversation tcpd struct instead of being global.
while this should improve performance by unmeasurably little it does have the sideeffect that once we finish the rewrite   tcp analysis might actually work and work well even for tcp over tcp tunnelling. 

this also means that if you include packet-tcp.h   you also need to include emem.h .




svn path=/trunk/; revision=17681
2006-03-20 10:52:53 +00:00
Ronnie Sahlberg 6cdabceaca coverity #40
fix null dereference 

svn path=/trunk/; revision=17546
2006-03-09 11:44:56 +00:00
Ronnie Sahlberg 07c2845fe7 get rid of another slow hashtable and one global variable and
replace it with a better and memleak free se_tree



svn path=/trunk/; revision=17480
2006-03-06 14:30:34 +00:00
Ronnie Sahlberg b47ccd7bb9 mark a few generated fields as generated using PROTO_ITEM_SET_GENERATED
svn path=/trunk/; revision=17426
2006-02-28 10:10:08 +00:00
Gerald Combs 93b99abf30 In packet-dcerpc-nt.c, make sure we call init_pol_hash() each time we load
a capture file.  This should fix bug #536.

Make sure we initialize our hash tables in packet-dcerpc-nt.c and several 
other files.  Fix up whitespace while we're at it.

svn path=/trunk/; revision=16255
2005-10-17 18:56:27 +00:00
Gerald Combs cf7474a92e Fix up a length check.
svn path=/trunk/; revision=16245
2005-10-16 14:23:56 +00:00
Ronnie Sahlberg 24cc5e865a get rid of one strcpy() and one strcat()
svn path=/trunk/; revision=16227
2005-10-15 22:36:59 +00:00
Ulf Lamping 9a42ef9536 fix #480: Change defaults for all reassembling settings to ON
I've changed all settings I could find to TRUE. It might be reasonable to change some protocol settings back to FALSE, if reassembling fails very often.

svn path=/trunk/; revision=16048
2005-09-28 22:15:38 +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
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
Ronnie Sahlberg 0fa345fe6c remove sprintf from rpc
svn path=/trunk/; revision=15448
2005-08-20 00:27:46 +00:00
Jörg Mayer 956eee946f Some 'no previous declararion' warning fixes
svn path=/trunk/; revision=15355
2005-08-14 23:25:20 +00:00
Guy Harris 79dcb408d3 Properly terminate the string generated for string items.
Use "format_text()" to handle non-printable characters in the display
string for those items.

svn path=/trunk/; revision=15342
2005-08-13 22:08:22 +00:00
Ronnie Sahlberg c30eeef7d8 some more gmemchunk -> se_alloc() updates
there are only 5 gmemchunks left   but they have different litetime for their allocations   than the 100+   ones that have been removed.

The remaining 5 should be converted some other way.




svn path=/trunk/; revision=15328
2005-08-13 01:29:31 +00:00
Ronnie Sahlberg 030981ff55 We use heuristics to detect what MIGHT be onc-rpc packets.
as heuristics they are not 100% perfect, else they would not be heuristics.


IF the preference option "Dissect unknown RPC program numbers" are enabled,
add a sanity check to see that program_version is <=10
  (no one uses versions >10 ?)
to avoid trying to add 2 bilion different versions to the program->version linked list
in case we mistook the packet for ONC-RPC and the "version" field contains a huge random number.


This bug would only trigger a hang/crash IFF the option above is enabled.


svn path=/trunk/; revision=15290
2005-08-11 09:20:23 +00:00
Ronnie Sahlberg ec3ab9ec3e rename ep_tvb_get_string() to tvb_get_ephemeral_string() asnd update the documentation in README.developer
svn path=/trunk/; revision=15270
2005-08-10 13:41:13 +00:00
Ronnie Sahlberg f3f2f6312b From
Eric Wedel

Add a preference to RPC (default off) that will heuristically attempt to find
PDUs starting in the middle of a segment.



svn path=/trunk/; revision=15260
2005-08-08 09:52:59 +00:00
Ronnie Sahlberg 7bca1d5ef6 ememify packet-rpc call to tvb_get_string()
svn path=/trunk/; revision=15196
2005-08-02 17:24:26 +00:00
Guy Harris 70fb017866 Constify some variables, functions, and structure members to squelch
compiler warnings.

svn path=/trunk/; revision=15138
2005-07-29 03:49:23 +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
Ronnie Sahlberg 01206d0bd4 recode tvb_memdup() into more efficient emem fucntions.
Now that we dont have to  free() the memory explicitely we got rid of a few unnessecary g_strdup() as well.



svn path=/trunk/; revision=15003
2005-07-22 23:33:12 +00:00
Guy Harris 9cb86fda9c Squelch various signed vs. unsigned warnings by:
making pointers to byte data be "guint8 *" rather than "char *",
	and making buffers holding byte data arrays of "guint8" rather
	than arrays of "char";

	making pointers to text strings "char *" rather than "guchar *";

	appropriately casting pointers (cast to "guint8 *" when passing
	to routines expecting "guint8 *" or when assigning to "guint8
	*");

	making port-number preferences "guint";

	making enum preferences "gint";

	making hf_ variables "int".

Clean up white space.

svn path=/trunk/; revision=14884
2005-07-09 00:53:17 +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
Ulf Lamping e2c3b60280 add a generated toplevel line between the TCP protocol and the desegmented content, to better understand what's going on while desegmenting.
We'll have to add similar mechanisms for other protocols as well...

svn path=/trunk/; revision=14527
2005-06-02 18:52:55 +00:00
Uwe Girlich c1c395dc2d Added RPC/ONC SYSTEM_ERROR accept state.
svn path=/trunk/; revision=14303
2005-05-04 13:09:46 +00:00
Gerald Combs 53865bb046 Don't try to access a null pointer. Found during fuzz testing.
svn path=/trunk/; revision=14186
2005-04-25 16:54:18 +00:00