aboutsummaryrefslogtreecommitdiffstats
path: root/doc/extcap_example.py
AgeCommit message (Collapse)AuthorFilesLines
2019-09-17extcap: Fix type in exampleRoland Knall1-2/+2
Change-Id: Id76fde0786dde466a13adea423ff349a2b7400e1 Reviewed-on: https://code.wireshark.org/review/34554 Reviewed-by: Roland Knall <rknall@gmail.com>
2019-05-29Use the HTTPS URL for our main site in a few places.Gerald Combs1-2/+2
Fixup the encoding of plugins/plugin.rc.in while we're here. Change-Id: I21b56ce68bc3d84298a846a991c72bf710b9ae8a Reviewed-on: https://code.wireshark.org/review/33414 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-20extcap: Fix Python 3 control data handling in exampleTomasz Moń1-1/+1
Decode received payload as utf-8 string, replacing any invalid characters with U+FFFD. Change-Id: If80fbbec5c369f1098dbc1e46e092928aa0b0eb9 Reviewed-on: https://code.wireshark.org/review/33252 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-17extcap: Improve example multicheck valuesTomasz Moń1-2/+16
Multicheck values can be checkable or uncheckable depending on the "enabled" option. Moreover, multicheck values can be stacked into a tree by providing a "parent" option. Modify the example extcap to illustrate these possibilities. Bug: 13355 Change-Id: I0c50ff873c07eca5cc4ae8036b87cbb440d318b3 Reviewed-on: https://code.wireshark.org/review/32842 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-15extcap: Fix Python 3 bytes handling in exampleTomasz Moń1-2/+1
In Python 3 strings cannot be joined with bytes. This change has no effect for Python 2. Ping-Bug: 15694 Change-Id: I2eb62698ce323f8156ed98b7fe88e4e43e59c784 Reviewed-on: https://code.wireshark.org/review/32843 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-08extcap: Group argumentsRoland Knall1-7/+7
Group arguments together to better present them, as well as to have the possibility to better facilitate settings categories. The order of tabs is defined by the numbering of arguments and their appearance. If no tab can be found or no group has been defined for the argument, a default tab will be added. Change-Id: I032881193e09d4ad5d65c9f73fede87695acdace Reviewed-on: https://code.wireshark.org/review/27054 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-06extcap: Fix version requestRoland Knall1-2/+2
The original implementation lead to multiple extcap interfaces being loaded, as well as an error output from the default example. This fixes both Change-Id: Icb6fbda7bcb11ed0d14cb683ddcdabdc20a7070d Reviewed-on: https://code.wireshark.org/review/26773 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-05extcap: Reload values on requestRoland Knall1-12/+30
Allow certaing elements to be reloaded upon request. The way this works is, certain elements can be configured to be reloadable. By doing so, the extcap is asked once more just for the values list of this item, together with all already set options, and reloads the available options depending on the response. Only supported for selector. Radio and Multiselect will need additional patches, also moving those parts outside of extcap_argument.cpp might make sense before hand. Change-Id: I2e9e3d109b334bf878835a7cc9354f468bc22dee Reviewed-on: https://code.wireshark.org/review/26223 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-05extcap: Tell utilities the wireshark versionRoland Knall1-0/+8
Add an optional argument to extcap-version, which tells the utilities the wireshark version and therefore allows them to handle different versions differently. If no version is provided, the utility has to assume it is dealing with a Wireshark 2.x version (default behavior). Change-Id: I51658300f28f503ca8050d204b73749f1a54df16 Reviewed-on: https://code.wireshark.org/review/26752 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-05extcap: Add missing compatibliity functionRoland Knall1-0/+1
Otherwise the utility no longer works for Python 2. Change-Id: Ibe2f09d26887603a971185253aeaf2521875770d Reviewed-on: https://code.wireshark.org/review/26751 Reviewed-by: Roland Knall <rknall@gmail.com>
2018-04-04Fixup extcap_example.pyGerald Combs1-323/+326
Run 2to3. Convert our payload to bytes. Switch from tab to 4-space indentation as described in PEP8, which fixes a "TabError" message. Change-Id: Ic20b6bc1fc1a945758c8be1bb54435f3326fb605 Reviewed-on: https://code.wireshark.org/review/26744 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-11SPDX: Convert doc and docbook.Gerald Combs1-12/+1
Replace the GPLv2+ blurbs in the doc and docbook directories with SPDX headers as appropriate. This includes example code such as packet-PROTOABBREV.c. Remove dfilter2pod.pl and dfilter2xml.pl. We haven't used them since 2010. Change-Id: I4adec02a9a4bc3e71e32bdf89f2754edaf696938 Reviewed-on: https://code.wireshark.org/review/24343 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-28extcap: Interface Toolbar support on WindowsHåkon Øye Amundsen1-21/+11
Add support for extcap control pipes on Windows. Improved read loop in InterfaceToolbarReader. Delay opening control pipes until extcap has opened the fifo pipe. Make extcap_example.py work on Windows. Bug: 13833 Change-Id: I4b47d25452637759b8a3be53be48eee5365bc0e4 Reviewed-on: https://code.wireshark.org/review/23211 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-30Qt: Add support to verify extcap capture filterMichael Mann1-0/+7
Bug: 11668 Change-Id: Ib218d87c1905e53ffdab4e3dd6f93ba2c3d07c8b Reviewed-on: https://code.wireshark.org/review/21770 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-05-05extcap: Update example help textStig Bjørlykke1-2/+2
Change-Id: I1240af78664d6066650be67b95f0423a5353c711 Reviewed-on: https://code.wireshark.org/review/21508 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-05-02Qt: Interface Toolbar improvementsStig Bjørlykke1-3/+3
- Select one of the capturing interfaces when start capture - Only send user changed control values when start capture - Don't show hidden interfaces - Allow a toolbar with no interfaces - Renamed button role "reset" to "restore" - Improved control number validation - Updated documentation Change-Id: Icc8d04043c95c1f3ef8d7cdc3b251be4471cba0a Reviewed-on: https://code.wireshark.org/review/21445 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-04-25Qt: Add interface toolbar supportStig Bjørlykke1-13/+162
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-26Bugfix for extcap fileselect functionality, start button in extcap options ↵Kim Bäckström1-0/+9
dialog wouldn't get enabled if the user had selected a file (and mustexist=true wasn't specified). This commit also contains minor fixes to doc/README.extcap, it's now more aligned to the actual implementation. Added example usage of fileselect, radio and multiselect to doc/extcap_example.py. Change-Id: Ibfe40a35a26f49322fbe64c0594506a2163f7e20 Reviewed-on: https://code.wireshark.org/review/20274 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-02-02Qt: Add extcap placeholder parameterStig Bjørlykke1-1/+1
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-0/+5
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-10-16extcap_example.py: fix hang on exitPeter Wu1-41/+20
I guess that when SIGINT is intercepted, then the writes are restarted and the doExit condition is never checked. Remove this racy check in favor of catching the KeyboardInterrupt exception. Test: tshark -i example1; kill tshark; check process list for python. Bug: 11657 Change-Id: Ia8b1ee560b9dcd31dd91df27fbfb8e91237581c9 Reviewed-on: https://code.wireshark.org/review/18218 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-16extcap_example.py: fixes for Python 3Peter Wu1-37/+32
Fixes trivial syntax error in try/except, ensure that the message are bytes instead of a string and remove unnecessary use of an append_bytes function. Did not try to fix the other Python issues, at least it runs now. Change-Id: Ib24f6116bc9d3cf177bc940da9f89aff90695a93 Reviewed-on: https://code.wireshark.org/review/18212 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-07extcap: Add tool-specified helppageRoland Knall1-1/+1
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-07-30extcap: Use stderr to print error messageRoland Knall1-4/+70
This patch reads out the stderr messages from an extcap utility and displays it to an user. It was tested on Qt but not on GTK, but should work their as well. On Mac OS/X and Windows the child_watch does not behave as it was intended. Therefore in extcap_cleanup, the callbacks are called manually, if and only if, they have not been called already. The reason why it displays two error messages is, that by the time the first one is being displayed, glib has not returned from the spawned process on Linux yet. So there is no way to add the stderr correctly, and putting a handler to stderr into interface_opts will lead to memory errors, cause then the code tries to access memory outside of its protection. Bug: 11892 Change-Id: I2db60dd480fed3e01428b91a705057e4f088bd15 Reviewed-on: https://code.wireshark.org/review/12954 Reviewed-by: Roland Knall <rknall@gmail.com> 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: Anders Broman <a.broman58@gmail.com>
2016-02-01extcap: Add Save functionality to options dialogRoland Knall1-1/+4
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-3/+4
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-15extcap: Add list of extcaps to about dialogRoland Knall1-0/+1
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-6/+16
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-07extcap: Fix extcap_example.bat arguments wildcardStig Bjørlykke1-1/+1
Change-Id: I3aa1b14e8047e4eec14464db80d7e03fa7a5dc57 Reviewed-on: https://code.wireshark.org/review/12464 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-11-05extcap: Provide capture filter to extcap binaryStig Bjørlykke1-1/+2
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>
2014-10-13extcap: Catch unknown arguments to fix spacesRoland Knall1-1/+4
- If boolflags are being used, an extra space is added to the call of the extcap filter. This leads to the argumentparser of python to exit with an error-code, and the extcap filter will not start. This patch instead catches the unknown arguments and prints them on stdout, as well as running the dissection with the rest of the arguments list. Basically this is a work-around, for a behaviour not yet fixed in extcap, but it stabilizes the usage of the demo Change-Id: I7589292692b0b3c839909fd09d62a4714cbe869e Reviewed-on: https://code.wireshark.org/review/4638 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Tomasz Moń <desowin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-08Fix --extcap-dlts call in extcap_example.py.Tomasz Moń1-1/+1
There is regular expression that extracts only the number from --extcap-interface argument and only that number (as string) is being passed to extcap_dlts(). Change-Id: I5159f9405a766c1edff792213b2aef72b9a29ba4 Reviewed-on: https://code.wireshark.org/review/4550 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-21Add a license to this new file (GPLv2+) so we pass the license check.Jeff Morriss1-0/+20
(This change needs to be approved Roland Knall--by the file's author--in Gerrit.) Change-Id: I58285cb1d773a57fe7d087799bf6d2ffbd962364 Reviewed-on: https://code.wireshark.org/review/3773 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-21Extcap Capture InterfaceRoland Knall1-0/+249
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>