aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ieee80211.c
AgeCommit message (Collapse)AuthorFilesLines
2003-08-28Make "process_reassembled_data()" do the check for fragmentation notGuy Harris1-30/+4
being complete and for fragmentation being trivial (i.e., the packet in question is both the first and last fragment). Have its callers *not* do that check - this lets "process_reassembled_data()" put in the "Reassembled in" item for fragments other than the last fragment. Add a "Reassembled in" field to TDS. svn path=/trunk/; revision=8295
2003-08-26Make the CRC-32 routines take a tvbuff and a length as arguments.Guy Harris1-2/+2
Rename "crc32()" so as not to collide with the one in zlib; rename "crc32_802()" to match. svn path=/trunk/; revision=8268
2003-08-26From Jesper Peterson:Guy Harris1-2/+2
Extract the FCS decoding section of the PPP_HDLC dissector to allow the CHDLC dissector to use the same routine. The ppp_options used for preferences has been renamed to fcs_options and exported via packet-ppp.h so CHDLC gets a separate (but identical) FCS preference. This means prefs.h has to be included before packet-ppp.h so a couple of ppp related files (packet-{gtp,null,raw,vj}.c) had their includes slightly re-arranged. From me: make the PPP/CHDLC FCS code use "crc32()" to check the 32-bit FCS. svn path=/trunk/; revision=8266
2003-08-26Extract the CRC-32 code from the 802.11 dissector into a separate file,Guy Harris1-78/+3
and use it in the Ethernet dissector as well, to check the FCS in Ethernet frames, if present. svn path=/trunk/; revision=8265
2003-06-24From Motonori Shindo:Guy Harris1-10/+13
parse the WEP keys every time they're changed, not just when we start up; make the description of the WEP keys in the preference more accurate. svn path=/trunk/; revision=7922
2003-06-05From Lars Roland: Replace bcmp() with memcmp(), add a missing quote to theGerald Combs1-7/+7
NSIS definition file. svn path=/trunk/; revision=7793
2003-06-03From Jeff Liu: Add support for WPA (Wi-Fi Protected Access) key in EAPOLGerald Combs1-2/+131
frames and WPA IE in 802.11 beacon and probe response frames. svn path=/trunk/; revision=7770
2003-05-28From Laurent Rabret: use "g_free()", not "free()", to free stuffGuy Harris1-2/+2
allocated with "g_malloc()" and related GLib routines. svn path=/trunk/; revision=7758
2003-05-25The last byte of "foo[N]" is "foo[N-1]", not "foo[N]".Guy Harris1-2/+2
svn path=/trunk/; revision=7740
2003-05-24Fix instances where the return value of snprintf() was being checked for -1,Gerald Combs1-3/+4
but not for <buf_size> or greater. Discovered by Timo Sirainen. svn path=/trunk/; revision=7731
2003-04-27Replace some unchecked malloc calls by g_malloc.Laurent Deniel1-6/+4
svn path=/trunk/; revision=7584
2003-04-20Add a pointer to an hf_ value for a "reassembled_in" field (which can beGuy Harris1-7/+9
null) to the "fragment_items" structure, and don't pass that value into "process_reassembled_data()", just have it use the value in the "fragment_items" structure passed to it. Make "process_reassembled_data()" capable of handling reassembly done by "fragment_add_seq_check()", and use it in the ATP and 802.11 dissectors; give them "reassembled_in" fields. Make "process_reassembled_data()" handle only the case of a completed reassembly (fd_head != NULL) so that we can use it in those dissectors without gunking the code up too much. svn path=/trunk/; revision=7513
2003-04-01From Solomon Peachy: add support for the latest stuff defined in theGuy Harris1-3/+15
draft 7.1 of 802.11g, plus a few response codes defined in 802.11b. svn path=/trunk/; revision=7392
2003-03-04When deciding whether we have enough data in a lower-level packet toGuy Harris1-2/+2
attempt reassembly of a higher-level packet that includes the lower-level packet, use "tvb_bytes_exist()" to check whether all the data that's to be included in the reassembly is available, rather than by checking whether the packet is short. Add some checks of that sort that were missing. Use the reported length of the packet when doing reassembly. Make the "iphdrlen" field of a "packet_info" structure be the length of the IP header in bytes, not in 4-byte words. svn path=/trunk/; revision=7274
2003-02-18From Martijn Schipper: fix the tag for the 802.11g ERP Information fieldGuy Harris1-2/+2
to match draft 6.1 of the 802.11g spec. svn path=/trunk/; revision=7168
2003-01-22Make all the stuff in the capability fixed field in a management frameGuy Harris1-34/+34
2-byte bitfields, as the capability field is 2 bytes long. svn path=/trunk/; revision=6980
2003-01-22From Jouni Malinen:Guy Harris1-3/+57
support for two new 802.11 elements used in the latest IEEE 802.11g draft version: ERP Information and Extended Support Rates; two new capabilities flags. svn path=/trunk/; revision=6978
2002-12-19Update reassemble.c/show_item and all callers to use FT_FRAMENUM for the ↵Ronnie Sahlberg1-3/+3
list of packets corresponding to a reassembled pdu svn path=/trunk/; revision=6807
2002-11-06From Solomon Peachy: support for new "wlancap" 802.11 extra-informationGuy Harris1-3/+3
header. Add overflow checks to "BYTES_ARE_IN_FRAME()", and cast all arguments to unsigned values (negative values should never be passed) to squelch compiler warnings. svn path=/trunk/; revision=6567
2002-10-31From Chris Waters: put the "wlan.fc.fromds" and "wlan.fc.tods" fieldsGuy Harris1-5/+9
into the protocol tree. svn path=/trunk/; revision=6524
2002-10-24Add a "fragment_add_seq_next()" to reassemble fragments that don't haveGuy Harris1-2/+2
sequence numbers or offsets and are thus assumed to be received in order with no duplicates or dropped fragments (e.g., for NetBIOS Frame, where 802.2 LLC guarantees in-order delivery to NetBIOS with no duplicates or dropped fragments). "show_fragment_tree()' and "show_fragment_seq_tree()" don't modify the "fragment_items" to which the "fit" argument points, so make that argument a "const fragment_items *". Make all the "fragment_items" tables "static" (as they're not used outside the modules defining them) and "const" (as they're not modified). Add support for reassembly of NetBIOS fragmented requests and responses. Get rid of an unnecessary include of "packet-tr.c" in the NetBIOS dissector, and make its table of dissection function pointers static. Fix some typos in the AppleTalk and NetBIOS dissectors. svn path=/trunk/; revision=6491
2002-10-21From Solomon Peachy: display "(correct)" or "(not verified)" for the WEPGuy Harris1-5/+17
ICV, depending on whether it was successfully verified or not. svn path=/trunk/; revision=6464
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-25/+25
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-12/+4
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-07-31From Chris Waters: check 802.11 FCS if present.Guy Harris1-3/+36
svn path=/trunk/; revision=5918
2002-07-17From Joerg Mayer:Guy Harris1-6/+1
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-06-22Fetch the WEP IV before building a subtree for the WEP parameters, so weGuy Harris1-9/+16
don't end up with an empty tree for the parameters. Fetch the IV and key regardless of whether we're building a protocol tree; that ensures that we know we have the IV/key before we try to dissect stuff after it. svn path=/trunk/; revision=5741
2002-06-22"uint" is defined on all platforms; use "guint" instead.Guy Harris1-2/+2
svn path=/trunk/; revision=5735
2002-06-19Fix to WEP decoding, from Solomon Peachy.Guy Harris1-8/+5
svn path=/trunk/; revision=5706
2002-06-19Fix some bugs in the dissection of WEP-encrypted frames.Guy Harris1-26/+40
Put the WEP header tree under the top-level 802.11 tree, rather than putting it at the top level itself. svn path=/trunk/; revision=5702
2002-06-18From Solomon Peachy: do WEP decryption before reassembly.Guy Harris1-104/+107
Use "memset()" rather than "bzero()", as "memset()" is the official ANSI C routine (and you get an error when compiling with MSVC++ if you use "bzero()"). svn path=/trunk/; revision=5699
2002-06-18From Solomon Peachy: WEP cleanups, WEP decryption support and otherGuy Harris1-171/+558
mangling of the 802.11 dissector, and optional processing of an FCS at the end of the frame. When dissecting the frame-type-dependent part of the header, dissect all management frames (including ones with an invalid subtype) the same, and dissect all data frames (including ones with an invalid subtype) the same. svn path=/trunk/; revision=5696
2002-06-07Add "show_fragment_seq_tree()", which is like "show_fragment_tree()",Guy Harris1-64/+16
but for stuff reassembled with "fragment_add_seq()" or "fragment_add_seq_check()". Add a "fragment tag" string to the "fragment_items", so that packets with fragmentation errors can be properly flagged as having "Illegal fragments" or "Illegal segments" depending on the term used with the protocol in question. Make all the dissectors that can use "show_fragment_tree()" or "show_fragment_seq_tree()", and don't already use them, do so. svn path=/trunk/; revision=5644
2002-06-04Get rid of the "data_src" member of the "frame_data" structure; put itGuy Harris1-2/+2
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-05-30Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourthGuy Harris1-2/+4
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to run to the end of the parent tvbuff. svn path=/trunk/; revision=5597
2002-05-01Fix an error in a blurb.Guy Harris1-2/+2
svn path=/trunk/; revision=5327
2002-04-24From Joerg Mayer: get rid of extra arguments to capture routines.Guy Harris1-2/+2
svn path=/trunk/; revision=5233
2002-04-22Get rid of some unused variables and arguments.Guy Harris1-2/+1
svn path=/trunk/; revision=5221
2002-04-17Don't try to reassemble short frames - but do still pass them through atGuy Harris1-3/+1
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-17Fix up the handling of the "fragmented" flag in the "packet_info"Guy Harris1-13/+26
structure (make it match the way it's done in the IP dissector). svn path=/trunk/; revision=5184
2002-04-17Show the "More Fragments" indicator as such, rather than as a "this isGuy Harris1-4/+4
fragmented" vs. "this is not fragmented" indicator. svn path=/trunk/; revision=5182
2002-04-17Add a separate hash table to the reassembly code for reassembledGuy Harris1-34/+255
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-13From Jouni Malinen:Guy Harris1-3/+11
Fix offset of challenge element in 802.11 dissector. Show fragmented 802.11 frames as fragments. svn path=/trunk/; revision=5151
2002-04-08Add an encapsulation type for "802.11 with radio information"; that typeGuy Harris1-5/+59
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-03-09From Jouni Malinen: fix bugs in 802.11 authentication frame dissection.Guy Harris1-3/+3
svn path=/trunk/; revision=4902
2002-02-22Properly handle the "no data" data frames.Guy Harris1-2/+20
svn path=/trunk/; revision=4774
2002-02-21The number of bytes of tagged parameters should be computed by seeingGuy Harris1-9/+9
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-01-28Some capture formats for 802.11 have fixed-length link-layer headersGuy Harris1-6/+52
(padded to the maximum length); add code to handle that. svn path=/trunk/; revision=4614
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-2/+2
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-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-5/+5
"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