aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_parser.h
AgeCommit message (Collapse)AuthorFilesLines
2017-04-25Qt: Add interface toolbar supportStig Bjørlykke1-3/+6
An extcap utility can provide configuration for controls to use in a GUI interface toolbar. This controls are bidirectional and can be used to control the extcap utility while capturing. This is useful in scenarios where configuration can be done based on findings in the capture process, setting temporary values or give other inputs without restarting current capture. Todo: - Add support for Windows Change-Id: Ie15fa67f92eb27d8b73df6bb36f66b9a7d81932d Reviewed-on: https://code.wireshark.org/review/19982 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>
2017-02-02Qt: Add extcap placeholder parameterStig Bjørlykke1-0/+2
Added a parameter to set placeholder text in textBox. Change-Id: Iccf92fe60abc78be8f0fa112c0c9eb78890674b5 Reviewed-on: https://code.wireshark.org/review/12463 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-12-09extcap: add new option type (timestamp).Dario Lombardo1-1/+2
Bug: 12787 Change-Id: I941833c55fb607c8af2ef832082af58d7b94e965 Reviewed-on: https://code.wireshark.org/review/18721 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-11extcap: fix use-after-free for preferencesPeter Wu1-1/+1
In commit v2.3.0rc0-117-g485bc45 (backported to v2.2.0rc0-44-g66721ca), extcap_prefs_dynamic_vals and extcap_cleanup were added in an attempt to address dangling pointers. Unfortunately it is not sufficient: - A pointer to the preference value is stored in extcap_arg and passed to the prefs API, but this extcap_arg structure can become invalid which result in use-after-free whenever the preference is accessed. - On exit, a use-after-free occurs in prefs_cleanup when the preference value is being checked. As the preference subsystem actually manages the memory for the string value and consumers should only provide a pointer where the value can be stored, convert the char* field in extcap to char**. This has as additional benefit that values are not limited to 256 bytes anymore. extcap_cleanup is moved after epan_cleanup to ensure that prefs_cleanup does not operate on dangling pointers. Crash is reproducible under ASAN with: tshark -i randpkt Ping-Bug: 12183 Change-Id: Ibf1ba1102a5633aa085dc278a12ffc05a4f4a34b Reviewed-on: https://code.wireshark.org/review/17631 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-07extcap: Add tool-specified helppageRoland Knall1-9/+7
Allow the tool to provide a link to a helppage, displayed by clicking on help in the configuration dialog. The URL will be opened using an URL based service, therefore local as well as remote URLs are possible. Change-Id: I58b30244e97919d5cf6892faf96536ddc30fb5a7 Reviewed-on: https://code.wireshark.org/review/17549 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-06extcap:Replace self-organized lists with glib onesRoland Knall1-59/+10
Replace the error-prone next/prev handling with GList and GHashTable Cleanup extcap_parser to only expose necessary functions Remove token know-how from extcap Change-Id: I7cc5ea06f58ad6c7a85ac292f5d2cb3d33e59833 Reviewed-on: https://code.wireshark.org/review/17496 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-29extcap: Restore functionality for optionsRoland Knall1-0/+1
Allow stored options to be restored to their default values. This adds a global cleanup method for extcap and globally defined preference values, which fixes the parameter problem with windows Change-Id: I48e0cf846ef81f4732d652c6a2ad0020db5df08e Reviewed-on: https://code.wireshark.org/review/13741 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-01extcap: Add Save functionality to options dialogRoland Knall1-1/+3
This patch creates the functionality of saving all parameters for extcap devices in the general preference section. For now, multiselect and fileselect do not save their values but patches for this will be provided in the future Also, all preferences are stored as strings to make handling easier. This might change in the future, but for the first version it will stick. Restore to Defaults is not implemented as of yet, and will be in a future version, once the preference storing is finalized Bug: 11666 Change-Id: I178346405146d2e43f4f3481c05c92c0b3595af5 Reviewed-on: https://code.wireshark.org/review/13451 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-28extcap: Cleanup complex types and add save optionRoland Knall1-15/+7
Cleanup handling of complex data types and use only glib defined datatypes while handling argument values. Add a save parameter, which (additionally) can set, that a parameter is not saved in a configuration file. Passwords are by default not saved, which may be overwritten using this parameter Change-Id: I67eff0f3286170f082d532e806a39511c40df647 Reviewed-on: https://code.wireshark.org/review/13573 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-18extcap: add masked to options.Dario Lombardo1-0/+1
This allows an option to be masked (like a password), by using the argument-type password. Change-Id: I2eae1be2e6672bff28ba5f749d7a3f687ebd4631 Reviewed-on: https://code.wireshark.org/review/13385 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-15extcap: Add list of extcaps to about dialogRoland Knall1-2/+5
Adds the list of available extcaps to the plugin list in the About dialog of Wireshark (Qt only). To do this, and additional sentence is provided in the extcap arguments list, which allows for additional information to be passed (as of right now, just version and display is used) Additionally, cleans up the code when using g_free. Bug: 11683 Change-Id: I04a958e2b73c9a707ab1cb4f2fc8345833a854a9 Reviewed-on: https://code.wireshark.org/review/13224 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-05extcap: Add regular expression validation supportRoland Knall1-1/+4
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-30extcap: Add file extension checkRoland Knall1-0/+3
The file-open dialog can now be set with file extensions, allowing the exclusion of unwanted file types. The syntax is the same as for the Qt QFileDialog, e.g.: "Wireshark (*.pcap *.pcapng)" Also, the mustexist option is now considered correctly Change-Id: I9d4efbb5089ce1af640b2a894de07ed79520271e Reviewed-on: https://code.wireshark.org/review/12913 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-30extcap: Add Required and cleanupRoland Knall1-1/+4
An option may now use the "required=true" argument (see sshdump.c) which will ensure, that the capture can only be started via the dialog, if the option has been provided. To ensure, that this is working properly, multiselect has been moved to a separate source file. Renamed one method so it may not interfere with a future save functionality, and cleaned up the interface to use only default buttons and roles ONLY the Qt interface is being supported. Change-Id: Ie1c9a63c1bba2e557d55b1de6f4775d8b9fce515 Reviewed-on: https://code.wireshark.org/review/12912 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-05extcap: Implement QT extcap optionsRoland Knall1-7/+14
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>
2014-10-06Convert "4 space tabs" to spaces; Adjust editor modelines.Bill Meier1-86/+86
Change-Id: I8d61d959c79e6aa9875c58680c54a331d18079cc Reviewed-on: https://code.wireshark.org/review/4504 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06Modify multicheck to accept parent parameter.Tomasz Moń1-1/+3
This makes it possible for multicheck to become a tree-like structure. Example: arg {number=4}{call=--devices}{display=Devices}{tooltip=Device selector}{type=multicheck} value {arg=4}{value=dev1}{display=Parent Device}{enabled=t}{default=t} value {arg=4}{value=dev2}{display=Child Device}{parent=dev1}{enabled=t} value {arg=4}{value=dev3}{display=Another Parent Device}{enabled=t} value {arg=4}{value=dev4}{display=Non-clickable Child Device}{parent=dev3} value {arg=4}{value=dev5}{display=Non-clickable Child of Child}{parent=dev4} Change-Id: I59dd7208ca0ec90cccfc49ae049559cdc6c69a4b Reviewed-on: https://code.wireshark.org/review/4192 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-21Extcap Capture InterfaceRoland Knall1-0/+253
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>