/* tap-protocolinfo.c
* protohierstat 2002 Ronnie Sahlberg
*
- * $Id: tap-protocolinfo.c,v 1.1 2002/11/04 12:10:59 sahlberg Exp $
+ * $Id: tap-protocolinfo.c,v 1.4 2003/05/03 00:48:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
}
for(i=0;i<gp->len;i++){
- str=proto_alloc_dfilter_string(gp->pdata[i], NULL);
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str);
- g_free(str);
+ str=proto_construct_dfilter_string(gp->pdata[i], NULL);
+ if(str){
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s",str);
+ g_free(str);
+ }
}
return 0;
}
char *field=NULL;
char *filter=NULL;
header_field_info *hfi;
+ GString *error_string;
if(!strncmp("proto,colinfo,",optarg,14)){
filter=optarg+14;
rs->filter=NULL;
}
- if(register_tap_listener("frame", rs, rs->filter, NULL, protocolinfo_packet, NULL)){
- /* error, we failed to attach to the tap. clean up */
+ error_string=register_tap_listener("frame", rs, rs->filter, NULL, protocolinfo_packet, NULL);
+ if(error_string){
+ /* error, we failed to attach to the tap. complain and clean up */
+ fprintf(stderr, "tethereal: Couldn't register proto,colinfo tap: %s\n",
+ error_string->str);
+ g_string_free(error_string, TRUE);
if(rs->filter){
g_free(rs->filter);
}
g_free(rs);
- fprintf(stderr,"tethereal: protocolinfo_init() failed to attach to tap.\n");
exit(1);
}
}
void
register_tap_listener_protocolinfo(void)
{
- register_ethereal_tap("proto,colinfo,", protocolinfo_init, NULL, NULL);
+ register_ethereal_tap("proto,colinfo,", protocolinfo_init);
}