Commit Graph

118 Commits

Author SHA1 Message Date
Guy Harris 5a751f6811 Add arguments to "dissect_xdlc_control()" to specify value_string
tables, for use in the top-level item for the control field, for
unnumbered frame function codes for commands and responses.  If the
argument is null, default to the standard tables.

Use "dissect_xdlc_control()" and the #defines from "xdlc.h" for IrDA.

Use the reported length rather than the data length in the IrDA
dissector when iterating over the data in an IrDA packet.

Make "dissect_xid()" update the column information as well as the
protocol tree.  Put the slot number into the protocol tree only for
command frames - "the slot number field is undefined in discovery XID
response frames", to quote the IrLAP spec.

svn path=/trunk/; revision=9713
2004-01-18 08:32:46 +00:00
Guy Harris 30ce42b1e9 Have "dissect_xdlc_control()" take a pointer to a structure containing
pointers to hf_ values, so the subfields of the control field are put
into the protocol tree as filterable items.  Change the protocols that
use it appropriately.

Export "dissect_xdlc_control()" to plugins.

svn path=/trunk/; revision=9531
2004-01-03 03:51:27 +00:00
Guy Harris be2736adcf Have a pseudo-header for Ethernet packets, giving the size of the FCS -
0 means "there is no FCS in the packet data", 4 means "there is an FCS
in the packet data", -1 means "I don't know whether there's an FCS in
the packet data, guess based on the packet size".

Assume that Ethernet encapsulated inside other protocols has no FCS, by
having the "eth" dissector assume that (and not check for an Ethernet
pseudo-header).

Have "ethertype()" take an argument giving the FCS size; pass 0 when
appropriate.

Fix up Wiretap routines to set the pseudo-header.  This means we no
longer use the "generic" seek-and-read routine, so get rid of it.

svn path=/trunk/; revision=8574
2003-10-01 07:11:49 +00:00
Guy Harris 4815aadacf As with the Cisco OUI, so with the Nortel OUI.
svn path=/trunk/; revision=8352
2003-09-03 06:38:15 +00:00
Guy Harris 1721593973 Fix up the API for adding support for new OUI's to the LLC dissector.
Use that API to create the table for the Cisco OUI 00:00:0C.

svn path=/trunk/; revision=8351
2003-09-03 06:27:03 +00:00
Guy Harris 454806eeff Use "dissect_xdlc_control()" to dissect the control field of Frame Relay
packets that have one.  Add an argument to "dissect_xdlc_control()" to
indicate whether it should append the information to the Info field or
just put it in the Info field.

Use the #defines for the DLCI bitfields to extract the DLCI bits when
constructing the DLCI.

svn path=/trunk/; revision=8335
2003-09-02 19:18:52 +00:00
Guy Harris 4059b02fe9 Add an API to let a dissector register a dissector table and field for a
given OUI; the field is used when the PID for that OUI is put into the
protocol tree, and the dissector table is used to find a dissector for
that PID.

Not yet used, thus not yet tested; API is subject to change.
(Eventually, several of the cases in the big switch statement in
"dissect_llc()" should be handled by registering information for those
OUIs.)

svn path=/trunk/; revision=8291
2003-08-28 01:29:16 +00:00
Guy Harris fadeb72b2e From Giles Scott: Nortel/SynOptics Network Management Protocol support.
svn path=/trunk/; revision=8290
2003-08-28 00:11:32 +00:00
Guy Harris 43189e4e44 Add support for some additional SAPs for Netware and OSI.
svn path=/trunk/; revision=7824
2003-06-10 05:38:52 +00:00
Guy Harris 31db598238 Handle non-SNAP LLC Vines packets as such when capturing.
svn path=/trunk/; revision=7485
2003-04-18 03:41:39 +00:00
Guy Harris 3b37905e24 From Jochen Friedrich: add support for:
HP extended 802.2 LLC

	HP-UX remote management over HP extended 802.2 LLC

	SNMP over HP extended 802.2 LLC.

svn path=/trunk/; revision=7253
2003-03-02 21:52:21 +00:00
Guy Harris 23feb04a83 From Jochen Friedrich:
Fixed handling of NLP header in SNA
	XID handoff table for LLC, and XID dissection for SNA format 3
	HPR optional segments in SNA
	Most important control vectors in SNA
	Route setup messages in SNA
	Additional LLC DSAPs for SNA

svn path=/trunk/; revision=7131
2003-02-13 00:47:42 +00:00
Guy Harris 646e0dbc29 From Dave Richards: BACNET-over-ARCNET is BACNET-over-802.2-over-ARCNET,
not BACNET-directly-over-ARCNET.

svn path=/trunk/; revision=7000
2003-01-25 00:06:12 +00:00
Guy Harris 9711eebb5b Move the handling of the Network_Header for full FC frames into the FC
dissector, and have the LLC dissector register itself as the dissector
for IP-over-FC frames, as the payload is just an LLC 802.2 header plus
payload for the protocol specified by that header.

In the dissector for IP-over-FC as a Wiretap link-layer type, have its
top-level item be a protocol item rather than a text item, and don't
register it as the dissector for IP-over-FC frames from the FC dissector
- it assumes what it's handed includes the Network_Header, but for full
FC frames, the FC dissector has already consumed the Network_Header.

Move the definitions of the value_string tables out of the header file;
most of them are used only in one file, so define them in that file, and
for "fc_fc4_val", define it in "packet-fc.c", make it not static, and
declare it in "packet-fc.h".

Use FALSE, rather than 0, as the last argument to
"proto_tree_add_item()" calls that add a big-endian value.

Fix one "proto_tree_add_uint()" call that was supposed to be a
"proto_tree_add_item()" call.

Use "%u", not "%d", to display unsigned values.

svn path=/trunk/; revision=6773
2002-12-10 02:49:31 +00:00
Guy Harris 93b92b0f94 Do LLC handoff from the IP-over-FC dissector the way it's done for other
protocols using 802.2 LLC.

svn path=/trunk/; revision=6765
2002-12-08 22:01:20 +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 6af38451a2 From Dave Richards: support BACNET over 802.2.
svn path=/trunk/; revision=6644
2002-11-16 08:55:13 +00:00
Guy Harris aef0d31da2 Show the SAP values in RPL packets symbolically if possible.
svn path=/trunk/; revision=6564
2002-11-05 22:50:42 +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 fbb370078f From Jochen Friedrich: RFC 2353 SNA-over-LLC-over-UDP support, and RFC 2043
SNA-over-PPP and SNA-over-LLC-over-PPP support.

svn path=/trunk/; revision=5587
2002-05-29 03:08:02 +00:00
Guy Harris 8a5d5f9bde From Joerg Mayer: get rid of extra arguments to capture routines.
svn path=/trunk/; revision=5233
2002-04-24 06:03:34 +00:00
Guy Harris 8ed5e80e14 From Joerg Mayer: get rid of unused function arguments.
svn path=/trunk/; revision=5053
2002-03-31 21:09:00 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +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 75cc056222 Attach a descriptive name field type and base to dissector tables; that
specifies how the selector values used as keys in those tables are to be
displayed, and the title to use when displaying the table.

Use that information in the code to display the initial and current
entries of various dissector tables.

Have the dissector for BACnet APDUs register itself by name, and have
the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set,
rather than doing it with a dissector table.

svn path=/trunk/; revision=4358
2001-12-08 06:41:48 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a
dissector function and a protocol ID.  Associate dissector handles with
dissector table entries.

svn path=/trunk/; revision=4308
2001-12-03 04:00:26 +00:00
Ed Warnicke 34dbc86e65 Moved from using dissect_data to using call_dissector()
svn path=/trunk/; revision=4264
2001-11-25 22:51:14 +00:00
Guy Harris e8d4f4f0ac Make the capture routines take an additional argument giving the amount
of packet data captured.

Make the "BYTES_ARE_IN_FRAME()" macro take a "captured length of the
packet" argument.

Add some length checks to capture routines.

svn path=/trunk/; revision=4235
2001-11-20 21:59:18 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +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 b2ab758ca7 The Cisco 802.11 bridges used 0000F8, i.e. OUI_CISCO_90, not 000078;
various Cisco documents indicate that 0000F8 is used on at least some
Cisco boxes for bridging Ethernet frames onto 802.x+LLC frames.

svn path=/trunk/; revision=3498
2001-06-02 03:04:12 +00:00
Guy Harris 40c78f3b80 Some Cisco 802.11 bridges apparently change the OUI of packets from
000000 to 000078, so treat LLC packets with that OUI the same way we
treat LLC packets with 000000.

svn path=/trunk/; revision=3496
2001-06-01 23:04:37 +00:00
Guy Harris a8cbb073d4 NLPID's of 0x08 and 0x09 should be labeled as Q.933 and LMI,
respectively, not Q.931 and Q.2931, in Frame Relay.

When dissecting Q.933-style multiprotocol encapsulated Frame Relay
frames, use the "osinl" dissector table to check for OSI network layer
protocols, include the NLPID in the tvbuff you hand to
"dissector_try_port()" with that dissector table, and put the NLPID into
the protocol tree as an invisible item - the NLPID is considered part of
the PDU for those protocols, so you have to include it in the tvbuff,
and the dissector will put it into the protocol tree.

Also, make sure the top-level entry for the Frame Relay protocol
includes all the bytes preceding the payload, and none of the payload
bytes.

Export a routine to do Q.933-style dissection, and have the WCP
dissector call it, rather than duplicating that code in the WCP
dissector.

Don't register OSI network layer protocols with the "fr.ietf" dissector
table; it's now sufficient to register them with the "osinl" dissector
table, as the Frame Relay dissector now checks that.

Get rid of unnecessary checks for protocols being enabled (if the
dissector is always called through handles or dissector tables, the
common code for handles and dissector tables will do the checks for
you).

Get rid of some unnecessary #includes.

svn path=/trunk/; revision=3211
2001-03-30 10:51:50 +00:00
Gilbert Ramirez a8b0c240e6 Move appletalk- and sna-related address routines out of the dissectors
and into epan.

svn path=/trunk/; revision=3160
2001-03-22 16:24:16 +00:00
Guy Harris d9718a693d Remove some more "CHECK_DISPLAY_AS_DATA()" calls and code to set
"pinfo->current_proto", in dissectors always called through dissector
tables and handles.

Make the IEEE 802.11 dissector static, as it's not called externally.

Clear the Info column in the Linux cooked capture and 802.1q VLAN
dissectors, before extracting anything from the packet, so that if an
exception is thrown, the Info column doesn't reflect the previous
protocol.

Don't extract the encapsulated protocol in the VLAN dissector until you
use it, so that if the frame contains the VLAN ID but not the
encapsulated protocol, we at least put the VLAN ID into the protocol
tree.

svn path=/trunk/; revision=2927
2001-01-21 22:51:46 +00:00
Guy Harris 18bfc670ec Pull the handling of trailers in Ethernet (as opposed to 802.3) frames
into "ethertype()".

svn path=/trunk/; revision=2915
2001-01-18 07:44:41 +00:00
Guy Harris cca256ece9 "dissect_llc()" is called for RFC 2684 LLC Encapsulation over ATM, so
LLC *does* have to support bridged frames over ATM; the correct bridge
padding is 2 (well, except for bridged 802.6 frames, but, if we ever
support that, we just wouldn't add "bridge_pad" to "offset+5" when
constructing the next tvbuff).

svn path=/trunk/; revision=2874
2001-01-11 07:24:17 +00:00
Guy Harris 039bd984c0 Make the stuff to handle SNAP frames (OUI, PID, payload) a routine of
its own; it's used not only by LLC, but by Frame Relay with RFC 2427 and
ATM with RFC 2684.

Support for RFC 2427-encapsulation Frame Relay packets, from Paul
Ionescu.

Get rid of the CISCO_IP PPP protocol type - Cisco HDLC uses, in most
cases, Ethernet packet types, so use ETHERTYPE_IP instead (they're both
0x0800).

svn path=/trunk/; revision=2854
2001-01-10 09:07:35 +00:00
Guy Harris 43ccfd8054 Add an additional "protocol index" argument to "{old_}dissector_add()",
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and
"register_dissector()", so that an entry in those tables has associated
with it the protocol index of the protocol the dissector handles (or -1,
if there is no protocol index for it).

This is for future use in a number of places.

(Arguably, "proto_register_protocol()" should take a dissector pointer
as an argument, but

	1) it'd have to handle both regular and heuristic dissectors;

	2) making it take either a "dissector_t" or a union of that and
	   a "heur_dissector_t" introduces some painful header-file
	   interdependencies

so I'm punting on that for now.  As with other Ethereal internal APIs,
these APIs are subject to change in the future, at least until Ethereal
1.0 comes out....)

svn path=/trunk/; revision=2849
2001-01-09 06:32:10 +00:00
Guy Harris bde0b86caf X.25-over-LLC support, from Paul Ionescu.
svn path=/trunk/; revision=2829
2001-01-05 19:07:38 +00:00
Guy Harris b31b5b697b Clear the Info column before fetching anything from the packet, so that
if we throw an exception, the stuff from the protocol atop which LLC
runs isn't still there.

svn path=/trunk/; revision=2826
2001-01-05 08:43:30 +00:00
Guy Harris b151ddecbb Have the TR MAC and LLC dissectors register themselves, make them
static, and have other dissectors call them through handles.

svn path=/trunk/; revision=2816
2001-01-03 10:34:42 +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 d13901155d Tvbuffify the CDP, CGMP, ISL, and VTP dissectors.
Add a new subdissector table in the LLC dissector for protocol IDs with
a Cisco OUI, and register the CDP, CGMP, and VTMP dissectors in that
table, rather than calling them via a switch statement.

Register the ISL dissector by name, and have the Ethernet dissector call
it via a handle.

Fix the handling of the checksum field in the CDP dissector.

The strings in CDP are counted, not null-terminated; treat them as such.

Fix the handling of the encapsulated frame CRC, and the encapsulated
frame, in the ISL dissector, at least for Ethernet frames; it may not be
correct for encapsulated Token Ring frames.

svn path=/trunk/; revision=2792
2000-12-28 09:49:09 +00:00
Gilbert Ramirez d673500082 Wrap the dissect_fddi() call (with a 4th argument) with
dissect_fddi_not_bitswapped() and dissect_fddi_bitswapped(), both of which
use the standard 3-argument tvbuffified-dissector argument list.

Add a dissector table called "wtap_encap" which is used to call dissectors
from dissect_frame(). The switch() statement from this top-level dissector
is removed.

The link-layer dissectors register themselves with the "wtap_encap"
dissector table. The dissectors are now static where possible.

svn path=/trunk/; revision=2708
2000-11-29 05:16:15 +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 ee1b884ee9 Tvbuffify the STP dissector, have it register itself and have the LLC
dissector call it through a handle, and make it static.

Give "dissect_data()" an "offset" argument, so dissectors can use it to
dissect part of the packet without having to cook up a new tvbuff.

Go back to using "dissect_data()" to dissect the data in an IPP request.

svn path=/trunk/; revision=2651
2000-11-16 07:35:43 +00:00
Guy Harris 9cc45a4a10 Include the control-field information in the Info column for LLC frames.
svn path=/trunk/; revision=2370
2000-08-25 06:31:25 +00:00