aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tap.c
AgeCommit message (Collapse)AuthorFilesLines
2016-09-28When regestering taps, only loop trough the list of taps once when addingAndersBroman1-7/+11
new taps. Change-Id: Ida5ad2375c95664ee1b911d265cb69672db2be2d Reviewed-on: https://code.wireshark.org/review/17964 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-26Fix some of the checkAPIs.pl warnings for g_warning.Michael Mann1-1/+2
1. Create ws_g_warning for legitimate uses of g_warning 2. Use proto_tree_add_debug_text 3. Comment some out Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5 Reviewed-on: https://code.wireshark.org/review/16678 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-05tap: check return value (CID 1355643).Dario Lombardo1-1/+3
Change-Id: I03b141c7aeaa1bc06dc126c5cc8f0d001a57c116 Reviewed-on: https://code.wireshark.org/review/16302 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-19Revert "tap: change glib functions to wmem."Pascal Quantin1-23/+25
This reverts commit 2e9f3c5d366eaa7139fc877b5301392166b3f985. It breaks the registration of codec, dissector and libwiretap plugins. Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de Reviewed-on: https://code.wireshark.org/review/16012 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-17tap: change glib functions to wmem.Dario Lombardo1-25/+23
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf Reviewed-on: https://code.wireshark.org/review/15270 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-04Include ws_diag_control.h in config.hJoão Valverde1-3/+1
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317 Reviewed-on: https://code.wireshark.org/review/14749 Petri-Dish: João Valverde <j@v6e.pt> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-25Move the proto data stuff out of frame_data.[ch].Guy Harris1-0/+4
It's not tied to the frame_data structure any more, so it belongs by itself. Clean up some #includes while we're at it; in particular, frame_data.h doesn't use anything related to tvbuffs, so don't have it gratuitiously include tvbuff.h. Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c Reviewed-on: https://code.wireshark.org/review/13518 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12Fix warnings for epan/tap.c [-Wcast-qual]João Valverde1-40/+51
tap_listener queue is declared volatile. Assignment with cast to non-volatile generates compiler warnings. Change-Id: I3a2954f0d6ecfd7862ee0d9c1820cf737128a3c5 Reviewed-on: https://code.wireshark.org/review/13076 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
2016-01-08Fix warning for epan/tap.c [-Wpedantic]João Valverde1-0/+3
Disable ISO C compatibility warning when loading an external symbol. Change-Id: I85e0be1664a4f77983636a4bab559af2f79321aa Reviewed-on: https://code.wireshark.org/review/13132 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2015-08-19Recompile dfilter for all tap listeners when fields changedStig Bjørlykke1-0/+30
When fields have changed the compiled display filter may be invalid or need a recompile to be valid. Filters which are not valid after a recompile is set to a filter matching no packets (frame.number == 0) to indicate that this does no longer match anything. We should probably have a better filter matching no packet for this purpose. Change-Id: Id27efa9f46e77e20df50d7366f26d5cada186f93 Reviewed-on: https://code.wireshark.org/review/10123 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-06-27Avoid some Visual Studio Code Anaylzer warningsMartin Mathieson1-1/+1
Change-Id: I320386b02bea09658636a9281ee3cbba34a5e4cd Reviewed-on: https://code.wireshark.org/review/9188 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-16Have per-queued-packet flags, including "is a packet in error".Guy Harris1-2/+31
The contents of the packet_info structure change during the dissection process, so you can't rely on its contents when running tap listeners. Bug: 11184 Change-Id: I52fc45774add56ee2bcb5faef2af7c731b4304fd Reviewed-on: https://code.wireshark.org/review/8486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-16tap: Add ability to reject/ignore "error" packets in tapEvan Huus1-8/+12
ICMP (and a few other protocols) can carry "error packets" as payloads in certain cases. In the same way that we don't (by default) call TCP reassembly code on TCP packets we know are out-of-order, we also shouldn't call tap code on frames carried in ICMP error packets. Bug: 11184 Change-Id: Ie83dbb505c8fdc15c5554705488c16fa0274a06a Reviewed-on: https://code.wireshark.org/review/8446 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-4/+8
Have dfilter_compile() take an additional gchar ** argument, pointing to a gchar * item that, on error, gets set to point to a g_malloc()ed error string. That removes one bit of global state from the display filter parser, and doesn't impose a fixed limit on the error message strings. Have fvalue_from_string() and fvalue_from_unparsed() take a gchar ** argument, pointer to a gchar * item, rather than an error-reporting function, and set the gchar * item to point to a g_malloc()ed error string on an error. Allow either gchar ** argument to be null; if the argument is null, no error message is allocated or provided. Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c Reviewed-on: https://code.wireshark.org/review/6608 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10Add editor modelines; Adjust whitespace as needed.Bill Meier1-1/+14
Change-Id: I3dc57f4c2ca57585103e3b71503ac4c332903e50 Reviewed-on: https://code.wireshark.org/review/4594 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-14Increase tap limit to 5000Michal Labedzki1-1/+1
This will fix "Warn Too many taps queued" information, while there is more then 100 PDUs to be exported. For example while exporting Logcat from TCP/IP it is quite often to have PDU with multiple Logcat PDUs around 1000. Change-Id: I24d0619e57ae494c836c19c8a67df44503c54318 Reviewed-on: https://code.wireshark.org/review/1096 Reviewed-by: Alexis La Goutte <alexis.lagoutte@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/+14
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>
2013-12-02Move most of the plugin code from epan to wsutil and remove allGuy Harris1-2/+71
knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
2013-03-20 From beroset:Bill Meier1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-05-12Fix the test.sh failures based on Guy's suggestion in ↵Jeff Morriss1-3/+14
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5445#c15 : Add a new tap flag to indicate that a tap listener is just a "dissector helper", that is, a tap which is used by a dissector to help it do its dissection but does not, itself, require dissection. Use this new flag in the dissectors which register taps. Remove the (now-unused) have_tap_listeners() function. svn path=/trunk/; revision=37069
2011-03-31(Trivial) Fix some typos; do some whitespace cleanup & rewording of comments.Bill Meier1-26/+26
svn path=/trunk/; revision=36417
2010-08-03(Trivial) Fix a typo.Bill Meier1-1/+1
svn path=/trunk/; revision=33700
2009-10-02Prime interesting fields when selecting a package, so Lua's ProtoFieldStig Bjørlykke1-9/+20
can extract the field value correctly. This fixes bug 4058. svn path=/trunk/; revision=30252
2009-08-21Sanitize epan includesKovarththanan Rajaratnam1-2/+2
svn path=/trunk/; revision=29502
2009-06-05Have tap listeners specify whether the "packet" routine requiresGuy Harris1-19/+42
a protocol tree; the column values. This includes stats-tree listeners. Have the routines to build the packet list, and to retap packets, honor those requirements. This means that cf_retap_packets() no longer needs an argument to specify whether to construct the column values or not, so get rid of that argument. This also means that there's no need for a tap to have a fake filter to ensure that the protocol tree will be built, so don't set up a fake "frame" filter. While we're at it, clean up some cases where "no filter" was represented as a null string rather than a null pointer. Have a routine to return an indication of the number of tap listeners with filters; use that rather than the global num_tap_filters. Clean up some indentation and some gboolean vs. gint items. svn path=/trunk/; revision=28645
2008-08-21From Neil Piercy:Anders Broman1-1/+7
Patch to tap.c which simply returns the same tap_id if the register_tap is called twice with the same name - I can't see any downside to this. ( Needed for the gsm_a split -Anders). svn path=/trunk/; revision=26051
2008-05-05Fix some of the Errors/warnings detected by checkapi,Anders Broman1-3/+3
make non ASCII char a warning for now. svn path=/trunk/; revision=25240
2008-02-17Added an option to Conversations and Endpoints to limit the list to matchStig Bjørlykke1-0/+47
the current display filter. Some Hosts -> Endpoints cleanup. svn path=/trunk/; revision=24368
2007-03-06Introduce a new function called have_tap_listener(int tap_id) toStephen Fisher1-0/+16
tell if a specific tap id is currently listening for data. This complements the function have_tap_listeners(), which checks to see if any tap is currently listening. svn path=/trunk/; revision=20979
2007-02-19fetch_tapped_data() returns a const pointer, so declare the function as ↵Jeff Morriss1-1/+1
returning such svn path=/trunk/; revision=20861
2006-12-11Do bounds checking on tap_packet_array.Guy Harris1-0/+8
svn path=/trunk/; revision=20106
2006-05-28Ethereal->WiresharkAnders Broman1-1/+1
svn path=/trunk/; revision=18234
2006-05-21name changeRonnie Sahlberg1-3/+3
svn path=/trunk/; revision=18197
2005-12-07new function fetch_tapped_data()Ronnie Sahlberg1-0/+44
This function can be called from a dissector to fetch (if any) tapped data from a tap. This can offer an alternative method of passing data between different dissectors much cleaner than the pinfo pollition and private_data design mistake. The SMB2 dissector uses this method to extract vital data such as Account_Name from the ntlmssp dissector (that is 3 leveld down from smb2) svn path=/trunk/; revision=16722
2005-08-19Move the APIs for registering and processing "-z" command-line argumentsGuy Harris1-86/+0
and "Statistics" menu items into "stat.h" and "stat.c", to separate them from the core tapping APIs. A tap could conceivably not register as a "-z" command-line argument or "Statistics" menu item, and a stat could conceivably not be implemented as a tap, and dissectors that implement tapping points don't need the UI-related stuff from "stat.h", they just want the tap-related stuff in <epan/tap.h>. svn path=/trunk/; revision=15427
2005-08-06Squelch more const warnings (and fix some memory leaks that found).Guy Harris1-2/+2
_U_-ify some unused arguments, rather than assigning them to themselves. Un-constify one variable that gets assigned a mallocated pointer. Clean up indentation. svn path=/trunk/; revision=15236
2005-08-05replace malloc and alike calls by their GLib pendants -> g_mallocUlf Lamping1-1/+1
svn path=/trunk/; revision=15232
2005-08-05More char -> const char warning fixesJörg Mayer1-1/+1
svn path=/trunk/; revision=15218
2005-07-23More 'char*' -> 'const char*' changes to fix warnings.Jörg Mayer1-4/+4
svn path=/trunk/; revision=15015
2005-07-21More warining fixes: char -> const charJörg Mayer1-1/+1
svn path=/trunk/; revision=14975
2005-04-01from Lars RRonnie Sahlberg1-35/+12
TAP order of caller update svn path=/trunk/; revision=14001
2005-04-01Rename "register_ethereal_tap()" to "register_tap_listener_cmd_arg()" asGuy Harris1-0/+84
it's used to register a callback for a tap listener invoked if the specified command line argument is specified to the "-z" flag. Move it, along with routines to: look up a "-z" argument in the table constructed by "register_tap_listener_cmd_arg()" and either save the full argument to "-z" and the corresponding listener if it's found or return a failure indication if it isn't; list the available tap listeners; call the "init" routines for the tap listeners saved in the table above; and have Ethereal and Tethereal use those routines. svn path=/trunk/; revision=13993
2005-03-11from metzeRonnie Sahlberg1-0/+3
various bugfixes and enhancements to decryption of secure ldap svn path=/trunk/; revision=13710
2004-12-30Add a "get_addr_name()" routine that takes an "address *" and attemptsGuy Harris1-2/+2
to resolve it to a name. Fix up some const-pointer-to-non-const-pointer, and function-pointer-to-void-*, conversions. Fix some comments. svn path=/trunk/; revision=12863
2004-09-29Move the tap infrastructure to the epan directory.Guy Harris1-0/+432
svn path=/trunk/; revision=12128