summaryrefslogtreecommitdiff
path: root/extcap.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-05extcap: Add regular expression validation supportRoland Knall1-3/+7
Regular expressions follow the Qt Regex syntax, which is formulated after the Perl Regex syntax. A more detailed overview of the possible rules can be found at: http://doc.qt.io/qt-4.8/qregexp.html If a required option is present, even the double-click on the interface will first start the options dialog (Qt only) Required fields are marked bold and put first in the dialog. Additionally if validation failes (which it will if a required field is kept empty, but also if a non-required textfield is violating the defined regex), the label of the field is marked with red. Change-Id: If04a1146d0dfa778332ab2a39122c7a6ee1e93d2 Reviewed-on: https://code.wireshark.org/review/12914 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-12-19extcap: plug some memleaksPeter Wu1-22/+33
The working directory for g_spawn_sync should not be escaped, it is simply passed to chdir. The escaping was needed for the command, so do so (hmm... maybe the argv arguments should be escaped too for Windows). Also remove an unnecessary NULL command argument for extcap_foreach. Note: there is still a memleak when exiting because the ifaces table is not cleared after querying the list. Change-Id: I1251d623b954a81848044b6d1faf8dcec8ce465b Reviewed-on: https://code.wireshark.org/review/12530 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>
2015-11-17extcap: fix a crash introduced in g622603bPascal Quantin1-1/+1
When using GTK UI, cfilter is initialized to NULL, not to an empty string. Change-Id: Ic9f3957d4de551a929578e76d5b9c63936517299 Reviewed-on: https://code.wireshark.org/review/11910 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-17extcap: fix a bug in cfilterDario Lombardo1-1/+1
When no filter is specified, interface_opts.cfilter is not null but an empty string. Change-Id: I5755ab7dd840be28334768cf26999048441fcc4e Reviewed-on: https://code.wireshark.org/review/11907 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-05extcap: Provide capture filter to extcap binaryStig Bjørlykke1-0/+4
Added the option --extcap-capture-filter to extcap to send the capture filter from the main screen to the extcap binary. Change-Id: I75f0d7dbec810551225377f9221053298488cdd5 Reviewed-on: https://code.wireshark.org/review/11423 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-10-12extcap: fix a bug in create_tempfile() return check (CID 1323930)Dario Lombardo1-1/+1
Change-Id: Ifacdfee5c12e676969cfe536dfeda2be93426a46 Reviewed-on: https://code.wireshark.org/review/10929 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-02The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris1-11/+11
It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that. Replace all-caps "WIN32" referring to Windows in comments and other text with "Windows" or "Win32". (The two are pretty much equivalent, these days; nobody much cares about Win16, not that we ever ran on it, and 64-bit Windows is just a 64-bitified Win32.) Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70 Reviewed-on: https://code.wireshark.org/review/10367 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-05extcap: Implement QT extcap optionsRoland Knall1-0/+26
Implementing a button in the interface list, to bring up the extcap options dialog, as well as a dialog, which will be generated depending on the selected extcap options. Change-Id: I1733dc6a8c1a121089a9c353aff10bc4a53e86de Reviewed-on: https://code.wireshark.org/review/8224 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-16Extcap: fix logically dead code (CID 1232344)Alexis La Goutte1-3/+0
Change-Id: Ia6c178a9a5ec413004107f63c8dcaa38c19690b9 Reviewed-on: https://code.wireshark.org/review/8096 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-15Set the extcap working directory on Windows.Gerald Combs1-1/+23
On Windows, prepend the main program directory to %Path% when spawning extcap processes. This lets us place androiddump in extcap while allowing it to locate its DLLs. Change-Id: I406c47ce71323266d5f14fb596931398464e452d Reviewed-on: https://code.wireshark.org/review/8057 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-04-13dumpcap: fix opening of pipes on Windows broken since gbed29afPascal Quantin1-3/+0
Previous code was assuming that all local pipes were of extcap type. Let's explicitly check for extcap prefix now. Bug: 10803 Change-Id: If955e77a9ee2af11b553740269964c40273d5177 Reviewed-on: https://code.wireshark.org/review/8013 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-29Extcap: fix USBPcap capture broken by g8204578Pascal Quantin1-10/+1
g8204578 was not the right way to do things: if_type is used to identify an extcap interface Change-Id: Iead6c5e63f6874012c27ed7c1bf7152a5891ad65 Reviewed-on: https://code.wireshark.org/review/7849 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-27Extcap: display a USB icon when adding a USBPcap interfacePascal Quantin1-1/+10
Change-Id: Ibe78b115eb6e7e737a5dc9c8a7937b82d8cf76a8 Reviewed-on: https://code.wireshark.org/review/7830 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-13extcap: remove use of g_list_free_fullEvan Huus1-1/+7
It requires a newer glib than we support Change-Id: Id8f14d4188a9ba55e0a5196bb877e2fe6a0c8d3f Reviewed-on: https://code.wireshark.org/review/4652 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-12Fix double free.Tomasz Moń1-2/+2
This double free involves damaging GHashTable internals (key and value). Change-Id: I17c8a473b96ab28e611ccf79ddd2b3da56512184 Reviewed-on: https://code.wireshark.org/review/4629 Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Tomasz Moń <desowin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-12Fix handling of extcap boolflags which defaults to true.Tomasz Moń1-1/+63
Example: arg {number=0}{call=--test}{type=boolflag}{default=true} Before this change --test was never added to argument list (no matter if user left it selected or explicitly deselected it). After this change --test will be added to argument list unless user explicitly deselects it. Change-Id: Ia5bc11f900b03e630aba882ef918dcb7f0b79291 Reviewed-on: https://code.wireshark.org/review/4618 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-08Remove redundant and erroneous debug log message.Tomasz Moń1-2/+0
Change-Id: I91d6131b3b4b7ef670f0d188ebd6da3947c49bdc Reviewed-on: https://code.wireshark.org/review/4548 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-06Convert "4 space tabs" to spaces; Adjust editor modelines.Bill Meier1-521/+521
Change-Id: I8d61d959c79e6aa9875c58680c54a331d18079cc Reviewed-on: https://code.wireshark.org/review/4504 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-04Update capture_opts in extcap_cleanup().Tomasz Moń1-21/+11
This fixes redundant extcap_pid handle close that could occur in capture_opts_del_iface() which resulted in unhandled exception on Windows. Change-Id: I06b680fcb65cd6fd854a25fb1b01248dce3251a1 Reviewed-on: https://code.wireshark.org/review/4447 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-04Wait for extcap to connect to pipe on Windows.Tomasz Moń1-2/+128
This prevents dumpcap from failing with timeout exceeded error message with some extcaps (especially those that display UAC screen) by making sure that extcap connects to pipe before dumpcap is even started. Change-Id: I549da9217c7f4ae89509330ca4fa613a119a9523 Reviewed-on: https://code.wireshark.org/review/4428 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-03Fix memory leak and heap corruption on Windows.Tomasz Moń1-6/+6
LPSECURITY_ATTRIBUTES is type definition for pointer to SECURITY_ATTRIBUTES structure. Change-Id: I94a835bfd8f7eb76c808fac8286ca3f2db9b19c3 Reviewed-on: https://code.wireshark.org/review/4449 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-26Extcap: restore compatibility with GLib 2.16.0Pascal Quantin1-11/+13
While we are at it, fix what seem to be a memory leak in extcaps_init_initerfaces() Change-Id: I1bb9a1b44d16f986eedd192b15cce84c5881a917 Reviewed-on: https://code.wireshark.org/review/3820 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-24Modify includes of config.h so that out-of-tree builds, i.e. CMakeGraham Bloice1-2/+2
don't pick up the in-tree copy. Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71 Reviewed-on: https://code.wireshark.org/review/3798 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-21Extcap Capture InterfaceRoland Knall1-0/+654
Extcap is a plugin interface, which allows for the usage of external capture interfaces via pipes using a predefined configuration language which results in a graphical gui. This implementation seeks for a generic implementation, which results in a seamless integration with the current system, and does add all external interfaces as simple interfaces. Windows Note: Due to limitations with GTK and Windows, a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe is needed, which is part of any GTK windows installation. The default installation directory from the build is an extcap subdirectory underneath the run directory. The folder used by extcap may be viewed in the folders tab of the about dialog. The default installation directory for extcap plugins with a pre-build or installer version of wireshark is the extcap subdirectory underneath the main wireshark directory. For more information see: http://youtu.be/Nn84T506SwU bug #9009 Also take a look in doc/extcap_example.py for a Python-example and in extcap.pod for the arguments grammer. Todo: - Integrate with Qt - currently no GUI is generated, but the interfaces are still usable Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net> Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net> Signed-off-by: Roland Knall <rknall@gmail.com> Reviewed-on: https://code.wireshark.org/review/359 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>