Commit Graph

105 Commits

Author SHA1 Message Date
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Ulf Lamping 049b0f9cf3 added a byte count output to the packet details notebook tabs
(only visible if desegmenting activated)

svn path=/trunk/; revision=10675
2004-04-23 19:47:11 +00:00
Guy Harris 7b7c0c2361 Not all dissector handles have protocols associated with them; check for
that before handing a null protocol handle to another routine.

svn path=/trunk/; revision=10258
2004-02-28 20:59:23 +00:00
Ronnie Sahlberg c47f73364b with the cahnges to when to call the heuristic dissector
(and the fact that nbss does not register its conversation)
this caused WANT_PDU_TRACKING to be decremented multiple times between
the dissectors
and thus ethereal could no longer reliably spot SMB PDUs that started in the middle of a tcp segment (unless we do reassembly which we dont do unless we have to since it eats soo many resources)

FIX so that ethereal once again can spot SMB (and other) protocol PDUs that start in the middle of a segment.

svn path=/trunk/; revision=10219
2004-02-24 09:40:38 +00:00
Jörg Mayer d9b6e98297 Fix some pointer types
svn path=/trunk/; revision=9930
2004-02-01 02:35:06 +00:00
Guy Harris 354b911d05 Add a "saved_can_desegment" field to the "packet_info" structure, so
that dissectors for pass-through proxying protocols such as SOCKS can
allow the subdissectors they call to ask that desegmentation be done.

svn path=/trunk/; revision=9488
2003-12-29 22:44:50 +00:00
Guy Harris 364261f0ad From Olivier Biot:
* Add a "match_string" field to the "packet_info" structure,
	  saving the string value that matched in a string dissector
	  lookup, by analogy to "match_port" - this was required for
	  dissection with token rendering of WBXML content when no public
	  ID was given (e.g. Nokia/Ericsson OTA provisioning data).
	* Add support for textual content type based WBXML token
	  mapping.
	* Add extra WBXML public identifiers.
	* Add the Nokia/Ericsson OTA provisioning (version 7) token
	  definitions.
	* Inform the user when a content-type based token match is found.

svn path=/trunk/; revision=9061
2003-11-21 21:58:55 +00:00
Guy Harris 7bd2e232a9 Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.

Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).

Change some direct dissector calls to go through handles.

svn path=/trunk/; revision=8979
2003-11-16 23:17:27 +00:00
Guy Harris 92fbca527d Add "dissector_get_string_handle()" for string dissector tables, similar
to "dissector_get_port_handle()" for uint dissector tables.

svn path=/trunk/; revision=8434
2003-09-09 18:09:42 +00:00
Guy Harris f6c0519c0a Support string dissector tables in the Tethereal "decode as" stuff.
Make the Ethereal "decode as" stuff not blow up with string dissector
tables.

Selectors for uint dissector tables are unsigned, not signed.

svn path=/trunk/; revision=8408
2003-09-07 00:47:57 +00:00
Guy Harris c26004150b When registering a dissector table, choose what type of hash and
comparison function to use based on the type value passed in.  For the
traditional unsigned integer table, require FT_UINT{8,16,24,32}; if the
type is FT_STRING or FT_STRINGZ, use the string hashing functions
instead.

Add routines for manipulating entries and looking up dissectors in
string dissector tables.

svn path=/trunk/; revision=8407
2003-09-06 23:37:02 +00:00
Tim Potter 3f6e918109 Save and restore the value of pinfo->current_proto when calling a
dissector in call_dissector_through_handle().

svn path=/trunk/; revision=8160
2003-08-12 20:09:38 +00:00
Guy Harris f2233623ea From Lionel Ains: "-d" flag for decode-as support in Tethereal.
Add a new routine to iterate through all dissector tables, calling a
routine for each table, to support having the "-d" code list all
dissector tables.

Get rid of "dissector_handle_get_dissector_name()"; it was put in there
for "-d", but turns out not to be necessary for that.

Clean up the usage message a bit (using the convention, adhered to by at
least some UNIX utilities, of listing all the flags with no arguments in
a single lump, and then listing the ones with arguments individually,
and also putting "-v" and "-h" in a separate lump, as Ethereal does).

svn path=/trunk/; revision=7788
2003-06-05 04:47:58 +00:00
Guy Harris f94c7971a5 Add an API to get the dissector name from a dissector handle.
svn path=/trunk/; revision=7726
2003-05-23 22:09:36 +00:00
Ronnie Sahlberg cb5e97d49a Update to TCP to handle hints from dissectors where the next PDU may start.
ONCRPC dissector updated to provide hint to TCP where the next RPCoverTCP
PDU starts as example.
Trivial updates to the other TCP based protocols required to amke them handle
this as well.  See the updates to packet-rpc.c as an example.

This is enabled by activating tcp analysis and provides hints to TCP to know where PDUs starts when not aligned to the start of the segment.

svn path=/trunk/; revision=7543
2003-04-23 10:20:29 +00:00
Guy Harris 2678786425 Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".

svn path=/trunk/; revision=7467
2003-04-16 05:55:41 +00:00
Guy Harris 24ec2110d1 Add the notion of a "fence" to columns. A dissector can set the fence
to "protect" what's currently in the column, so that attempts to clear
the column will only clear stuff after the fence and attempts to
overwrite the column will append stuff after the fence.  This, for
example, allows a dissector to arrange that the Info column contain
information for its protocol and for protocols running atop it.

svn path=/trunk/; revision=7466
2003-04-16 04:52:55 +00:00
Guy Harris 14b5b9e3a9 Completely initialize all the address fields in a packet_info structure,
setting the length to 0 and the data pointer to a null pointer.

svn path=/trunk/; revision=7239
2003-03-01 09:38:41 +00:00
Guy Harris 4156806b8b From Didier Gautheron: provide a mechanism to indicate why reassembly
wasn't done, and, for TCP, use that mechanism if reassembly isn't done
is an incorrect TCP checksum.

svn path=/trunk/; revision=7212
2003-02-27 03:56:48 +00:00
Guy Harris e120160577 From Dinesh Dutt:
- A new decoder called MDSHDR which decodes the internal header of the
      Cisco MDS switch (this is different from the Boardwalk header).
    - Support for some more new columns as part of FC support.
    - Fixed the decoding of the Special Frame in FCIP.
    - Fixed the decoding of credit management type field in FLOGI/PLOGI frame
      in FC-ELS.

svn path=/trunk/; revision=6974
2003-01-22 06:26:36 +00:00
Guy Harris 6c4a845613 Move into "call_dissector_work()" the stuff to handle dissecting, in
error packets, the copy of the packet that got the error, rather than
doing it in the CLNP dissector and the ICMP dissector and the ICMPv6
dissector and the PPP dissector for various control protocols; have it
do that work iff "pinfo->in_error_pkt" is set.

svn path=/trunk/; revision=6942
2003-01-20 05:42:37 +00:00
Gerald Combs b60b1414c3 From Dinesh Dutt: Add Fibre Channel support, including FCIP, Basic FC
header, Extended Link Service, Interswitch Link Service, FCP, and IPFC.

svn path=/trunk/; revision=6757
2002-12-08 02:32:36 +00:00
Guy Harris 0ca2637951 At least in my compile environment, we don't need "inet_v6defs.h" to
compile "epan/packet.c", and including it without including <winsock2.h>
before it means that, as <winsock2.h> appears to get included after we
include "inet_v6defs.h", we get complaints about a redefinition of
AF_INET6; removing the include of "inet_v6defs.h" sqelches that warning.

If we *do* need "inet_v6defs.h" on some platforms, put it back, but put
in an include of <winsock2.h> before it, to keep the warning away - if
we ever use AF_INET6 in "epan/packet.c", we want to use the one from
<winsock2.h> if it defines it, as that's what the rest of Ethereal uses.

svn path=/trunk/; revision=6649
2002-11-16 21:36:39 +00:00
Guy Harris 1c81a6168b From Chris Waters: export "find_dissector_table()" and add
"dissector_handle_get_protocol_index()".

svn path=/trunk/; revision=6633
2002-11-15 03:10:36 +00:00
Guy Harris d958ee1a72 Don't return 0 from "call_dissector_work()" if the packet was dissected
by the dissector we handed off to, even if the tvbuff we handed them was
empty.

svn path=/trunk/; revision=6518
2002-10-29 05:15:24 +00:00
Guy Harris a7744b697f Hoist the bulk of the stuff involved in calling a dissector through a
handle into a routine "call_dissector_work()", and have
"dissector_try_port()" and "call_dissector()" use that routine (which
means that "call_dissector()" now saves and restores
"pinfo->can_desegment").

svn path=/trunk/; revision=6516
2002-10-28 23:04:15 +00:00
Guy Harris 28c1a65e85 Add in a notion of "circuits", which are for virtual circuit-oriented
protocols (where there's a virtual circuit ID of some sort in packets)
what conversations are for protocols ultimately running atop
connectionless network layers.  Have circuit type and ID values in the
"packet_info" structure.

Have the Frame Relay dissector set the circuit type and ID values, and
have the Wellfleet compression protocol set up circuit information and
store compression information with the circuit.

svn path=/trunk/; revision=6469
2002-10-22 08:22:07 +00:00
Jörg Mayer 48be4e530d 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=6116
2002-08-28 20:41:00 +00:00
Guy Harris fedaad1874 Before dissecting a packet, clear the filter field and value stored with
each column for use by the "Match Selected" and "Prepare Selected"
functions in the packet list pane.

svn path=/trunk/; revision=6080
2002-08-24 10:41:40 +00:00
Tim Potter 60e4ca9c4f Moved the generic true_false_string saying "Set", "Not set" into
epan/packet.c

It was cut and pasted into seven other dissectors!

svn path=/trunk/; revision=6052
2002-08-21 21:25:23 +00:00
Jörg Mayer 3105ee542f Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928
2002-08-02 21:29:45 +00:00
Guy Harris 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +00:00
Guy Harris 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris 84f9e6b068 Get rid of an assigned-to-but-not-used variable, and eliminate another
variable that's used only once.

svn path=/trunk/; revision=5479
2002-05-15 21:18:19 +00:00
Guy Harris 58324cf3b3 Mark an unused argument as such.
Fix a couple of typos in comments.

svn path=/trunk/; revision=5439
2002-05-10 20:02:40 +00:00
Gilbert Ramirez 41cc7f0707 Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make
some of the COL_INFO texts more useful, handle a Unicode issue, and
modify some of the cases that use "request conditions".
But the NCP dissector as it stands is very usable now.

Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted
to think about the various possible macros and review an email conversation
I had with Guy on the subject.

svn path=/trunk/; revision=5432
2002-05-09 23:50:34 +00:00
Guy Harris db119f15d4 Add routines to create anonymous handles for new-style dissectors (ones
that return an "int", giving either an indication of how much data was
dissected, an indication of how much more data is needed from TCP to
dissect, or 0, meaning "this isn't one of my packets").

svn path=/trunk/; revision=5260
2002-04-28 00:13:05 +00:00
Guy Harris e6393bd15f Initialize the fields of "edt->pi" in order - and initialize some fields
that weren't being initialized.

svn path=/trunk/; revision=5034
2002-03-28 09:12:00 +00:00
Guy Harris 52fb615708 From Joerg Mayer: get rid of "-Wno-unused" flag in some configure
scripts, and check in changes to add _U_ to some unused arguments (some
other should perhaps be used, so we leave the _U_ out so that the
warnings serve as a reminder to check those).

svn path=/trunk/; revision=4848
2002-03-02 20:51:46 +00:00
Guy Harris cbf5c537c4 From Joerg Mayer: remove unused variables and declarations of
non-existent functions.

Remove the "filetype" argument from the "can_write_encap" functions for
particular capture file types - the argument value is implicit, in that
the routine being called is the routine for that particular file type.

svn path=/trunk/; revision=4823
2002-02-27 08:57:25 +00:00
Guy Harris c1333b7964 Fix "create_dissector_handle()" to properly create a handle for an
old-style dissector.

svn path=/trunk/; revision=4816
2002-02-27 00:26:29 +00:00
Guy Harris 193b8c9bfb Allow dissectors to be registered as "old-style" or "new-style"
dissectors.  "Old-style" dissectors return nothing.  "New-style"
dissectors return one of:

	a positive integer, giving the number of bytes worth of data in
	the tvbuff that it considered to be part of the PDU in the
	tvbuff;

	zero, if it didn't consider the data in the tvbuff to be a PDU
	for its protocol;

	a negative integer, giving the number of additional bytes worth
	of data in needs to get the complete PDU (for use with
	fragmentation/segmentation when the length of the PDU isn't
	known to the protocol atop the one the dissector is dissecting).

Have "call_dissector()" return the return value of new-style dissectors,
and the length of the tvbuff handed to it for old-style dissectors.

Have "dissector_try_port()" return FALSE if the subdissector is a
new-style dissector and returned 0.

Make the EAP dissector a new-style dissector, and have a "EAP fragment"
dissector that is also a new-style dissector and handles fragmentation
of EAP messages (as happens above, for example, RADIUS).  Also, clean up
some signed vs. unsigned comparison problems.

Reassemble EAP-Message AVPs in RADIUS.

svn path=/trunk/; revision=4811
2002-02-26 11:55:39 +00:00
Guy Harris 0a861db40b Note that we could save some overhead if we require the name argument to
"add_new_data_source()" to be a string constant (or some other static
data item).

svn path=/trunk/; revision=4803
2002-02-25 21:02:10 +00:00
Guy Harris ca8f79df3d Get rid of "init_all_protocols()"; instead, have a routine
"init_dissection()" which calls "epan_conversation_init()", does the
work that "init_all_protocols()" did, and then calls
"reassemble_init()", so that the standard sequence of dissection
initialization is done in one place, rather than having multiple places
call the same sequence of routines.

svn path=/trunk/; revision=4797
2002-02-24 06:45:14 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris d92a1cd8e1 With the tvbuffication of all dissectors, the "packet_info" structure no
longer contains length fields, so there's no need to pass a "packet_info
*" argument to "set_actual_length()".

svn path=/trunk/; revision=4748
2002-02-17 00:51:21 +00:00
Gilbert Ramirez 9249d8094f dissect_frame() can throw a ReportedBoundsError; catch it in
dissect_packet().

svn path=/trunk/; revision=4720
2002-02-11 19:02:56 +00:00
Guy Harris fb1e26fe6a Use the "fragmented" field of the "packet_info" structure in
"dissect_frame()" to indicate whether a ReportedBoundsError was due to
the packet being malformed (i.e., the packet was shorter than it's
supposed to be, so the dissector went past the end trying to extract
fields that were supposed to be there) or due to it not being
reassembled (i.e., the packet was fragmented, and we didn't reassemble
it, but just treated the first fragment as the entire packet, so the
dissector went past the end trying to extract fields that were partially
or completely in fragments after that).  Mark the latter as being
unreasembled rather than malformed.

Properly initialize, save, and restore that field, and properly set it,
so that works.

svn path=/trunk/; revision=4555
2002-01-17 06:29:20 +00:00
Gilbert Ramirez 0b9b02c6ea Long NCP traces can easily have many packets whose "uniqueness"
variables wrap-around. Since the request/reply packets are related via
a hash based on these uniqueness variables, long NCP traces can
have mis-matches reqeust/reply records.

Thus, only do the hash-lookup for the reply packet during the first
sequential scan of the trace file. Once the pertinent info is found,
store it in the packet's private data area.

Since the memory allocated for the hash and for the structures that make
up the keys are no longer needed after the first sequential run through
the trace file, arrange to free that memory after the first sequential
run. Similar to the register_init_routine() that allows dissectors
to register callbacks for calling *before* a capture file is loaded,
set up a register_postseq_cleanup_routine() function that allows
dissectors to register callbacks for calling *after* the first
sequential run-through of the trace file is made. This is not
a *final* cleanup callback, since Ethereal will still have that trace file
open for random-access reading.

I didn't have tethereal call postseq_cleanup_all_protocols() since
tethereal doesn't keep the trace file open for random-access reading.
I could easily be swayed to make tethereal call that function, however.

svn path=/trunk/; revision=4484
2002-01-05 04:12:17 +00:00