Commit Graph

85 Commits

Author SHA1 Message Date
Guy Harris eb5031e9df Handle Negotiate Protocol replies with the "extended security"
capability flag set.

svn path=/trunk/; revision=3579
2001-06-20 01:58:48 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris 4d99343d8b Fix a typo.
svn path=/trunk/; revision=3518
2001-06-05 23:40:34 +00:00
Guy Harris eee7f58e2d Fix up a cast so that it properly sign-extends the server time zone;
from Joerg Mayer.

svn path=/trunk/; revision=3427
2001-05-20 22:26:14 +00:00
Guy Harris 2c109432a2 Put in a note about the use of some currently-undissected fields in the
SMB header, as per a Microsoft document.

svn path=/trunk/; revision=3149
2001-03-20 04:46:37 +00:00
Guy Harris b8289288e8 Correctly handle Interim responses to TRANSACTION requests.
Move the declaration of routines exported from "packet-smb-mailslot.c"
into a "packet-smb-mailslot.h" header file, and have modules that import
those routines include "packet-smb-mailslot.h" rather than declaring the
routines themselves; do the same for routines exported from
"packet-smb-pipe.c".  Make routines not exported static, and make
routines that return a true/false return value "gboolean" rather than
"guint32".

svn path=/trunk/; revision=3146
2001-03-18 03:23:30 +00:00
Richard Sharpe 82d18e3d1a Added a new error code I just found ... no such share.
svn path=/trunk/; revision=2956
2001-01-29 08:14:42 +00:00
Gilbert Ramirez 5b7f184296 Ensure that all value_string arrays end in {0, NULL}. Dissectors got away
with not terminating their arrays because they knew the limits of the
value used to look up strings in the value_string array, but the
dfilter_expr_dlg does not know these limits and must rely on the terminating
{0, NULL} record.

Also, in SNA fixed a bug in which a field should have been defined as FT_UINT8
but was defined as FT_BOOLEAN.

In WTP, fixed a value string which had duplicate keys.

svn path=/trunk/; revision=2817
2001-01-03 16:41:08 +00:00
Guy Harris 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
protocols, in addition to adding structures to the list of filterable
fields.  Give it an extra argument that specifies a "short name" for the
protocol, for use in such places as

	pinfo->current_proto;

	the dialog box for constructing filters;

	the preferences tab for the protocol;

and so on (although we're not yet using it in all those places).

Make the preference name that appears in the preferences file and the
command line for the DIAMETER protocol "diameter", not "Diameter"; the
convention is that the name in question be all-lower-case.

Make some routines and variables that aren't exported static.

Update a comment in the ICP dissector to make it clear that the
dissector won't see fragments other than the first fragment of a
fragmented datagram.

svn path=/trunk/; revision=2810
2001-01-03 06:56:03 +00:00
Richard Sharpe 8c47761ae4 Patches to prevent problems under Windows when time formats are negative.
Make sure that if _gtime is null, a bad format message returned.

Also noticed that I am going to have to do something about Unicode strings soon and the SMBopenX dissect is slightly wrong ... Oh well, it is the Xmas break soon :-) No rest for the Wicca'd (please don't interpret that as a statement of my religious affiliation, it is just a cute saying :-)

svn path=/trunk/; revision=2764
2000-12-17 03:48:44 +00:00
Richard Sharpe 07f065e61a Apply Jeroen Ruigrok van der Werven's patches ...
svn path=/trunk/; revision=2699
2000-11-22 21:19:38 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 563f86ee5e Support for conversations with "wildcard" destination addresses, from
Jeff Foster.

svn path=/trunk/; revision=2523
2000-10-21 05:52:28 +00:00
Gilbert Ramirez 9941aabd64 Move format_text(), get_token_len(), and fine_line_end(), into strutil.c
This keeps tvbuff.c generic; it doesn't have to pull in packet.h and all
of it's included files.

svn path=/trunk/; revision=2409
2000-09-11 16:16:13 +00:00
Laurent Deniel cc36f0b931 Add the "Edit:Protocols..." feature which currently only implements
the following:

It is now possible to enable/disable a particular protocol decoding
(i.e. the protocol dissector is void or not). When a protocol
is disabled, it is displayed as Data and of course, all linked
sub-protocols are disabled as well.

Disabling a protocol could be interesting:

- in case of buggy dissectors
- in case of wrong heuristics
- for performance reasons
- to decode the data as another protocol (TODO)

Currently (if I am not wrong), all dissectors but NFS can be disabled
(and dissectors that do not register protocols :-)

I do not like the way the RPC sub-dissectors are disabled (in the
sub-dissectors) since this could be done in the RPC dissector itself,
knowing the sub-protocol hfinfo entry (this is why, I've not modified
the NFS one yet).

Two functions are added in proto.c :

gboolean proto_is_protocol_enabled(int n);
void proto_set_decoding(int n, gboolean enabled);

and two MACROs which can be used in dissectors:

OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree)
CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree)

See also the XXX in proto_dlg.c and proto.c around the new functions.

svn path=/trunk/; revision=2267
2000-08-13 14:09:15 +00:00
Richard Sharpe 73e093e7e7 A small set of patches to fix one small problem and start working on the
filtering in packet-smb.c ...

svn path=/trunk/; revision=2220
2000-08-07 14:49:03 +00:00
Richard Sharpe 3d80db01df A small change to SMB dissector so it lists near the other SMB-related
dissectors when you do 'ethereal -G' ...

svn path=/trunk/; revision=2180
2000-07-30 14:35:39 +00:00
Guy Harris 283ce59938 Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of
the "proto_tree_add_XXX_format()" routines.

Replace most calls to "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" with calls to those routines.

Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to
"proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and
add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()"
routines that don't take the item to be added as an argument - instead,
they fetch the argument from the packet whose tvbuff was handed to them,
from the offset handed to them.

svn path=/trunk/; revision=2031
2000-05-31 05:09:07 +00:00
Guy Harris f90bbf2a5a Assorted enhancements from Mark Burton.
svn path=/trunk/; revision=2000
2000-05-25 08:38:54 +00:00
Guy Harris f937a5d86f Assorted padding fixes from Mark Burton.
svn path=/trunk/; revision=1999
2000-05-25 08:32:13 +00:00
Gilbert Ramirez 292e38e2c6 Add tvbuff class.
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.

dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.

The FDDI dissector is converted to use tvbuff's.

svn path=/trunk/; revision=1939
2000-05-11 08:18:09 +00:00
Guy Harris 9bd27d3471 Andreas Sikkema's patch to make the SMB dissector not blithely pass a
null "request_val->last_transact_command" to "col_add_fstr()".

svn path=/trunk/; revision=1738
2000-03-21 10:15:50 +00:00
Gilbert Ramirez e29f2705bf Change dfilter_init() to check for empty-string abbreviations and for
duplicate abbreviations. All mods to packet-*.c files are fixes to remove
those cases.

svn path=/trunk/; revision=1733
2000-03-20 22:52:48 +00:00
Guy Harris 8c200212c7 Fix some "proto_tree_add_text()" calls.
svn path=/trunk/; revision=1695
2000-03-06 20:04:53 +00:00
Guy Harris 12df8af4e3 Jeff Foster's SMB Mailslot and Netlogin dissectors; he split
"packet-smb.c" up into several files.

svn path=/trunk/; revision=1629
2000-02-14 04:02:21 +00:00
Guy Harris 5b5f2271cd "tm_mon" in a "struct tm" is 0-based, not 1-based; when printing the
month number, add 1 to "tm_mon".

svn path=/trunk/; revision=1519
2000-01-22 02:00:27 +00:00
Guy Harris 7a943b7810 Fix Gerald's e-mail address.
svn path=/trunk/; revision=1437
2000-01-07 22:05:43 +00:00
Gilbert Ramirez 90293644a3 Don't take strlen of TransactName if NULL. In fact, don't do *anything*
and return if TransactName == NULL.

svn path=/trunk/; revision=1431
2000-01-07 04:27:06 +00:00
Guy Harris c8716decab Patch from Greg Kilfoyle of Redback Networks:
Don't use a global variable named "gmtime" - some versions of
	NetBSD define it in <time.h> - use "_gmtime" instead, so we can
	build on those NetBSD systems.

svn path=/trunk/; revision=1375
1999-12-23 20:47:16 +00:00
Richard Sharpe bcc9362c47 Latest patches for SMB decodes ... This fixes the bug in large NetServerEnum2
responses and adds some more stuff.


I will have to decode NTcreateAndX requests and responses soon as well
as the MSRPC stuff ...

svn path=/trunk/; revision=1356
1999-12-18 13:39:03 +00:00
Richard Sharpe f65a512676 More patches for packet-smb.c ...
Now should be decoding the names of lots more LanMan API request. These
were culled from Samba.  Would be good to go through and give names to the
fields as well.

Will soon decode the response structures returned and then will look at
ways to specify that built-in routines should be called to decode an element.

I also need some captures with UNICODE in them. Anyone got any? Someone
sent in a patch for UNICODE handling, but I did not realize what it was and
now the code has diverged so far it is hard to apply the patch ...

Send captures to rsharpe@ns.aus.com./

svn path=/trunk/; revision=1334
1999-12-14 23:16:59 +00:00
Richard Sharpe 3216e87029 Fixed up the problems with compilation warnings, as per some patched
from Guy, plus a few more of my own.

Also added in basic response decoding where we don't know what it is ...

Got more to do, as well as decoding returned data ... Thinking about that
now, and will have a data-drived approach.

I need some way to specify that an internal routine be called for some types
of data where we know what type it is, in the case of Server Types for
example ...

svn path=/trunk/; revision=1294
1999-12-12 02:19:00 +00:00
Olivier Abad a55ed83646 Fixed a typo (tee instead of tree) in dissect_transact_next
svn path=/trunk/; revision=1284
1999-12-10 12:51:01 +00:00
Richard Sharpe df0decde2f Beginning to handle LANMAN in a data-driven way, with tables etc.
Next will handle responses, and data returned ...

svn path=/trunk/; revision=1283
1999-12-10 11:53:18 +00:00
Richard Sharpe bbc7e6afbc Here I am commit'ing again in a Qantas Club lounge :-)
Fixed up some bugs to do with NetShareEnum.  There is still a persistent bug
left that looks like an alignment problem. Damn documentation does not talk
about the need to align the response structures for a NetServerEnum2 on SHORT
boundaries, but it sure looks like they should be so.

svn path=/trunk/; revision=1235
1999-12-07 06:36:12 +00:00
Richard Sharpe 7a41e5568f Some small fixes to the smb decoding of sessionsetup&X.
Will have to do some more soon.

svn path=/trunk/; revision=1216
1999-12-05 08:22:22 +00:00
Gilbert Ramirez de6c24bdb6 Check sanity of EntCount in lanman decode before going off and
marking 26 * EntCount bytes as Server entries.

svn path=/trunk/; revision=1160
1999-11-30 03:46:46 +00:00
Richard Sharpe b09955d91d Fixed the problem of crashing when a NetServerEnum2 with Level 0 is
seen.

svn path=/trunk/; revision=1122
1999-11-27 02:17:49 +00:00
Richard Sharpe 7d7b0fbdbd Fixed the problem causing a SIGSEGV, and fixed problems with
UNICODE strings in transact SMBs.

Added decode of NetShareEnum transact request.  Will have to clean that all
up and use the decode engine when I get it done.

Still more fix ups to be done, but the book is calling, and I have to write
some stuff after an interview with LinuxCare.

svn path=/trunk/; revision=1113
1999-11-26 06:27:22 +00:00
Richard Sharpe a90cb04447 Some more fixups. Decode NetServerEnum2 responses, removed those
ugly wannings, and added start of general params decode.  May all change
drastically though.

svn path=/trunk/; revision=1093
1999-11-22 10:30:22 +00:00
Laurent Deniel eb65d4fdb9 Remove debugging printf.
svn path=/trunk/; revision=1082
1999-11-21 11:17:13 +00:00
Richard Sharpe 139cfdccda Added support or NetServerEnum2 LANMAN messages.
I still have compile warnings, but I am too tired to chase them down.

Have also fixed a number of problems.

Next thing to add is a general engine that can decode Transact messages
as they can be decode from the descriptors in the Parameters area, and I
can feed in a list of names where we know what a structure looks like,
otherwise we use made up names.

svn path=/trunk/; revision=1079
1999-11-20 13:48:26 +00:00
Richard Sharpe 71fb29b83d Added decode of the Election Criteria and a few other bits of
info.

Still need someone to look at the times I have in there ... Guy?

svn path=/trunk/; revision=1055
1999-11-18 07:32:46 +00:00
Guy Harris 781acb5043 Craig Rodrigues' fixes to let it compile on AIX using IBM's compiler
(remove commas following the last member of an enum, make all bit fields
"guint32" - GCC lets you get away with that, but at least some other
compilers don't).

svn path=/trunk/; revision=1052
1999-11-18 01:45:05 +00:00
Guy Harris 4fddc1f328 Provide a general mechanism by which dissectors can register "init"
routines, which are called before a dissection pass is made over all the
packets in a capture - the "init" routine would clear out any state
information that needs to be initialized before such a dissection pass.

Make the NCP, SMB, AFS, and ONC RPC dissectors register their "init"
routines with that mechanism, have the code that reads in a capture file
call the routine that calls all registered "init" routines rather than
calling a wired-in set of "init" routines, and also have the code that
runs a filtering or colorizing pass over all the packets call that
routine, as a filtering or colorizing pass is a dissection pass.

Have the ONC RPC "init" routine zero out the table of RPC calls, so that
it completely erases any state from the previous dissection pass (so
that, for example, if you run a filtering pass, it doesn't mark any
non-duplicate packets as duplicates because it remembers them from the
previous pass).

svn path=/trunk/; revision=1050
1999-11-17 21:58:33 +00:00
Gilbert Ramirez 36eabe2100 We should be checking the value of loc_of_slash instead of index. It
might be NULL from strchr().

svn path=/trunk/; revision=1044
1999-11-16 17:03:36 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by
"proto_register_subtree_array()"; this:

	obviates the need to update "packet.h" whenever you add a new
	subtree type - you only have to add a call to
	"proto_register_subtree_array()" to a "register" routine and an
	array of pointers to "ett_", if they're not already there, and
	add a pointer to the new "ett_" variable to the array, if they
	are there;

	would allow run-time-loaded dissectors to allocate subtree types
	when they're loaded.

svn path=/trunk/; revision=1043
1999-11-16 11:44:20 +00:00
Richard Sharpe e351b687e4 I hope no one just committed something on this.
There was a core dump because of a coding oversight.  Should be fixed
now Gilbert.

Should now handle names of form \<somepipe>

Will screw up if there is no leading slash, but in a non-fatal way, I
think.

svn path=/trunk/; revision=1041
1999-11-16 07:58:12 +00:00
Richard Sharpe cfdb8fdc2c OK,
much more complete decoding of browse messages.

They are now shown in the parent tree as well.

I still have problems with:

  1. Times
  2. Election criteral

I also haven't been able to see a BecomeBackup request, nor a
GetBackupListResp with more than one browser ... Should run a Windows NT
server or another Samba on my network.

I am also not sure of there are any more message types.  Damn! Old, and
wrong MS documents!

svn path=/trunk/; revision=1025
1999-11-14 06:54:42 +00:00
Richard Sharpe baadd1b3d7 Fixed some more small problems and added support for decoding
MS Windows Browser messages.  Can decode host announcements now.

Still need to decode more.  Also need to break the new code out.


I also have the Browse tree at the wrong location.  Can I get at the
parent of the tree somewhere, or do I have to pass it in as a variable?

svn path=/trunk/; revision=1024
1999-11-14 02:42:03 +00:00