Commit Graph

61 Commits

Author SHA1 Message Date
Guy Harris fedc54cc90 Fix an error in a blurb.
svn path=/trunk/; revision=5327
2002-05-01 07:21:19 +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 d215b73503 Get rid of some unused variables and arguments.
svn path=/trunk/; revision=5221
2002-04-22 08:14:12 +00:00
Guy Harris b2c11b5e13 Don't try to reassemble short frames - but do still pass them through at
least some of the reassembly mechanism, so we can deal with both bogus
and real last fragment (display the bogus ones as unfragmented frames,
treat the real ones as fragments).

svn path=/trunk/; revision=5186
2002-04-17 10:07:57 +00:00
Guy Harris 3cd4cd18c3 Fix up the handling of the "fragmented" flag in the "packet_info"
structure (make it match the way it's done in the IP dissector).

svn path=/trunk/; revision=5184
2002-04-17 09:34:09 +00:00
Guy Harris 9bfe54fe7c Show the "More Fragments" indicator as such, rather than as a "this is
fragmented" vs. "this is not fragmented" indicator.

svn path=/trunk/; revision=5182
2002-04-17 09:30:58 +00:00
Guy Harris ed3b0cae65 Add a separate hash table to the reassembly code for reassembled
packets, using the reassembly ID and the frame number of the final frame
as the key.  There is no guarantee that reassembly IDs won't be reused,
even when talking between the same source and destination address; if,
once reassembly is complete, the "fragment_data" structure is moved to
the latter hash table, this will keep reused reassembly IDs from causing
mis-reassembly.

Add a routine "fragment_add_seq_check()", which

	if a fragment has the "more fragments" flag not set but is the
	first fragment of a reassembly, treats that as a non-fragmented
	frame, allocating a "fragment_data" structure for the reassembly
	but not attaching any fragment to it, and adding it to a
	reassembled packet list;

	if a packet has been reassembled, removes it from the table of
	reassemblies and moves it to the table of reassembled packets;

	if the frame's been seen already, looks it up in the table of
	reassembled packets rather than the table of reassemblies.

Add reassembly support for fragmented 802.11 frames.  Use
"fragment_add_seq_check()" to cope with the fact that some
hardware+drivers apparently hands us reassembled frames with a non-zero
fragment number and the "more fragments" bit clear (as if it puts the
802.11 header of the *last* fragment onto the reassembled data).

svn path=/trunk/; revision=5177
2002-04-17 08:25:05 +00:00
Guy Harris 2309234678 From Jouni Malinen:
Fix offset of challenge element in 802.11 dissector.
	Show fragmented 802.11 frames as fragments.

svn path=/trunk/; revision=5151
2002-04-13 18:41:47 +00:00
Guy Harris 939b3c8e0a Add an encapsulation type for "802.11 with radio information"; that type
returns radio information such as signal strength, channel, and data
rate in a pseudo-header.  Add that pseudo-header.

Use the "802.11 with radio information" encapsulation type for Wireless
Sniffer files; extract the radio information from where it appears to be
in the header.

Add dissector code for that encapsulation type.

Fix an error in the code to put radio information into the AiroPeek
tree.

Make the "wrapped" flag for NetXRay/Windows Sniffer captures a
"gboolean".

svn path=/trunk/; revision=5122
2002-04-08 09:09:49 +00:00
Guy Harris 688ad377fe From Jouni Malinen: fix bugs in 802.11 authentication frame dissection.
svn path=/trunk/; revision=4902
2002-03-09 22:41:51 +00:00
Guy Harris 27e5901646 Properly handle the "no data" data frames.
svn path=/trunk/; revision=4774
2002-02-22 07:16:35 +00:00
Guy Harris 96bfaddff2 The number of bytes of tagged parameters should be computed by seeing
how many bytes remain in the packet starting at the initial offset of
the tagged parameters, not by seeing how many bytes remain in the packet
starting 4 bytes later.  (If you're trying to avoid counting a CRC that
appears at the end of the packet data, then you need to be sure there
*is* a CRC first; this may require using a different DLT_ type, in
libpcap, for those captures.)

svn path=/trunk/; revision=4769
2002-02-21 23:34:33 +00:00
Guy Harris 80dcfd02ac Some capture formats for 802.11 have fixed-length link-layer headers
(padded to the maximum length); add code to handle that.

svn path=/trunk/; revision=4614
2002-01-28 01:13:48 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +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 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 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
Guy Harris 56636f157a Support for 802.11+Prism II monitor-mode link-layer headers, from
Tim Newsham.

Add in missing item for WTAP_ENCAP_CISCO_IOS in the Wiretap
encapsulation type table.

svn path=/trunk/; revision=4290
2001-11-28 07:11:11 +00:00
Ed Warnicke 4877553530 Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_X
which also takes a handle as an argument and thus doesn't call
dissect_data directly.

svn path=/trunk/; revision=4270
2001-11-26 05:13:14 +00:00
Ed Warnicke fcd5b352af Moved from using dissect_data() to using call_dissector()
svn path=/trunk/; revision=4269
2001-11-26 04:52:51 +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
Guy Harris 12db23546d If "snprintf()" can't print all the data because there's not enough
room, it might return -1 in some versions of glibc; check for that, and
quit if that happens.

It might also return the number of characters that would've been printed
had there been enough room; this means that a loop that does

	n += snprintf (buf + n, BUF_LENGTH - n, ...);

may end up making "n" bigger than BUF_LENGTH, and "snprintf()" might not
sanely handle being passed a negative length, so if "n" isn't less than
the total length of the string buffer, don't add stuff to it.

svn path=/trunk/; revision=3952
2001-09-25 02:21:15 +00:00
Guy Harris 7ee55bfd6b The data in a tagged field can be up to 255 bytes (the length is an
8-bit value), and the raw data of an SSID parameter is the
interpretation, so the buffer into which we put the interpretation must
be at least 256 bytes long; it's an array of size SHORT_STR, so boost
SHORT_STR to 256.

svn path=/trunk/; revision=3951
2001-09-25 00:34:24 +00:00
Guy Harris 2e713f2947 Add a "wlan.addr" field, and put two instances into it for all frames
with both source and destination addresses - one instance with the
source address, and one instance with the destination address - to allow
display filtering that checks both the source and destination address
against a single value (as the other 802.x dissectors, and the FDDI
dissector, do).

svn path=/trunk/; revision=3785
2001-07-25 05:53:30 +00:00
Guy Harris 67ed48afa4 I guess some bridges take Netware Ethernet_802_3 frames, which are 802.3
frames (with a length field rather than a type field, but with no 802.2
header in the payload), and just stick the payload into an 802.11 frame.
I've seen captures that show frames of that sort.

This means we have to do the same check for Netware 802.3 - or, if you
will, "Netware 802.11" - that we do in the Ethernet dissector, i.e.
checking for 0xffff as the first four bytes of the payload and, if we
find it, treating it as an IPX frame.

svn path=/trunk/; revision=3759
2001-07-21 06:30:21 +00:00
Guy Harris b3c464723c Allow the 802.11 management-frame protocol to be disabled.
Don't bother doing the WEP processing and child-tvbuff construction for
frames other than management and data frames, as they have no payload to
be WEP-encrypted or dissected.

svn path=/trunk/; revision=3600
2001-06-22 08:12:11 +00:00
Guy Harris 210a722eca Dissect the payload of a management frame as a separate protocol, so
that you can open up that protocol without opening up the 802.11 MAC
header; this can save some screen real estate.

Make the tree item for all the WEP parameters a text item, rather than a
"string" field with a null string pointer, as "strings" with null string
pointers give the filtering code gastric distress.

Dissect the WEP initialization vector as an FT_UINT24 (as it's a 3-byte
field), and dissect the key ID as part of an FT_UINT8 (as it's in an
8-bit byte).

After dissecting the frame control field, dissect the rest of the header
in one switch statement, and then:

	handle WEP-encrypted frames with common code for all frame
	types;

	handle the payload of other frames.

(If we can supply the relevant keys to Ethereal, we could perhaps add
code to decrypt the WEP payload and then dissect the decrypted payload
the same way we dissect un-encrypted payloads.)

svn path=/trunk/; revision=3599
2001-06-22 07:46:25 +00:00
Guy Harris 31f2169275 Fix up some incorrect handling of the TO_DS and FROM_DS flags by
#defining all the bits in the flags field, and using those #defines in
the macros to test the flag fields, the macros fot the data address
types, the value_string table for the data frame to/from DS
combinations, and the bitfields for the flag bits.

svn path=/trunk/; revision=3598
2001-06-22 06:03:50 +00:00
Guy Harris 5748457c94 Get rid of an unused #define.
Make routines not used outside this module static.

Make "find_header_length()" return the correct value for management and
control frames.

svn path=/trunk/; revision=3590
2001-06-21 06:59:47 +00:00
Guy Harris eea200a485 Don't use "tvb_get_ptr()" and "pletohs()" just to fetch a 16-bit
integral value from a packet - "tvb_get_letohs()" can do that just fine.

Don't use "tvb_get_ptr()", casting the result to a "guint16 *", and
dereferencing that pointer, either: that doesn't handle byte order
correctly, and it may fail if the pointer isn't aligned on a 2-byte
boundary.

For that matter, don't just use "tvb_get_ptr()" and dereference the
result to get an 8-bit quantity.

Use "proto_tree_add_item()" in many places where it's possible.

Reuse the results of "tvb_get_ptr()" calls when possible.

Show the fragment number and sequence number in decimal - they're just
ordinals.

Fix the blurb for the sequence number field.

svn path=/trunk/; revision=3589
2001-06-21 06:36:44 +00:00
Guy Harris f492449c58 Make sure the top-level 802.11 item covers the entire frame.
Give the type field values names, rather than just showing them as 0, 1,
and 2.

svn path=/trunk/; revision=3588
2001-06-20 23:58:57 +00:00
Guy Harris a9eb080410 Make the type/subtype field the very first entry in the protocol tree,
and put it under the top-level 802.11 protocol item, so you don't have
to open the frame control field to see it.

Rename the variable for it, and the value_string array for it, to
indicate that it's made out of the type and subtype fields.

svn path=/trunk/; revision=3587
2001-06-20 23:29:16 +00:00
Guy Harris 693ff9fecb All four data frame types are now handled with identical code, so,
instead of having four identical copies of that code in switch
statements, just handle all four of them with the same case.

svn path=/trunk/; revision=3586
2001-06-20 23:12:05 +00:00
Guy Harris 49a931ee69 Put the combined type/subtype into the protocol tree, so you can look
for all Association Request frames, or all frames except for
Clear-to-send frames, or....

Compute the composed frame type early in the dissection process, and set
the Info column as soon as you've done that, rather than doing it in the
later switch statement.

svn path=/trunk/; revision=3585
2001-06-20 23:04:36 +00:00
Guy Harris 9b8bfbe171 If it's not a protocol, it doesn't belong at the top level of the
protocol tree; not only is putting it at the top level a little weird,
it upsets the heck out of the protocol-statistics code, causing it to
abort.  Put the fixed and tagged parameters under the top-level entry
for 802.11 (where one of the fixed-parameters entries already was).

Call the top-level item just "IEEE 802.11", not "IEEE 802.11 Header", as
it includes management-frame information.

svn path=/trunk/; revision=3584
2001-06-20 22:26:07 +00:00
Guy Harris ff0d7ee9c4 Clean up a string.
svn path=/trunk/; revision=3583
2001-06-20 06:22:33 +00:00
Guy Harris 65d0b1e526 Fix "COOK_ADDR_SELECTOR()" to extract the 2 bits that determine the
interpretation of the address fields, in DATA_ADDR_T{1,2,3,4} format.

Clean up a bunch of other macros to enclose their argument in
parentheses.

Clean up "find_header_length()" - it only needs to take the frame
control field of the frame as an argument, and should just check whether
"COOK_ADDR_SELECTOR()" returns DATA_ADDR_T4.

"tofrom_ds" is a value_string table, not a true_false_string table, so
wrap it in "VALS()", not "TFS()".

Don't fetch the header length in N different places in the main
dissector - just fetch it once and use it throughout.

svn path=/trunk/; revision=3582
2001-06-20 06:15:07 +00:00
Guy Harris 8c52d3db75 More signed vs. unsigned cleanups, and initialization cleanups, from
Joerg Mayer.

svn path=/trunk/; revision=3578
2001-06-19 23:08:57 +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 29d49954f1 Display hex numbers with a leading 0x.
Supply "true" and "false" strings for the Order flag bit.

svn path=/trunk/; revision=3538
2001-06-12 05:40:05 +00:00
Guy Harris 78f6f176d4 Clean up the handling of MAC addresses - set the addresses in the
standard fashion, for data and managment packets, and set the columns
correctly for other packets (as we currently put address types in the
address columns; if we don't do so, we could just set the addresses in
the standard fashion for those packets as well).

svn path=/trunk/; revision=3536
2001-06-10 07:40:39 +00:00
Guy Harris 988785407f Use "col_set_str()", rather than "col_add_str()", wherever possible.
Don't bother doing multiple "tvb_get_letohs()" to get the frame control
field - we fetched it once, just use the value we fetched.

Call sub-dissectors *regardless* of whether a protocol tree is being
built or not - dissectors should always do so.

svn path=/trunk/; revision=3524
2001-06-08 06:01:06 +00:00
Guy Harris 7303b2da99 Bug fixes, and WEP support, from Javier Achirica.
svn path=/trunk/; revision=3494
2001-06-01 01:15:29 +00:00
Guy Harris 6922a9986a Updates from Johan Jorgensen.
Don't use "pinfo->captured_len" to check the length of the packet -
that's the length of the *entire* frame, not the length of the portion
that belongs to the 802.11 dissector (there are currently no dissectors
for protocols in which 802.11 is encapsulated, so it doesn't currently
make a difference, but dissectors should use "tvb_length()" and so on to
get that information for the tvbuff they were handed).

svn path=/trunk/; revision=3483
2001-05-30 19:17:31 +00:00
Guy Harris 3c1508a6b3 Fix Gerald's e-mail address - and fix it in "README.developer", so
people don't blindly insert the old address into new dissectors, which
is probably how it got into the dissectors being fixed here.

svn path=/trunk/; revision=3348
2001-04-20 20:34:31 +00:00
Guy Harris 2aa31bea47 Move the declaration of "etype_vals[]" from "epan/packet.h" to
"etypes.h".

svn path=/trunk/; revision=3314
2001-04-17 06:43:21 +00:00
Guy Harris 29f1d4b093 Don't attempt to modify the data pointed to by the result of
"tvb_get_ptr()".

Display a "(B)" flag for supported rates that are in the BSSBasicRate
Set.

svn path=/trunk/; revision=3129
2001-03-15 05:39:04 +00:00
Gilbert Ramirez 5664e5887f Make tvb_get_ptr() return 'const guint8*', and clean up all the
usages of tvb_get_ptr(). packet-ieee80211.c still has one bad usage,
in which it *does* modify the tvbuff's data.

svn path=/trunk/; revision=3128
2001-03-13 21:34:28 +00:00
Guy Harris 562eae009f Updates from Johan Jorgensen:
Correct number of addresses shown in dataframes.
	Duration ID changed to "Association ID" in power-save polls
	Added sequence and fragment numbers.
	Corrected representation of frame-control flags.
	Added dissection of data frames with piggybacked CF-Ack, Poll but no
	data.
	Cleaned up code a bit (mostly empty lines)...

svn path=/trunk/; revision=2964
2001-02-01 06:20:25 +00:00
Guy Harris 11d33ec712 Fix forwarded by Johan Jorgensen of Axis Communications.
Also, print unsigned quantities with %u, not %d.

svn path=/trunk/; revision=2936
2001-01-23 05:54:09 +00:00