aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.h
AgeCommit message (Collapse)AuthorFilesLines
2014-12-11Add a heur_dissector_table_foreach() function.Guy Harris1-0/+14
This is, for heuristic dissector tables, the equivalent of dissector_table_foreach() for keyed dissector tables. Change-Id: I4b2f870e1c1179fda1adddd93930b83aaaaf8763 Reviewed-on: https://code.wireshark.org/review/5715 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-11Give dissector_all_heur_tables_foreach_table() a sort function.Guy Harris1-4/+12
This makes it a bit more like dissector_all_tables_foreach_table. Improve comments and clean up whitespace while we're at it. Change-Id: I5147427f864add285e3bb6cb35ad9fa83bea516c Reviewed-on: https://code.wireshark.org/review/5714 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-11Make the type of the second argument to a DATFunc_heur_table explicit.Guy Harris1-3/+3
It's always pased a heur_dissector_list_t *, so give it that type, rather than having it be a generic pointer. Change-Id: Ia6a045bb1b96c2f6ef3e23f27928e0b52f7cfb9f Reviewed-on: https://code.wireshark.org/review/5713 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-11Fix a comment.Guy Harris1-5/+4
Change-Id: I46885d028fe9ff5254baefc15283626b9bdb6bce Reviewed-on: https://code.wireshark.org/review/5711 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-10Expose find_heur_dissector_list().Guy Harris1-0/+7
We already have find_dissector_table(); expose find_heur_dissector_list() as well, so that heuristic dissector lists can be shared. Change-Id: I3f50413b8b10fd3129fcdc2344cb1447f0946ce9 Reviewed-on: https://code.wireshark.org/review/5701 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-17Add tshark -G dissector-tables to dump a list of dissector tables.Guy Harris1-0/+4
That list doesn't show the entries in the dissector tables, just information about the tables themselves. Clean up some tshark man page issues while we're at it. Change-Id: I70beee34110f5c0d58105944dd71105a8400f5ca Reviewed-on: https://code.wireshark.org/review/5360 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-07ASN1: Added support for using #.REGISTER_NEWStig Bjørlykke1-3/+3
This will register BER PDU-dissectors as "new". Return number of bytes dissected from dissector_try_* functions. Return number of bytes dissected in DissectorTable:try() This will make it possible to get dissected length when using dissector_try_*() and dissected ASN.1 length in Lua when using DissectorTable:try() (as we already have for Dissector:call). Change-Id: Iee17a68dc214fa0fb50b25fc927026ad7c1cbce4 Reviewed-on: https://code.wireshark.org/review/4531 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-07Revert "ASN1: Added support for using #.REGISTER_NEW"Gerald Combs1-3/+3
This temporarily reverts commit acc09c2aa248d892ee6b894b43c79cb060131b11. Change-Id: I7a55c8c2da3f65e914b90648ee92c84efd57f1a0 Reviewed-on: https://code.wireshark.org/review/4525 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-07ASN1: Added support for using #.REGISTER_NEWStig Bjørlykke1-3/+3
This will register BER PDU-dissectors as "new". Return number of bytes dissected from dissector_try_* functions. Return number of bytes dissected in DissectorTable:try() This will make it possible to get dissected length when using dissector_try_*() and dissected ASN.1 length in Lua when using DissectorTable:try() (as we already have for Dissector:call). Change-Id: I8802a812bd484c1e8794c618b87e676003aea94a Reviewed-on: https://code.wireshark.org/review/4493 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-3/+7
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-25Add support for dissecting non-packet records.Guy Harris1-1/+1
Add a dissector table indexed by the file type, and, for the file-type-specific records, have the frame dissector skip the usual pseudo-header processing, as the pseudo-header has a file-type-specific record subtype in it, and call the dissector for that file type's records. Change-Id: Ibe97cf6340ffb0dabc08f355891bc346391b91f9 Reviewed-on: https://code.wireshark.org/review/1782 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris1-2/+2
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Fix -WdocumentationAlexis La Goutte1-1/+1
epan/packet.h:369:11: error: parameter 'returns' not found in the function declaration [-Werror,-Wdocumentation] Change-Id: Ieedd203c4e952ae0ac17273311163d25ab2da066 Reviewed-on: https://code.wireshark.org/review/1746 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-11/+23
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-14Add Lua heuristic dissector supportHadriel Kaplan1-1/+5
This adds the ability for Lua scripts to register heuristic dissectors for any protocol that has registered a heuristic dissector list, such as UDP, TCP, and ~50 others. The Lua function can also establish a conversation tied to its Proto dissector, to avoid having to check the heuristics for the same flow. The example dissector in the testsuite has also been enhanced to include a heuristic dissector, to verify the functionality and provide an example implementation. Change-Id: Ie232602779f43d3418fe8db09c61d5fc0b59597a Reviewed-on: https://code.wireshark.org/review/576 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-25Fix function prototypes.Evan Huus1-1/+1
Functions with no parameters must be written func(void). Fixes (some) of the buildbots. Change-Id: I1a6e5c0553e032e99419fe67eb4b573bbdfe7fe6 Reviewed-on: https://code.wireshark.org/review/388 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25Adds some Lua helper functions: some commonly used functions, and to help ↵Hadriel Kaplan1-0/+3
troubleshooting Lua scripts There are some common things people need to do, such as convert to/from hex or get the raw binary string in a ByteArray/Tvb/TvbRange. These have been added, as well as some tests for them in the testsuites. Also, functions have been added to allow a script to get all the available tap types and filter fields, since they are not exactly what one can see in the Wireshark gui. Change-Id: I92e5e4eae713bb90d79b0c024eaa4e55b99cc96b Reviewed-on: https://code.wireshark.org/review/249 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-30Add remove_last_data_source and fix bug 9169Evan Huus1-0/+2
The OP asked 9169 to be reopened because the capture was spewing ~40GB of output when dissected with tshark. Investigation showed this was because the HTTP dissector was requesting ONE_MORE_PACKET reassembly a lot, and TCP was adding each step as a data-source which was being printed by tshark's hex dump. This was leading to O(n^2) of output. To fix, introduce function remove_last_data_source which removes the most recent data source from the list. If the subdissector in TCP reassembly asks for ONE_MORE_PACKET, assume it hasn't added any tree items (since it shouldn't have) and remove the data source since it is unnecessary. This may break dissectors which add tree items and *then* return ONE_MORE_PACKET, since they will have their data source removed out from under them. I believe those cases should be fixed to not add tree items until they're sure they have enough data. Change-Id: Iff07f959b8b8bd1acda9bff03f7c8684901ba8aa Reviewed-on: https://code.wireshark.org/review/38 Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-01-08TFShark (Terminal Fileshark) v.001. Bug 9607 ↵Michael Mann1-0/+7
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9607) This is a VERY PRELIMINARY version of tfshark. It's an attempt to jumpstart FileShark and its architecture. Right now it's mostly just a very stripped down version of tshark with all of the necessary build modifications (including now building filetap library since tfshark depends on it) This code has helped me identify what I believe to be all of the necessary layers for a complete fileshark architecture. And those layers will slowly be added in time (patches always welcome!). svn path=/trunk/; revision=54646
2013-12-22Avoid including definition of column_info structure in dissectors.Jakub Zawadzki1-1/+0
Move COL_* enum to <epan/column-utils.h> XXX Later we can rename epan/column-info.h to column-int.h (or smth like this) svn path=/trunk/; revision=54352
2013-12-20Avoid including <epan/range.h> in dissectors.Jakub Zawadzki1-3/+4
svn path=/trunk/; revision=54315
2013-12-10Get the "Decode As" dialog working, albeit with a few warts. It differsGerald Combs1-4/+34
from the GTK flavor in two major ways: - The "Decode As" and "User Specified Decodes" dialog have been unified. - You can modify the decode as behavior at any time, not just when you have a packet selected. Revert part of 53498 so that we can move items marked /*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/ from epan/decode_as.h to ui/decode_as_utils.h. Move "save" code from decode_as_dlg.c to decode_as_utils.c as well. In packet-dcerpc.c don't register a table named "ethertype". We might want to add checks for duplicate table names. To do: - Add support for ranges? - Either add support for DCERPC or make DCERPC use a regular dissector table. - Fix string selectors (i.e. BER). svn path=/trunk/; revision=53910
2013-12-03Avoid including <epan/epan.h> in dissectors.Jakub Zawadzki1-2/+1
svn path=/trunk/; revision=53774
2013-12-03FixAlexis La Goutte1-1/+1
warning: argument 'data' of command @param is not found in the argument list of dissector_all_tables_foreach_changed(DATFunc func, gpointer user_data) warning: The following parameters of dissector_all_tables_foreach_changed(DATFunc func, gpointer user_data) are not documented: parameter 'user_data' svn path=/trunk/; revision=53749
2013-11-29Avoid including <wiretap/wtap.h> in dissectors.Jakub Zawadzki1-1/+0
svn path=/trunk/; revision=53655
2013-11-22Move common "decode as" preference code to epan.Gerald Combs1-3/+60
We presumably want "decode as" behavior to be consistent across UIs so call load_decode_as_entries() from read_prefs(). svn path=/trunk/; revision=53498
2013-11-20Convert ethertype() function into a pure dissector. Bug 9454 ↵Michael Mann1-3/+10
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9454) The main driving force for this was my new Decode As functionality (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) that wants a dissector/subdissector table relationship for all dissectors wanting to use Decode As functionality. The ethertype() function provides the value to the "ethertype" subdissector table, so I think it should be matched to a dissector. Only odd side effect is the display filter of "ethertype" returns no packets because there is no "item" associated with the dissector. svn path=/trunk/; revision=53443
2013-11-09include <wsutil/pint.h> only when needed.Jakub Zawadzki1-1/+0
svn path=/trunk/; revision=53196
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-1/+0
svn path=/trunk/; revision=53189
2013-11-02Require dissector_try_string to pass a data parameter to its subdissectors. ↵Michael Mann1-6/+0
There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new. svn path=/trunk/; revision=53049
2013-10-30Allow string-based dissector tables to pass data between dissectors.Michael Mann1-0/+6
svn path=/trunk/; revision=52980
2013-10-18After looking for something in the column-*.h files andJörg Mayer1-1/+1
not finding it, I finally found it in column_info.h Renamed column_info.h to column-info.h to have consistency with the column*h files. svn path=/trunk/; revision=52667
2013-09-20Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9164 :Pascal Quantin1-2/+2
Add dissector_try_uint_new() to the list of exported symbols svn path=/trunk/; revision=52159
2013-09-09Added dissector_delete_all() to remove all entries from a dissector table.Stig Bjørlykke1-0/+3
svn path=/trunk/; revision=51859
2013-08-25Simplify adding and deletetion of port ranges by adding new methods.Anders Broman1-0/+9
If no one has any objection I'll edit the deocumentation later. svn path=/trunk/; revision=51517
2013-08-17Another tv_buff reference.Guy Harris1-1/+1
svn path=/trunk/; revision=51406
2013-08-17Just call it a tvbuff, with no underscore.Guy Harris1-1/+1
svn path=/trunk/; revision=51405
2013-08-13Create the dissector hash table in only one place, and specify that its valuesEvan Huus1-0/+1
should be freed when it is destroyed. This requires splitting packet_init in two: the hash table which must be created before protocol registration, and the caching of common protocol handles, which must happen after registration. svn path=/trunk/; revision=51329
2013-08-05Dissector handle after [new_]register_dissector can be get by ↵Jakub Zawadzki1-2/+2
find_dissector() so to avoid some extra calls just return it. svn path=/trunk/; revision=51154
2013-08-01Move a bunch of the crypt modules and pint.h into wsutil.Jeff Morriss1-1/+1
This means wsutil now links against libcrypt. Protect a bunch of the crypt header files from multiple inclusion. svn path=/trunk/; revision=51100
2013-07-21Some work on multi file dissectionJakub Zawadzki1-2/+2
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-11packet dissection now takes pointer to tvb instead of guint8 dataJakub Zawadzki1-1/+1
implement frame_tvbuff, right now almost a copy of 'real' tvb. svn path=/trunk/; revision=50497
2013-06-18Add ability to export decrypted SSL/DTLS PDUsPascal Quantin1-0/+3
svn path=/trunk/; revision=50001
2013-05-30Add Doxygen boilerplate for some of our core modules and data structures.Gerald Combs1-0/+7
svn path=/trunk/; revision=49640
2013-04-26Fix a whole bunch of doxygen warnings, mostly typos or renamed parameters.Evan Huus1-1/+1
svn path=/trunk/; revision=49053
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-56/+57
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2012-10-30Update the Qt byte view widget to reflect the recent changes in the GTK+Gerald Combs1-6/+0
byte view. Move the packet_char_enc enum from packet.h to frame_data.h. Make the encoding flag a packet_char_enc and make it one bit. Get rid of the "cfile" global in a few places. C++-ize some of the font code. Clean up some variable names. svn path=/trunk/; revision=45838
2012-10-20Make data_source opqaue, add getter for tvb.Jakub Zawadzki1-2/+5
svn path=/trunk/; revision=45672
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-1/+1
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601