Commit Graph

18 Commits

Author SHA1 Message Date
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
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-10-15 12:38:51 +00:00
Dario Lombardo b3b23ff134 Gtk: add initializers.
As per coverity multiple CIDs.

Change-Id: I30b5a5e45de2fc9b3c563c56151bd33483c754cd
Reviewed-on: https://code.wireshark.org/review/19379
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2016-12-22 09:44:55 +00:00
Dario Lombardo 24ecc1cf27 Gtk: don't use GTimeZone/GDateTime
Use struct tm instead.

Change-Id: I678797b93062305849875b33867faa52379c3dcb
Reviewed-on: https://code.wireshark.org/review/19356
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>
2016-12-20 12:24:34 +00:00
Dario Lombardo b7e7796e20 extcap: add new option type (timestamp).
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-12-09 04:49:33 +00:00
Michael Mann 916b26ecfe Cleanup some checkAPI warnings that were missed in previous patches.
Some search/replace of printf, g_warning and GTK APIs were changed to use a
ws_ prefix

Change-Id: I9beb763a975530a4006d1afbcad079a7d8d4ebf9
Reviewed-on: https://code.wireshark.org/review/16704
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-26 17:15:38 +00:00
Michael Mann ee7f9c33f6 Pacify GTK checkAPIs.pl warnings.
Add "Wireshark" macros to old-gtk-compat.h for GTK APIs that have been deprecated.
The macros are setup by version number to limit their proliferation (not that I
suspect much development will really be done there since GTK is deprecated).
Just want to make buildbots happy for the time being.

Change-Id: I095f850065166a0bc2e2456fb2e886ab64fdd97d
Reviewed-on: https://code.wireshark.org/review/16635
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-24 20:03:29 +00:00
Dario Lombardo ff033c6a2f extcap: add masked to options.
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-18 15:04:33 +00:00
Roland Knall 5727ebe689 extcap: Implement QT extcap options
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-05-05 09:35:10 +00:00
Martin Mathieson 43f09e67b4 Remove unneeded includes from ui folder
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a
Reviewed-on: https://code.wireshark.org/review/6128
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2015-01-01 23:11:10 +00:00
Roland Knall 05a6615965 extcap: Remove single-space argument for boolflags
Boolflags will be added with a NULL argument to the
 list and therefore the original fix will work.

 Note: extcap_get_complex_as_string will convert any NULL
 value into a single character argument (' '). Therefore
 any argument type, where NULL is a special value should
 be handled seperately here. For now, the only datatype
 will be BOOLFLAG

Change-Id: Icfc9b573214e05ea713a3b70ea37953d470dafae
Reviewed-on: https://code.wireshark.org/review/4649
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-13 19:26:46 +00:00
Alexis La Goutte c4acc4bea4 extcap (GTK): Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ifdba972e3a12e01ac80bc920a2100bd7aa0f733c
Reviewed-on: https://code.wireshark.org/review/4622
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-13 15:43:34 +00:00
Tomasz Moń fc2f31810a Fix handling of extcap boolflags which defaults to true.
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-12 19:54:57 +00:00
Tomasz Moń e881036b1a Fix extcap boolean flag handling.
Change-Id: I4c6b32805d4138ef0912fbf1b129a5e97776ab9c
Reviewed-on: https://code.wireshark.org/review/4535
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-08 05:48:05 +00:00
Bill Meier 5051ae1cbe Convert "4 space tabs" to spaces; Adjust editor modelines.
Change-Id: I8d61d959c79e6aa9875c58680c54a331d18079cc
Reviewed-on: https://code.wireshark.org/review/4504
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 18:29:40 +00:00
Tomasz Moń 9c1225f735 Modify multicheck to accept parent parameter.
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-10-06 09:51:56 +00:00
Alexis La Goutte 4f95327eb9 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I0593b659dcd28929cf51a8b1147392f070574c9e
Reviewed-on: https://code.wireshark.org/review/3934
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-31 20:21:11 +00:00
Guy Harris 7b9b881841 Float constants end with "f"; assign float constants to gfloats.
This squelches some compiler warnings about assigning double values to
floats (no, there's no precision in 0 to lose, but the compiler warns
anyway).

Change-Id: Ia49618cb8582c5afcdc5bdc5334fe20724b85eda
Reviewed-on: https://code.wireshark.org/review/3762
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-21 08:06:25 +00:00
Roland Knall bed29af46d Extcap Capture Interface
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>
2014-08-21 03:34:02 +00:00