summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-11-14 10:51:40 -0800
committerGuy Harris <guy@alum.mit.edu>2014-11-14 18:52:06 +0000
commit4d3c4c4f12726404549e5c8a99439b5a371da282 (patch)
treee31b8a12aa7d47758a4c125da3b74f5f394527a8 /epan
parent0dae81b6d5a888a066f1c6c66c248617d045ea0c (diff)
downloadwireshark-4d3c4c4f12726404549e5c8a99439b5a371da282.tar.gz
Rename stat_cmd_args.[ch] to stat_tap_ui.[ch].
The intent is to handle more than just command-line arguments; reflect that. Change-Id: Ia10efda85a9d11c6579d1bec6f789cee30d9e825 Reviewed-on: https://code.wireshark.org/review/5304 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/CMakeLists.txt2
-rw-r--r--epan/Makefile.common4
-rw-r--r--epan/conversation_table.c2
-rw-r--r--epan/stat_tap_ui.c (renamed from epan/stat_cmd_args.c)18
-rw-r--r--epan/stat_tap_ui.h (renamed from epan/stat_cmd_args.h)39
-rw-r--r--epan/wslua/wslua_util.c2
6 files changed, 25 insertions, 42 deletions
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 34a6ce61c0..7183de42bc 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -1598,7 +1598,7 @@ set(LIBWIRESHARK_FILES
sigcomp-udvm.c
sminmpec.c
sna-utils.c
- stat_cmd_args.c
+ stat_tap_ui.c
stats_tree.c
strutil.c
stream.c
diff --git a/epan/Makefile.common b/epan/Makefile.common
index 01fc5cf0c8..e0d4d333e9 100644
--- a/epan/Makefile.common
+++ b/epan/Makefile.common
@@ -84,7 +84,7 @@ LIBWIRESHARK_SRC = \
sigcomp-udvm.c \
sminmpec.c \
sna-utils.c \
- stat_cmd_args.c \
+ stat_tap_ui.c \
stats_tree.c \
strutil.c \
stream.c \
@@ -243,7 +243,7 @@ LIBWIRESHARK_INCLUDES = \
slow_protocol_subtypes.h \
sminmpec.h \
sna-utils.h \
- stat_cmd_args.h \
+ stat_tap_ui.h \
stat_groups.h \
stats_tree.h \
stats_tree_priv.h \
diff --git a/epan/conversation_table.c b/epan/conversation_table.c
index 3f2f5eddd4..f14e91df84 100644
--- a/epan/conversation_table.c
+++ b/epan/conversation_table.c
@@ -31,7 +31,7 @@
#include "addr_resolv.h"
#include "emem.h"
-#include "stat_cmd_args.h"
+#include "stat_tap_ui.h"
GList *cmd_string_list_ = NULL;
diff --git a/epan/stat_cmd_args.c b/epan/stat_tap_ui.c
index 38ccab529b..263fd330a9 100644
--- a/epan/stat_cmd_args.c
+++ b/epan/stat_tap_ui.c
@@ -1,5 +1,5 @@
-/* stat_cmd_args.c
- * Routines to register "-z" command-line argument handlers for stats
+/* stat_tap_ui.c
+ * Routines to register UI information for stats
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -28,7 +28,7 @@
#include <glib.h>
-#include <epan/stat_cmd_args.h>
+#include <epan/stat_tap_ui.h>
/* structure to keep track of what stats have registered command-line
arguments.
@@ -62,18 +62,6 @@ sort_by_name(gconstpointer a, gconstpointer b)
}
void
-register_stat_cmd_arg(const char *cmd, void (*func)(const char*, void*),void* userdata)
-{
- stat_cmd_arg *newsca;
-
- newsca=(stat_cmd_arg *)g_malloc(sizeof(stat_cmd_arg));
- newsca->cmd=cmd;
- newsca->func=func;
- newsca->userdata=userdata;
- stat_cmd_arg_list=g_slist_insert_sorted(stat_cmd_arg_list, newsca, sort_by_name);
-}
-
-void
register_stat_tap_ui(stat_tap_ui *ui, void *userdata)
{
stat_cmd_arg *newsca;
diff --git a/epan/stat_cmd_args.h b/epan/stat_tap_ui.h
index e0a35af4fc..defa0c0ae9 100644
--- a/epan/stat_cmd_args.h
+++ b/epan/stat_tap_ui.h
@@ -1,6 +1,5 @@
-/* stat_cmd_args.h
- * Declarations of routines to register "-z" command-line argument handlers
- * for stats
+/* stat_tap_ui.h
+ * Declarations of routines to register UI information for stats
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -21,8 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __STAT_CMD_ARGS_H__
-#define __STAT_CMD_ARGS_H__
+#ifndef __STAT_TAP_UI_H__
+#define __STAT_TAP_UI_H__
#include "ws_symbol_export.h"
@@ -30,21 +29,6 @@
extern "C" {
#endif /* __cplusplus */
-/** Register a stat ("-z") command line argument.
- *
- * @param cmd The command name without arguments, e.g. "conv,tcp" or "io,stat".
- * MUST be valid when other stat_cmd routines below are called.
- * @param func Callbak to be invoked when the CLI argument is supplied.
- * @param userdata Additional data for the callback.
- */
-#if 0
-WS_DLL_PUBLIC void register_stat_cmd_arg(const char *cmd,
- void (*func)(const char *arg,void* userdata), void* userdata);
-#endif
-WS_DLL_PUBLIC gboolean process_stat_cmd_arg(char *optstr);
-WS_DLL_PUBLIC void list_stat_cmd_args(void);
-WS_DLL_PUBLIC void start_requested_stats(void);
-
/*
* Parameters for taps.
*/
@@ -65,6 +49,9 @@ typedef struct _tap_param {
const enum_val_t *enum_vals;
} tap_param;
+/*
+ * UI information for a tap.
+ */
typedef struct _stat_tap_ui {
register_stat_group_t group; /* group to which statistic belongs */
const char *title; /* title of statistic */
@@ -75,11 +62,19 @@ typedef struct _stat_tap_ui {
tap_param *params; /* pointer to table of parameter info */
} stat_tap_ui;
-/*
- * Register the parameters a tap takes.
+/** Register UI information for a tap.
+ *
+ * @param ui UI information for the tap.
+ * @param userdata Additional data for the init routine.
*/
WS_DLL_PUBLIC void register_stat_tap_ui(stat_tap_ui *ui, void *userdata);
+WS_DLL_PUBLIC gboolean process_stat_cmd_arg(char *optstr);
+
+WS_DLL_PUBLIC void list_stat_cmd_args(void);
+
+WS_DLL_PUBLIC void start_requested_stats(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c
index 6a98c68ee2..ec0a4e3784 100644
--- a/epan/wslua/wslua_util.c
+++ b/epan/wslua/wslua_util.c
@@ -28,7 +28,7 @@
#include "wslua.h"
#include <math.h>
-#include <epan/stat_cmd_args.h>
+#include <epan/stat_tap_ui.h>
WSLUA_FUNCTION wslua_get_version(lua_State* L) { /* Gets a string of the Wireshark version. */