Commit Graph

42 Commits

Author SHA1 Message Date
Guy Harris 9758b3928d "conversation_new()" takes flags NO_ADDR2 and NO_PORT2, not NO_ADDR_B
and NO_PORT_B - the corresponding flags have the same values, but they
don't have the same semantics (a "find_conversation()" call with a
missing address or port B will do a wildcard match on *both* addresses
or ports, not just the second one).

svn path=/trunk/; revision=9604
2004-01-09 00:56:04 +00:00
Ronnie Sahlberg 422596a0fe Updated all remaining ONC-RPC dissectors to pass the procedure name value_string in the call to prc_init_proc_table()
svn path=/trunk/; revision=6528
2002-11-01 00:48:39 +00:00
Guy Harris d5f34ad8b2 Add an extra argument to "rpc_init_proc_table()" that can specify an hf_
value for a field to be used for the procedure number for that version
of the protocol; use that field, if specified, instead of just putting
in a generic "rpc.procedure" field.

Have the ypserv dissector register those fields and supply them to
"rpc_init_proc_table()".  Supply -1 for other RPC programs (for now),
meaning "no such field exists".

svn path=/trunk/; revision=6486
2002-10-23 21:17:03 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris c709d10b6f Use a name, not a number, to refer to the IP protocol number for UDP.
svn path=/trunk/; revision=5444
2002-05-11 18:52:55 +00:00
Ronnie Sahlberg 9625720a39 Added parsing of PORTMAP GETPORT functions.
When we see PRTOMAP GETPORT calls for UDP, make sure all further UDP packets to  or from
this port goes to the ONC-RPC dissector regardless of the port on the other side.

We need this because if there is ONC-RPC traffic going between the ONC-RPC Program port to a port which has a normal ethereal dissector, ethereal would dissect the traffic as the protocol associated with the other port instead.

svn path=/trunk/; revision=5430
2002-05-09 12:10:06 +00:00
Guy Harris db31932941 From Joerg Mayer:
Declares some variables static.

	Creates a new include file packet-rsvp.h, and make use of it
	(change some extern decls to #inlcude).

	Move the file packet-pgm.h into packet-pgm.c as it is not used
	by anything outside packet-pgm.c.

svn path=/trunk/; revision=5162
2002-04-14 23:04:04 +00:00
Uwe Girlich 2ca7ff7848 Removed many senseless pinfo parameters in RPC dissection and the layers above.
svn path=/trunk/; revision=5090
2002-04-03 13:24:13 +00:00
Guy Harris 92915713d3 Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff".  This can be used if

	1) the item covers the entire packet or the remaining payload in
	   the packet

or

	2) the item's length won't be known until it's dissected, and
	   will be then set with "proto_item_set_len()" - if an
	   exception is thrown in the dissection, it means the item ran
	   *past* the end of the tvbuff, so saying it runs to the end of
	   the tvbuff is reasonable.

Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).

In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).

Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.

Fix some indentation.

svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +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 abd9fc125f There are no more old-style (non-tvbuffified) ONC RPC dissectors, so get
rid of support for them, and remove the "_tvb" from the end of the names
of RPC type dissection routines.

Update Gerald's e-mail address.

svn path=/trunk/; revision=3477
2001-05-30 06:01:02 +00:00
Guy Harris c5aaac7823 Move the declaration of "ipprotostr()" out of "epan/packet.h" into a new
"ipproto.h" header file.

svn path=/trunk/; revision=3313
2001-04-17 06:29:14 +00:00
Guy Harris ea037e9084 For indirect RPC calls, remember the call information, and add a
dissector for indirect replies that looks up the call.  Use them in the
portmapper/RPCBIND dissector.

svn path=/trunk/; revision=3008
2001-02-09 07:59:00 +00:00
Guy Harris f190eff056 Make a "dissect_rpc_indir_call()" routine to dissect arguments to a
specified program/version/procedure, and a "rpc_proc_name()" routine to
return the name of a specified program/version/procedure, and make the
callit dissector use those, rather than doing the work itself.

Un-export various routines and declarations that can again be private to
the RPC dissector.

svn path=/trunk/; revision=3007
2001-02-09 06:49:29 +00:00
Guy Harris 967e079bfb Add support for dissecting V3 CALLIT and V4 BCAST/INDIRECT calls.
svn path=/trunk/; revision=2995
2001-02-06 06:56:19 +00:00
Guy Harris d9ee8bec53 Tvbuffify the portmap/rpcbind dissector, and implement part of CALLIT
dissection (dissection of V2 CALLIT calls; no V3/V4 stuff or reply
handling yet).

svn path=/trunk/; revision=2994
2001-02-06 06:46:10 +00:00
Guy Harris b2ae96ed4d Allow dissectors of ONC RPC-based protocols to register themselves
either with a table of old-style dissectors or a table of tvbuffified
dissectors, and have the RPC dissector pass the appropriate arguments to
the dissectors.

Finish tvbuffifying the NLM dissector, getting rid of the last traces of
old-style dissector code.

In those routines in the NFS dissector that take new-style arguments
(because they're called from the NLM dissector), make them take an
offset as an argument, so they don't assume that they're handed a tvbuff
starting at the stuff they're supposed to dissect, and make the versions
that take old-style arguments construct a tvbuff and call the versions
that take new-style arguments.  Do the latter with the routines in
"packet-rpc.c" as well.

svn path=/trunk/; revision=2943
2001-01-28 03:39:48 +00:00
Guy Harris 3af3df01da Put in comments explaining what the two "Universal Address" fields are;
we might want to give them different blurbs at some point (the
filter-expression construction dialog currently shows both of them as
just "Universal Address"; it'd have to somehow use the blurb if we
wanted to make it obvious what they are).

svn path=/trunk/; revision=2930
2001-01-22 07:19:38 +00:00
Guy Harris 8c14ddcd0f Fix comments to reflect what a null function pointer in a "vsff" table
really means.

Make the "XXX_proc" arrays static.

svn path=/trunk/; revision=2920
2001-01-18 09:55:10 +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
Guy Harris 2cbf5c4a15 Give the RFC number of the spec for the portmapper/rpcbind protocols.
svn path=/trunk/; revision=2367
2000-08-24 23:16:16 +00:00
Uwe Girlich c6097bf684 Reversed the latest changes for protocol enable/disable in RPC sub-dissectors.
The RPC layer itself handles all this stuff.

svn path=/trunk/; revision=2271
2000-08-14 11:36:04 +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
Guy Harris 5592101b43 Use "dissect_rpc_list()" to dissect NFS READDIR/READDIRPLUS reply lists
and portmapper DUMP reply lists, rather than duplicating what
"dissect_rpc_list()" does.

svn path=/trunk/; revision=2060
2000-06-12 08:47:34 +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
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 5f0fc518c7 Use the new split between protocol registration and protocol handoff
registration routines to get rid of the special handling of ONC RPC
protocols - dissectors for ONC RPC-based protocols should register their
protocol, fields, and ETT values in a protocol registration routine, and
register themselves with the ONC RPC dissector in their protocol handoff
routine, so that the latter is done after the ONC RPC dissector's
protocol registration routine is called, so that the data structures
needed when dissectors for ONC RPC protocols register themselves with
the ONC RPC dissector have been initialized.

Get rid of "init_dissect_rpc()", which initializes said data structures;
do that in "proto_register_rpc()" instead.

svn path=/trunk/; revision=1789
2000-04-04 06:46:41 +00:00
Gilbert Ramirez f6e92a9e93 Break proto_tree_add_item_format() into multiple functions:
proto_tree_add_protocol_format()
	proto_tree_add_uint_format()
	proto_tree_add_ipxnet_format()
	proto_tree_add_ipv4_format()
	proto_tree_add_ipv6_format()
	proto_tree_add_bytes_format()
	proto_tree_add_string_format()
	proto_tree_add_ether_format()
	proto_tree_add_time_format()
	proto_tree_add_double_format()
	proto_tree_add_boolean_format()
If using GCC 2.x, we can check the print-format against the variable args
passed in. Regardless of compiler, we can now check at run-time that the
field type passed into the function corresponds to what that function
expects (FT_UINT, FT_BOOLEAN, etc.)

Note that proto_tree_add_protocol_format() does not require a value field,
since the value of a protocol is always NULL. It's more intuitive w/o the
vestigial argument.

Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c
Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*)

Checked in Guy's fix for the function declearation for proto_tree_add_text()
and proto_tree_add_notext().

svn path=/trunk/; revision=1713
2000-03-12 04:48:32 +00:00
Guy Harris 167999e61e Give "dissect_rpc_string()" an extra "char **" argument; if it's
non-null, it returns through that argument a pointer to the displayed
version of the string, otherwise it just frees that string.

Use that to put, in the tree item for READDIR and READDIRPLUS reply
directory entry items, the file name from the directory entry.

svn path=/trunk/; revision=1521
2000-01-22 05:49:08 +00:00
Guy Harris 7a943b7810 Fix Gerald's e-mail address.
svn path=/trunk/; revision=1437
2000-01-07 22:05:43 +00:00
Uwe Girlich 4927825777 Portmapper v2 dump reply somehow nicer formatted.
svn path=/trunk/; revision=1115
1999-11-26 12:55:34 +00:00
Nathan Neulinger c47ece410a Added v2 portmap dump reply
svn path=/trunk/; revision=1087
1999-11-22 03:32:55 +00:00
Gilbert Ramirez f8f41fe3c6 Added Uwe's update to RPC.
svn path=/trunk/; revision=1069
1999-11-19 13:09:56 +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
Nathan Neulinger b72c0d1f60 Uwe Girlich's patches for nfs,mount,portmap and addition of nlm.
svn path=/trunk/; revision=1034
1999-11-15 14:17:20 +00:00
Nathan Neulinger 59bffe6e97 Added mount dissector.
Added stat dissector.
Enhancements to portmap dissector.
Added rpc_prog_name function to packet-rpc to retrieve the name of an
        rpc program. This should likely eventually be modified to use the
        /etc/rpc or rpc.bynumber NIS maps in addition to the programs that
        are registered within ethereal.

svn path=/trunk/; revision=1016
1999-11-11 21:22:00 +00:00
Nathan Neulinger 119a787b88 Additions to bootparams, portmap, and ypserv dissectors
svn path=/trunk/; revision=1013
1999-11-11 20:18:46 +00:00
Nathan Neulinger 4302c1ddc3 expanded portmap dissector to process some of the procedure calls
svn path=/trunk/; revision=1003
1999-11-10 22:43:53 +00:00
Nathan Neulinger a04402e906 Changed protocol names to all lowercase. It looks weird in listing though.
I'm presuming packet-rpc.c will be fixed soon.

svn path=/trunk/; revision=1002
1999-11-10 21:05:11 +00:00
Nathan Neulinger a7fc895437 Added stubs for various RPC routines:
portmap
	ypserv
	ypxfr
	ypserv
	bootparams

Stubs currently just map procedure numbers to names. I'll add some more
decoding of the actual procedure call/reply contents eventually.

svn path=/trunk/; revision=998
1999-11-10 17:23:55 +00:00