forked from osmocom/wireshark
![Gerald Combs](/assets/img/avatar_default.png)
Add a FunnelStatistics class, which is the main interface between the Qt UI and the Funnel API. Add FunnelTextDialog, which implements the text_window, ProgDlg, menu, and other routines. Add FunnelStringDialog, which implements dlg_new. We currently only support "Tools" menu items (MENU_TOOLS_UNSORTED, aka REGISTER_TOOLS_GROUP_UNSORTED). Add a disabled placeholder to the "Tools" menu in case we don't load any scripts. Use "struct progdlg" instead of needlessly casting to funnel_progress_window_t. To do: - Add support for MENU_STAT_UNSORTED, MENU_STAT_GENERIC, etc. - Make the firewall config generator a Lua script? - Add FunnelGraphDialog? It seems like it would be useful to make QCustomPlot accessible to Lua scripts. Ping-Bug: 9845 Change-Id: Iefff02e9032ed1853666f7902509ed08b431e7a7 Reviewed-on: https://code.wireshark.org/review/9523 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
128 lines
4.7 KiB
C
128 lines
4.7 KiB
C
/*
|
|
* funnel.h
|
|
*
|
|
* EPAN's GUI mini-API
|
|
*
|
|
* (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
#ifndef __FUNNEL_H__
|
|
#define __FUNNEL_H__
|
|
|
|
#include <glib.h>
|
|
#include <epan/stat_groups.h>
|
|
#include "ws_symbol_export.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
typedef struct _funnel_ops_id_t funnel_ops_id_t; /* Opaque pointer to ops instance */
|
|
typedef struct _funnel_progress_window_t funnel_progress_window_t ;
|
|
typedef struct _funnel_text_window_t funnel_text_window_t ;
|
|
typedef struct _funnel_tree_window_t funnel_tree_window_t ; /* XXX Unused? */
|
|
typedef struct _funnel_node_t funnel_node_t ; /* XXX Unused? */
|
|
|
|
typedef void (*text_win_close_cb_t)(void*);
|
|
|
|
typedef void (*funnel_dlg_cb_t)(gchar** user_input, void* data);
|
|
|
|
typedef gboolean (*funnel_bt_cb_t)(funnel_text_window_t* tw, void* data);
|
|
|
|
typedef struct _funnel_bt_t {
|
|
funnel_text_window_t* tw;
|
|
funnel_bt_cb_t func;
|
|
void* data;
|
|
void (*free_fcn)(void*);
|
|
void (*free_data_fcn)(void*);
|
|
} funnel_bt_t;
|
|
|
|
struct progdlg;
|
|
|
|
typedef struct _funnel_ops_t {
|
|
funnel_ops_id_t *ops_id;
|
|
funnel_text_window_t* (*new_text_window)(const char* label);
|
|
void (*set_text)(funnel_text_window_t* win, const char* text);
|
|
void (*append_text)(funnel_text_window_t* win, const char* text);
|
|
void (*prepend_text)(funnel_text_window_t* win, const char* text);
|
|
void (*clear_text)(funnel_text_window_t* win);
|
|
const char* (*get_text)(funnel_text_window_t* win);
|
|
void (*set_close_cb)(funnel_text_window_t* win, text_win_close_cb_t cb, void* data);
|
|
void (*set_editable)(funnel_text_window_t* win, gboolean editable);
|
|
void (*destroy_text_window)(funnel_text_window_t* win);
|
|
void (*add_button)(funnel_text_window_t* win, funnel_bt_t* cb, const char* label);
|
|
|
|
void (*new_dialog)(const gchar* title,
|
|
const gchar** fieldnames,
|
|
funnel_dlg_cb_t dlg_cb,
|
|
void* data);
|
|
|
|
|
|
void (*logger)(const gchar *log_domain,
|
|
GLogLevelFlags log_level,
|
|
const gchar *message,
|
|
gpointer user_data);
|
|
|
|
|
|
void (*retap_packets)(funnel_ops_id_t *ops_id);
|
|
void (*copy_to_clipboard)(GString *str);
|
|
|
|
const gchar * (*get_filter)(funnel_ops_id_t *ops_id);
|
|
void (*set_filter)(funnel_ops_id_t *ops_id, const char* filter);
|
|
void (*set_color_filter_slot)(guint8 flit_nr, const gchar* filter);
|
|
gboolean (*open_file)(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char** error);
|
|
void (*reload)(funnel_ops_id_t *ops_id);
|
|
void (*apply_filter)(funnel_ops_id_t *ops_id);
|
|
|
|
gboolean (*browser_open_url)(const gchar *url);
|
|
void (*browser_open_data_file)(const gchar *filename);
|
|
|
|
struct progdlg* (*new_progress_window)(funnel_ops_id_t *ops_id, const gchar* label, const gchar* task, gboolean terminate_is_stop, gboolean *stop_flag);
|
|
void (*update_progress)(struct progdlg*, float pr, const gchar* task);
|
|
void (*destroy_progress_window)(struct progdlg*);
|
|
} funnel_ops_t;
|
|
|
|
WS_DLL_PUBLIC const funnel_ops_t* funnel_get_funnel_ops(void);
|
|
WS_DLL_PUBLIC void funnel_set_funnel_ops(const funnel_ops_t*);
|
|
|
|
WS_DLL_PUBLIC void funnel_register_menu(const char *name,
|
|
register_stat_group_t group,
|
|
void (*callback)(gpointer),
|
|
gpointer callback_data,
|
|
gboolean retap);
|
|
|
|
typedef void (*funnel_registration_cb_t)(const char *name,
|
|
register_stat_group_t group,
|
|
void (*callback)(gpointer),
|
|
gpointer callback_data,
|
|
gboolean retap);
|
|
|
|
WS_DLL_PUBLIC void funnel_register_all_menus(funnel_registration_cb_t r_cb);
|
|
|
|
extern void initialize_funnel_ops(void);
|
|
|
|
extern void funnel_dump_all_text_windows(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __FUNNEL_H__ */
|