X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=blobdiff_plain;f=tap-gsm_astat.c;h=0185790fdec6a5e1f4580aff131a92a933a2f87e;hp=0390e4e53dddf1af469ed3c44a757b7d77a20102;hb=3068fb8ca50678504e62fab0e5515f1967d2bc7f;hpb=f026752489e09f18ac113ec6482e1abb0e420646 diff --git a/tap-gsm_astat.c b/tap-gsm_astat.c index 0390e4e53d..0185790fde 100644 --- a/tap-gsm_astat.c +++ b/tap-gsm_astat.c @@ -5,8 +5,8 @@ * * $Id$ * - * Ethereal - Network traffic analyzer - * By Gerald Combs + * Wireshark - Network traffic analyzer + * By Gerald Combs * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or @@ -42,8 +42,9 @@ #include "epan/packet_info.h" #include "epan/value_string.h" #include +#include #include -#include +#include #include "register.h" @@ -56,6 +57,8 @@ typedef struct _gsm_a_stat_t { int dtap_sms_message_type[0xff]; int dtap_sm_message_type[0xff]; int dtap_ss_message_type[0xff]; + int dtap_tp_message_type[0xff]; + int sacch_rr_message_type[0xff]; } gsm_a_stat_t; @@ -99,6 +102,9 @@ gsm_a_stat_packet( case PD_SS: stat_p->dtap_ss_message_type[tap_p->message_type]++; break; + case PD_TP: + stat_p->dtap_tp_message_type[tap_p->message_type]++; + break; default: /* * unsupported PD @@ -107,6 +113,19 @@ gsm_a_stat_packet( } break; + case GSM_A_PDU_TYPE_SACCH: + switch (tap_p->protocol_disc) + { + case 0: + stat_p->sacch_rr_message_type[tap_p->message_type]++; + break; + default: + /* unknown Short PD */ + break; + } + break; + + default: /* * unknown PDU type !!! @@ -264,12 +283,46 @@ gsm_a_stat_draw( i++; } + printf("\nDTAP %s\n", gsm_a_pd_str[PD_TP]); + printf("Message (ID)Type Number\n"); + + i = 0; + while (gsm_a_dtap_msg_tp_strings[i].strptr) + { + if (stat_p->dtap_tp_message_type[gsm_a_dtap_msg_tp_strings[i].value] > 0) + { + printf("0x%02x %-50s%d\n", + gsm_a_dtap_msg_tp_strings[i].value, + gsm_a_dtap_msg_tp_strings[i].strptr, + stat_p->dtap_tp_message_type[gsm_a_dtap_msg_tp_strings[i].value]); + } + + i++; + } + + printf("\nSACCH Radio Resources Management messages\n"); + printf("Message (ID)Type Number\n"); + + i = 0; + while (gsm_a_sacch_msg_rr_strings[i].strptr) + { + if (stat_p->sacch_rr_message_type[gsm_a_sacch_msg_rr_strings[i].value] > 0) + { + printf("0x%02x %-50s%d\n", + gsm_a_sacch_msg_rr_strings[i].value, + gsm_a_sacch_msg_rr_strings[i].strptr, + stat_p->sacch_rr_message_type[gsm_a_sacch_msg_rr_strings[i].value]); + } + + i++; + } + printf("==============================================================\n"); } static void -gsm_a_stat_init(const char *optarg _U_) +gsm_a_stat_init(const char *optarg _U_,void* userdata _U_) { gsm_a_stat_t *stat_p; GString *err_p; @@ -279,7 +332,7 @@ gsm_a_stat_init(const char *optarg _U_) memset(stat_p, 0, sizeof(gsm_a_stat_t)); err_p = - register_tap_listener("gsm_a", stat_p, NULL, + register_tap_listener("gsm_a", stat_p, NULL, 0, NULL, gsm_a_stat_packet, gsm_a_stat_draw); @@ -297,5 +350,5 @@ gsm_a_stat_init(const char *optarg _U_) void register_tap_listener_gsm_astat(void) { - register_tap_listener_cmd_arg("gsm_a,", gsm_a_stat_init); + register_stat_cmd_arg("gsm_a,", gsm_a_stat_init,NULL); }