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/tap.c | |
parent | 3723032609805d89e3a155d6273833f7febdd899 (diff) |
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/tap.c')
-rw-r--r-- | epan/tap.c | 86 |
1 files changed, 0 insertions, 86 deletions
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 |