aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/extcap-base.c
AgeCommit message (Collapse)AuthorFilesLines
2018-11-14extcap: save debug flag and use it to activate ssh debug.Dario Lombardo1-0/+1
Change-Id: Ida32834f8c0838f1d815f7e33116b6a6161acf34 Reviewed-on: https://code.wireshark.org/review/30572 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-07extcap: Cleanup an if-statementStig Bjørlykke1-4/+2
Change-Id: If56f3837e8bcf0ef3a11579ca031223909ac47b9 Reviewed-on: https://code.wireshark.org/review/30528 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-05extcap: change boolean to boolflag for --debug option.Dario Lombardo1-1/+1
Change-Id: I6a42e689fa9a914f7f3bee1c1ade2218573a1c3f Reviewed-on: https://code.wireshark.org/review/30502 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-05extcap: fix return value in extcap_base_parse_options().Dario Lombardo1-1/+5
We need to split good options' from bad options' return value. Change-Id: I836e58c0f05716484664f354e7332a74d6a08c20 Reviewed-on: https://code.wireshark.org/review/30503 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-12Win32: Make extcap utilities console applications.Gerald Combs1-47/+0
Switch from using WinMain in extcap to wmain. Change-Id: I54fafad598f5ff74fe84a3ce3e993ac5a31188f7 Reviewed-on: https://code.wireshark.org/review/30094 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>
2018-05-08sshdump/ciscodump: use groups in config.Dario Lombardo1-4/+4
Change-Id: I3d6689738aee32bf720e6ebca1d4462429fdc1eb Reviewed-on: https://code.wireshark.org/review/27397 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-05-02extcap-base.c: fix compilation with gcc 8Pascal Quantin1-7/+4
extcap-base.c:293:43: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] extcap-base.c:302:45: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] extcap-base.c:321:42: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] Change-Id: Ifd9151d04412c5e29636dc14c57a327cc12d33f3 Reviewed-on: https://code.wireshark.org/review/27265 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-05extcap: Tell utilities the wireshark versionRoland Knall1-0/+2
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-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-12extcap: use SPDX identifiers for licences.Dario Lombardo1-13/+1
Change-Id: Id56687f86f4c60494dad0b6d58550ee45b0b203c Reviewed-on: https://code.wireshark.org/review/24381 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-06plugins: config.h must not be included by public headersJoão Valverde1-0/+1
For a sane plugin build environment. Include config.h as the first header in the .c file instead. Fix by moving required compiler attribute macros to a new "ws_attributes.h" API header. Change-Id: I34f58a927f68c1a0e59686c14d214825149749e1 Reviewed-on: https://code.wireshark.org/review/23400 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-08-03extcap: skip custom log if filename is space.Dario Lombardo1-2/+4
Change-Id: I98b890316af05d9c5359dc38a30d07ac55f262fe Reviewed-on: https://code.wireshark.org/review/22932 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-08-02extcap: add debug log file feature to extcap-base.Dario Lombardo1-1/+41
Change-Id: I3bfc9b2fd7b73dcfef52c5101360384d205c0d12 Reviewed-on: https://code.wireshark.org/review/22835 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-27extcap: add command line debug function to extcap-base.Dario Lombardo1-0/+10
This function is helpful to debug the interaction between the calling UI and the extcap itself. All extcaps have been changed accordingly. Change-Id: I358caf4c50797501672bf77fdd91f7276897078c Reviewed-on: https://code.wireshark.org/review/22806 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-19extcap: put missed parameters into the helpMichal Labedzki1-0/+2
"--debug" and "--extcap-version" are part of extcap-base helper, do not hide them. Change-Id: I287b68dbed5344c188fede69d112ab007a6ee18b Reviewed-on: https://code.wireshark.org/review/18279 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-10extcap-base: fix memleak from help optionsPeter Wu1-4/+5
Also correct modelines, this file really uses 4 spaces and not tabs. Change-Id: I828d0249cc7637275e5a04e9117b22e9eea6bd8c Reviewed-on: https://code.wireshark.org/review/17625 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-25extcap: add binary name and version to help message.Dario Lombardo1-2/+6
Change-Id: I8f8083c817065cf66fd006a1caeb309d26209509 Reviewed-on: https://code.wireshark.org/review/17305 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-24extcap: make extcaps use the version registered in config.Dario Lombardo1-1/+0
Change-Id: I12d0d0bec06e02af0a9d0877c0f0f1d86261d752 Reviewed-on: https://code.wireshark.org/review/17296 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-04extcap: restyle the help function.Dario Lombardo1-0/+53
Change-Id: Ia742dffb1fd4cd5780b8ba44f7064d1874e473da Reviewed-on: https://code.wireshark.org/review/16842 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-08-04extcap: prevent registration of wrong version.Dario Lombardo1-0/+3
This prevents the user to run extcap_base_set_util_info(extcap, "1", NULL, "0", NULL); that would result in version = 1.0. Change-Id: I67532459c852bdceb16693553e90da88a1043435 Reviewed-on: https://code.wireshark.org/review/16858 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-04extcap: restyle the output subsystem.Dario Lombardo1-3/+10
Change-Id: I3e0674751eb97bf30ae6d70c4e51f347d63b1697 Reviewed-on: https://code.wireshark.org/review/16849 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-31extcap: fix indentation in extcap-base.Dario Lombardo1-69/+69
Change-Id: Ic8e9634c9568d32fdeca8cc84a9c2f5b9757a5ae Reviewed-on: https://code.wireshark.org/review/16806 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-17Fix printf style parameters complaints from VS Code AnalysisMichael Mann1-2/+2
Change-Id: I5669e2442582f899643fae4a9f86ab6d505dde07 Reviewed-on: https://code.wireshark.org/review/16505 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-18g_list_free_full() only exists since 2.28AndersBroman1-1/+3
Change-Id: I41f8b0b27390788b76919791ba03bf97d699a623 Reviewed-on: https://code.wireshark.org/review/14992 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-04-14extcap-base: There is no need to register interfaces everytimeMichal Labedzki1-6/+0
If extcap tool run on not existing interfaces it will fail. There is no need to register ALL interfaces while only one is needed. Extcap tool check it in other way (aka try to capture but cannot for some reasons). Change-Id: I6d60da97ce4175f19656d8c18ad8cacd25b0e99a Reviewed-on: https://code.wireshark.org/review/14765 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-04-01extcap: fix const warningsDario Lombardo1-2/+2
Change-Id: Iac94349069485207d24ac1b8c1c5c09778c12e03 Reviewed-on: https://code.wireshark.org/review/14729 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-03-29Another round of extcap memleak fixesPeter Wu1-1/+4
Fix a bunch of memory leaks, mainly because extcap_base_cleanup is not called on most execution paths and because memory allocated for options were not freed. Additionally, randpkt will now fail if no option is given (it previously returned 0 if --capture was missing). Logic using "goto" is introduced with the idea that a program should fail (ret = EXIT_FAILURE) unless proven otherwise. Now none of the extcap programs are leaking: for what in ssh cisco; do for arg in '' --help --extcap-interfaces --extcap-interface=$what; do extcap/${what}dump $arg; done; done ./tshark -D Change-Id: I6df1027ed0c32bd53fe87e6c54d355bc8ddd01f5 Reviewed-on: https://code.wireshark.org/review/14671 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-03-17extcap-base: remove print of version if no interfaces present.Dario Lombardo1-4/+6
When no interfaces are available (as with androiddump when adb is not running) version is not printed anymore, for a cleaner output. Change-Id: Ia150a58ff1c04e412ff29a540f18e1fe9612f633 Reviewed-on: https://code.wireshark.org/review/14289 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-03-04Clean up modelines and indentation.Jeff Morriss1-151/+151
To quote Icf0831717de10fc615971fa1cf75af2f1ea2d03d: HT tab stops are set every 8 spaces on UN*X; UN*X tools that treat an HT character as tabbing to 4-space tab stops, or that even are configurable but *default* to 4-space tab stops (I'm looking at *you*, Xcode!) are broken. tab-width: 4, tabstop=4, and tabSize=4 are errors if you ever expect anybody to look at your file with a UN*X tool, and every text file will probably be looked at by a UN*X tool at some point, so Don't Do That. Adjust indentation to reflect the mode lines. Change-Id: Ic829541c696e0ddbc45cc109009319859c799066 Reviewed-on: https://code.wireshark.org/review/14340 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2016-02-29extcap: Move extcap handling to baseRoland Knall1-0/+191
Also add the extcap-version parameter to enable parsing of version and helppage separately Change-Id: I35ba5aa992940ffbb0cd9ebea8b7c3a1e8629d74 Reviewed-on: https://code.wireshark.org/review/14094 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-02-26extcap: move windows functions into extcap-baseDario Lombardo1-0/+85
Change-Id: Iec7fed027a24992afd673b09c32470af51739ae5 Reviewed-on: https://code.wireshark.org/review/14075 Reviewed-by: Roland Knall <rknall@gmail.com>