aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
AgeCommit message (Collapse)AuthorFilesLines
2004-02-01Fix some pointer typesJörg Mayer1-10/+10
svn path=/trunk/; revision=9930
2003-12-29Add a "saved_can_desegment" field to the "packet_info" structure, soGuy Harris1-1/+12
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-11-21From Olivier Biot:Guy Harris1-1/+11
* 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-16Export "protocol_t" as an opaque type.Guy Harris1-22/+22
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-09-09Add "dissector_get_string_handle()" for string dissector tables, similarGuy Harris1-1/+16
to "dissector_get_port_handle()" for uint dissector tables. svn path=/trunk/; revision=8434
2003-09-07Support string dissector tables in the Tethereal "decode as" stuff.Guy Harris1-4/+10
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-06When registering a dissector table, choose what type of hash andGuy Harris1-21/+309
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-08-12Save and restore the value of pinfo->current_proto when calling aTim Potter1-1/+12
dissector in call_dissector_through_handle(). svn path=/trunk/; revision=8160
2003-06-05From Lionel Ains: "-d" flag for decode-as support in Tethereal.Guy Harris1-9/+38
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-05-23Add an API to get the dissector name from a dissector handle.Guy Harris1-2/+9
svn path=/trunk/; revision=7726
2003-04-23Update to TCP to handle hints from dissectors where the next PDU may start.Ronnie Sahlberg1-1/+5
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-16Pull the stuff done in "dissect_packet()" to initialize a column_infoGuy Harris1-14/+3
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-16Add the notion of a "fence" to columns. A dissector can set the fenceGuy Harris1-1/+2
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-03-01Completely initialize all the address fields in a packet_info structure,Guy Harris1-1/+13
setting the length to 0 and the data pointer to a null pointer. svn path=/trunk/; revision=7239
2003-02-27From Didier Gautheron: provide a mechanism to indicate why reassemblyGuy Harris1-1/+2
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-01-22From Dinesh Dutt:Guy Harris1-1/+4
- 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-20Move into "call_dissector_work()" the stuff to handle dissecting, inGuy Harris1-12/+110
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
2002-12-08From Dinesh Dutt: Add Fibre Channel support, including FCIP, Basic FCGerald Combs1-1/+4
header, Extended Link Service, Interswitch Link Service, FCP, and IPFC. svn path=/trunk/; revision=6757
2002-11-16At least in my compile environment, we don't need "inet_v6defs.h" toGuy Harris1-5/+1
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-15From Chris Waters: export "find_dissector_table()" and addGuy Harris1-2/+9
"dissector_handle_get_protocol_index()". svn path=/trunk/; revision=6633
2002-10-29Don't return 0 from "call_dissector_work()" if the packet was dissectedGuy Harris1-1/+9
by the dissector we handed off to, even if the tvbuff we handed them was empty. svn path=/trunk/; revision=6518
2002-10-28Hoist the bulk of the stuff involved in calling a dissector through aGuy Harris1-60/+65
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-22Add in a notion of "circuits", which are for virtual circuit-orientedGuy Harris1-1/+6
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-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-8/+8
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6116
2002-08-24Before dissecting a packet, clear the filter field and value stored withGuy Harris1-1/+3
each column for use by the "Match Selected" and "Prepare Selected" functions in the packet list pane. svn path=/trunk/; revision=6080
2002-08-21Moved the generic true_false_string saying "Set", "Not set" intoTim Potter1-1/+6
epan/packet.c It was cut and pasted into seven other dissectors! svn path=/trunk/; revision=6052
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-22/+2
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-07-17From Joerg Mayer:Guy Harris1-5/+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-23WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3'sGuy Harris1-3/+3
<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-04Get rid of the "data_src" member of the "frame_data" structure; put itGuy Harris1-8/+9
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-15Get rid of an assigned-to-but-not-used variable, and eliminate anotherGuy Harris1-8/+2
variable that's used only once. svn path=/trunk/; revision=5479
2002-05-10Mark an unused argument as such.Guy Harris1-4/+4
Fix a couple of typos in comments. svn path=/trunk/; revision=5439
2002-05-09Merge the work in Novell_NCP_branch into the mainline code.Gilbert Ramirez1-1/+34
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-04-28Add routines to create anonymous handles for new-style dissectors (onesGuy Harris1-1/+15
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-03-28Initialize the fields of "edt->pi" in order - and initialize some fieldsGuy Harris1-15/+15
that weren't being initialized. svn path=/trunk/; revision=5034
2002-03-02From Joerg Mayer: get rid of "-Wno-unused" flag in some configureGuy Harris1-4/+5
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-02-27From Joerg Mayer: remove unused variables and declarations ofGuy Harris1-2/+1
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-27Fix "create_dissector_handle()" to properly create a handle for anGuy Harris1-2/+3
old-style dissector. svn path=/trunk/; revision=4816
2002-02-26Allow dissectors to be registered as "old-style" or "new-style"Guy Harris1-14/+69
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-25Note that we could save some overhead if we require the name argument toGuy Harris1-1/+6
"add_new_data_source()" to be a string constant (or some other static data item). svn path=/trunk/; revision=4803
2002-02-24Get rid of "init_all_protocols()"; instead, have a routineGuy Harris1-4/+15
"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-18Don't give tvbuffs names; instead, give data sources names, where aGuy Harris1-3/+43
"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-17With the tvbuffication of all dissectors, the "packet_info" structure noGuy Harris1-4/+4
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-11dissect_frame() can throw a ReportedBoundsError; catch it inGilbert Ramirez1-4/+9
dissect_packet(). svn path=/trunk/; revision=4720
2002-01-17Use the "fragmented" field of the "packet_info" structure inGuy Harris1-2/+3
"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-05Long NCP traces can easily have many packets whose "uniqueness"Gilbert Ramirez1-1/+32
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
2001-12-18Provide for per-protocol-tree data in the proto_tree code.Gilbert Ramirez1-1/+2
Put a hash-table of "interesting" fields in the per-proto-tree data. The dfilter code records which fields/protocols are "interesting" (by which I mean, their value or existence is checked). Thus, the proto_tree routines can create special arrays of field_info*'s that are ready for the dfilter engine to use during a filter operation. Also store the "proto_tree_is_visible" boolean, renamed "visible", in the per-proto-tree data. Move epan_dissect_t to its own header file to make #include dependencies easier to handle. Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t* as an argument. epan_dissect_new() needs to be followed by epan_dissect_run() for the dissection to actually take place. Between those two calls, epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to prime the empty proto_tree with the "intersesting" fields from the dfilter_t. svn path=/trunk/; revision=4422
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-3/+13
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-08Clean up indentation.Guy Harris1-20/+20
svn path=/trunk/; revision=4362
2001-12-08Attach a descriptive name field type and base to dissector tables; thatGuy Harris1-5/+44
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