path: root/tap-mgcpstat.c
diff options
authorGuy Harris <guy@alum.mit.edu>2003-04-23 08:20:06 +0000
committerGuy Harris <guy@alum.mit.edu>2003-04-23 08:20:06 +0000
commit1b872b3648180aa042e36dd5b3ff38a03fa131e3 (patch)
tree04f0fba9423fc1a57c5f559ee0a5fc49138ddb6e /tap-mgcpstat.c
parent81ebec370d30901623ef24b2112e91f8004c6ad0 (diff)
Make "register_tap_listener()" return NULL on success and a "GString *"
referring to a GString containing an error message on failure, and don't have it print anything on failure. If it fails, have its Tethereal-tap callers print an error message before exiting, and have its Ethereal callers pop up a dialog box with the error (except in cases where the failure is guaranteed not to be the user's fault, and where we exit, in which case we just print an error message before we exit). In all cases, the error message includes the text of the GString. Fix a scanf format string in the DCE RPC statistics Ethereal tap, so that it properly skips the comma before the filter string. Fix some Ethereal error messages not to say "tethereal". svn path=/trunk/; revision=7542
Diffstat (limited to 'tap-mgcpstat.c')
1 files changed, 7 insertions, 4 deletions
diff --git a/tap-mgcpstat.c b/tap-mgcpstat.c
index 8313b7f42b..193b2d5135 100644
--- a/tap-mgcpstat.c
+++ b/tap-mgcpstat.c
@@ -1,7 +1,7 @@
/* tap-mgcpstat.c
* mgcpstat 2003 Lars Roland
- * $Id: tap-mgcpstat.c,v 1.5 2003/04/23 03:50:59 guy Exp $
+ * $Id: tap-mgcpstat.c,v 1.6 2003/04/23 08:20:01 guy Exp $
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -186,7 +186,7 @@ mgcpstat_init(char *optarg)
mgcpstat_t *ms;
int i;
char *filter=NULL;
+ GString *error_string;
@@ -216,12 +216,15 @@ mgcpstat_init(char *optarg)
- if(register_tap_listener("mgcp", ms, filter, NULL, mgcpstat_packet, mgcpstat_draw)){
+ error_string=register_tap_listener("mgcp", ms, filter, NULL, mgcpstat_packet, mgcpstat_draw);
+ if(error_string){
/* error, we failed to attach to the tap. clean up */
- fprintf(stderr,"tethereal: mgcpstat_init() failed to attach to tap.\n");
+ fprintf(stderr, "tethereal: Couldn't register mgcp,rtd tap: %s\n",
+ error_string->str);
+ g_string_free(error_string, TRUE);