diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-08-19 09:29:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-08-19 09:29:41 +0000 |
commit | b2807e2ab65c7c96b38c4b08b4b491986719378a (patch) | |
tree | 76e4a11481ef4c452fdb6528527c87a5b32d6631 /epan | |
parent | 3723032609805d89e3a155d6273833f7febdd899 (diff) | |
download | wireshark-b2807e2ab65c7c96b38c4b08b4b491986719378a.tar.gz |
Move the APIs for registering and processing "-z" command-line arguments
and "Statistics" menu items into "stat.h" and "stat.c", to separate them
from the core tapping APIs. A tap could conceivably not register as a
"-z" command-line argument or "Statistics" menu item, and a stat could
conceivably not be implemented as a tap, and dissectors that implement
tapping points don't need the UI-related stuff from "stat.h", they just
want the tap-related stuff in <epan/tap.h>.
svn path=/trunk/; revision=15427
Diffstat (limited to 'epan')
-rw-r--r-- | epan/libethereal.def | 4 | ||||
-rw-r--r-- | epan/tap.c | 86 | ||||
-rw-r--r-- | epan/tap.h | 5 |
3 files changed, 0 insertions, 95 deletions
diff --git a/epan/libethereal.def b/epan/libethereal.def index d3b8cd9368..1ab118cec6 100644 --- a/epan/libethereal.def +++ b/epan/libethereal.def @@ -339,7 +339,6 @@ isup_message_type_value DATA isup_message_type_value_acro DATA is_big_endian is_tpkt -list_tap_cmd_args LocationRejectReason_vals DATA match_strval match_strval_idx @@ -370,7 +369,6 @@ prefs_register_string_preference prefs_register_uint_preference prefs_set_pref process_reassembled_data -process_tap_cmd_arg protocols_module DATA proto_can_match_selected proto_can_toggle_protocol @@ -492,7 +490,6 @@ register_init_routine register_postseq_cleanup_routine register_tap register_tap_listener -register_tap_listener_cmd_arg RegistrationRejectReason_vals DATA ReleaseCompleteReason_vals DATA remove_tap_listener @@ -522,7 +519,6 @@ sid_name_snooping DATA sid_name_table DATA smb_cmd_vals DATA sminmpec_values DATA -start_requested_taps stats_tree_branch_max_namelen stats_tree_branch_to_str stats_tree_create_node diff --git a/epan/tap.c b/epan/tap.c index 14f100c195..2b8dd1da20 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -79,25 +79,6 @@ typedef struct _tap_listener_t { } tap_listener_t; static volatile tap_listener_t *tap_listener_queue=NULL; -/* structure to keep track of what tap listeners have registered - command-line arguments. - */ -typedef struct _tap_cmd_arg { - struct _tap_cmd_arg *next; - const char *cmd; - void (*func)(const char *arg); -} tap_cmd_arg; -static tap_cmd_arg *tap_cmd_arg_list=NULL; - -/* structure to keep track of what taps have been specified on the - command line. - */ -typedef struct { - tap_cmd_arg *tca; - char *arg; -} tap_requested; -static GSList *taps_requested = NULL; - /* ********************************************************************** * Init routine only called from epan at application startup * ********************************************************************** */ @@ -113,73 +94,6 @@ tap_init(void) } /* ********************************************************************** - * Function called from tap to register the tap's command-line argument - * and initialization routine - * ********************************************************************** */ -void -register_tap_listener_cmd_arg(const char *cmd, void (*func)(const char *arg)) -{ - tap_cmd_arg *newtca; - - newtca=g_malloc(sizeof(tap_cmd_arg)); - newtca->next=tap_cmd_arg_list; - tap_cmd_arg_list=newtca; - newtca->cmd=cmd; - newtca->func=func; -} - -/* ********************************************************************** - * Function called for a tap command-line argument - * ********************************************************************** */ -gboolean -process_tap_cmd_arg(char *optarg) -{ - tap_cmd_arg *tca; - tap_requested *tr; - - for(tca=tap_cmd_arg_list;tca;tca=tca->next){ - if(!strncmp(tca->cmd,optarg,strlen(tca->cmd))){ - tr=g_malloc(sizeof (tap_requested)); - tr->tca = tca; - tr->arg=g_strdup(optarg); - taps_requested=g_slist_append(taps_requested, tr); - return TRUE; - } - } - return FALSE; -} - -/* ********************************************************************** - * Function to list all possible tap command-line arguments - * ********************************************************************** */ -void -list_tap_cmd_args(void) -{ - tap_cmd_arg *tca; - - for(tca=tap_cmd_arg_list;tca;tca=tca->next){ - fprintf(stderr," %s\n",tca->cmd); - } -} - -/* ********************************************************************** - * Function to process taps requested with command-line arguments - * ********************************************************************** */ -void -start_requested_taps(void) -{ - tap_requested *tr; - - while(taps_requested){ - tr=taps_requested->data; - (*tr->tca->func)(tr->arg); - g_free(tr->arg); - g_free(tr); - taps_requested=g_slist_remove(taps_requested, tr); - } -} - -/* ********************************************************************** * Functions called from dissector when made tappable * ********************************************************************** */ /* the following two functions are used from dissectors to diff --git a/epan/tap.h b/epan/tap.h index c37dd450db..9fc8233b46 100644 --- a/epan/tap.h +++ b/epan/tap.h @@ -38,11 +38,6 @@ typedef void (*tap_draw_cb)(void *tapdata); extern void tap_init(void); -extern void register_tap_listener_cmd_arg(const char *cmd, - void (*func)(const char *arg)); -extern gboolean process_tap_cmd_arg(char *optarg); -extern void list_tap_cmd_args(void); -extern void start_requested_taps(void); extern int register_tap(const char *name); extern int find_tap_id(const char *name); extern void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data); |