aboutsummaryrefslogtreecommitdiffstats
path: root/epan/plugin_if.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-05plugin_if: fix small memory leak in ext_menubar_add_separatorPeter Wu1-1/+1
No need to clone memory as ext_menubar_add_generic_entry g_strdups the label argument. Found by Clang Static Analyzer. Change-Id: I7ffe3d0cae0093410f2015e6beb8b8e97a871b2a Fixes: v1.99.6rc0-213-geeed4d1121 ("UI: Implementing menus for plugins") Reviewed-on: https://code.wireshark.org/review/27342 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-02-08epan: use SPDX indentifiers.Dario Lombardo1-13/+1
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-19plugin_if: don't allocate memory and cast it instead.Dario Lombardo1-18/+6
Glib hash table can use integers as pointer by casting them using GINT_TO_POINTER. This prevents alloc/free of memory. Leak found by clang. Change-Id: Ieae4d1ec787e41aef0657d27bdaefe30d12e2b80 Reviewed-on: https://code.wireshark.org/review/25341 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-18Constify some pointers.Guy Harris1-8/+8
Change-Id: I4f443f777c92fa62fbe2448e891ba93d02fde3ad Reviewed-on: https://code.wireshark.org/review/25362 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-2/+1
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-03-04pluginIF: Allow en-/disable of elementsRoland Knall1-0/+5
Allow the enable/disable of an element Change-Id: I9652e8d74b261ba259cebfba53e7bc7ef560d347 Reviewed-on: https://code.wireshark.org/review/20370 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-03-03pluginIf: Add/Remove single entries from selectorRoland Knall1-0/+12
Allow to add and remove single items from a selector list and also fixing the selection of items in a selector list Change-Id: I0c69ea97db6ca1a6932939f0df9049c6fb720f77 Reviewed-on: https://code.wireshark.org/review/20363 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-02-26 plugin_if: fix no previous prototype for ‘ext_toolbar_find_item’ ↵Alexis La Goutte1-1/+1
[-Wmissing-prototypes] Change-Id: Ie11bc347b609bce754b85516601b57f6b0174f7b Reviewed-on: https://code.wireshark.org/review/20279 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-24PluginIF: AdditionalToolbarRoland Knall1-21/+316
Creates an interface for plugins and other parts of the code, to add a new toolbar to the system and have various widget types interact with this toolbar. All toolbars added via this interface, will be added to an additional submenu called "Additional Toolbars" within Wireshark. Also a demo plugin is being provided, demonstrating various features of the toolbar, including updating the gui elements. It also demonstrates how to update toolbar items. Change-Id: I8d0351224b3d7f4b90220d58970b51695551d7e3 Reviewed-on: https://code.wireshark.org/review/19803 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-02-15Add some casts to void * to fix (pedantic) argument mismatch notesJoão Valverde1-1/+1
Change-Id: I63e46285b4c6676d4ae57196b85fbad89964898c Reviewed-on: https://code.wireshark.org/review/13933 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>
2016-01-16plugin_if: fix bug in var assignment.Dario Lombardo1-6/+6
This bug was introduced in d1cb746, when HAVE_PCAP is not defined. Change-Id: I67cd51e4eec45cf7e7c3bdbfea9b8e164bb92883 Reviewed-on: https://code.wireshark.org/review/13333 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-01-15plugin_if: Add function to get capture file infoPaul Offord1-0/+34
This is an enhancement to allow a plugin to obtain capture file and other status information via a simple plugin_if call Added GTK port to this revision Bug: 11968 Change-Id: Ibcf4e8b43c6f3b48e971fa4020a07cc273234fb8 Reviewed-on: https://code.wireshark.org/review/13103 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2015-09-08PluginIF: Parent menu and goto frameRoland Knall1-0/+24
The developer may provide a given menu as parent menu for the sub menu. If the menu does not exist, the main menu will be used. Has been implemented for Qt as well as GTK. Change-Id: I3f26684862fd0b08f59eeb4d6f4a24ce7dc3d428 Reviewed-on: https://code.wireshark.org/review/9939 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-06-25Remove g_hash_table_contains from plugin_ifEvan Huus1-3/+2
The OSX 10.5 build doesn't seem to like it. Change-Id: I7471639f649dbf89ba77d78f77faebbeefcf4ed3 Reviewed-on: https://code.wireshark.org/review/9134 Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-25Plugin Interface: Add GUI callbacksRoland Knall1-0/+253
Rename ext_menubar to a more appropriate plugin_if. External menus can be implemented by plugins to present additional menus for deep-packet analysis. One side-effect of such menus being implemented as plugins is, that they are being executed in different threads and therefore can only use limited access to the main GUI. Also, there is no safe cross-gui (GTK and Qt) way for many features. This patch implements a first functionality, by which a plugin implemented using ext_menubar can apply a display filter to the main view. For now the implementation supports filtering, as well as saving a preference. Change-Id: Iffe4caa954bbeb8ce356352de4dae348a50efba9 Reviewed-on: https://code.wireshark.org/review/8773 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>