* h225 message counter for ethereal
* Copyright 2003 Lars Roland
*
- * $Id: tap-h225counter.c,v 1.3 2004/05/09 10:03:38 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* With MSVC and a libethereal.dll this file needs to import some variables
- in a special way. Therefore _NEED_VAR_IMPORT_ is defined. */
-#define _NEED_VAR_IMPORT_
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include "epan/packet_info.h"
-#include "tap.h"
+#include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
#include "epan/value_string.h"
#include "register.h"
-#include "packet-h225.h"
+#include <epan/dissectors/packet-h225.h>
/* following values represent the size of their valuestring arrays */
}
static int
-h225counter_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, void *phi)
+h225counter_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi)
{
h225counter_t *hs=(h225counter_t *)phs;
- h225_packet_info *pi=phi;
+ const h225_packet_info *pi=phi;
switch (pi->msg_type) {
printf("Call Signalling:\n");
for(i=0;i<=CS_MSG_TYPES;i++) {
if(hs->cs_msg[i]!=0) {
- printf(" %s : %u\n", val_to_str(i,h323_message_body_vals,"unknown cs-messages "), hs->cs_msg[i]);
+ printf(" %s : %u\n", val_to_str(i,T_h323_message_body_vals,"unknown cs-messages "), hs->cs_msg[i]);
/* reason counter */
switch(i) {
case 5: /* ReleaseComplete */
static void
-h225counter_init(char *optarg)
+h225counter_init(const char *optarg)
{
h225counter_t *hs;
- char *filter=NULL;
+ const char *filter=NULL;
GString *error_string;
if(!strncmp(optarg,"h225,counter,",13)){
filter=optarg+13;
} else {
- filter=g_malloc(1);
- *filter='\0';
+ filter="";
}
hs = g_malloc(sizeof(h225counter_t));
void
register_tap_listener_h225counter(void)
{
- register_ethereal_tap("h225,counter", h225counter_init);
+ register_stat_cmd_arg("h225,counter", h225counter_init);
}