From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
/* tap_camelcounter.c
|
|
|
|
* camel message counter for tshark
|
|
|
|
* Copyright 2006 Florent DROUIN
|
2008-02-18 22:39:03 +00:00
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
* This part of code is extracted from tap-h225counter.c from Lars Roland
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
2007-07-13 13:20:34 +00:00
|
|
|
#include "epan/packet.h"
|
From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
#include "epan/packet_info.h"
|
|
|
|
#include "epan/tap.h"
|
|
|
|
#include "epan/value_string.h"
|
|
|
|
#include "register.h"
|
|
|
|
#include "epan/stat_cmd_args.h"
|
2007-05-13 20:58:29 +00:00
|
|
|
#include "epan/asn1.h"
|
From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
#include "epan/camel-persistentdata.h"
|
|
|
|
|
|
|
|
void register_tap_listener_camelcounter(void);
|
|
|
|
|
|
|
|
/* used to keep track of the statistics for an entire program interface */
|
|
|
|
struct camelcounter_t {
|
|
|
|
char *filter;
|
|
|
|
guint32 camel_msg[camel_MAX_NUM_OPR_CODES];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void camelcounter_reset(void *phs)
|
|
|
|
{
|
|
|
|
struct camelcounter_t * p_counter= ( struct camelcounter_t *) phs;
|
|
|
|
memset(p_counter,0,sizeof(struct camelcounter_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int camelcounter_packet(void *phs,
|
|
|
|
packet_info *pinfo _U_,
|
|
|
|
epan_dissect_t *edt _U_,
|
|
|
|
const void *phi)
|
|
|
|
{
|
|
|
|
struct camelcounter_t * p_counter =(struct camelcounter_t *)phs;
|
|
|
|
const struct camelsrt_info_t * pi=phi;
|
|
|
|
if (pi->opcode != 255)
|
|
|
|
p_counter->camel_msg[pi->opcode]++;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void camelcounter_draw(void *phs)
|
|
|
|
{
|
|
|
|
struct camelcounter_t * p_counter= (struct camelcounter_t *)phs;
|
|
|
|
int i;
|
|
|
|
printf("\n");
|
|
|
|
printf("CAMEL Message and Response Status Counter:\n");
|
|
|
|
printf("------------------------------------------\n");
|
|
|
|
|
|
|
|
for(i=0;i<camel_MAX_NUM_OPR_CODES;i++) {
|
|
|
|
/* Message counter */
|
|
|
|
if(p_counter->camel_msg[i]!=0) {
|
|
|
|
printf("%30s ", val_to_str(i,camel_opr_code_strings,"Unknown message "));
|
|
|
|
printf("%6d\n", p_counter->camel_msg[i]);
|
|
|
|
}
|
|
|
|
} /* Message Type */
|
|
|
|
printf("------------------------------------------\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void camelcounter_init(const char *optarg, void* userdata _U_)
|
|
|
|
{
|
|
|
|
struct camelcounter_t *p_camelcounter;
|
|
|
|
GString *error_string;
|
|
|
|
|
|
|
|
p_camelcounter = g_malloc(sizeof(struct camelcounter_t));
|
2009-06-05 22:42:47 +00:00
|
|
|
if(!strncmp(optarg,"camel,counter,",13)){
|
|
|
|
p_camelcounter->filter=g_strdup(optarg+13);
|
From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
} else {
|
|
|
|
p_camelcounter->filter=NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
camelcounter_reset(p_camelcounter);
|
|
|
|
|
2009-06-05 22:42:47 +00:00
|
|
|
error_string=register_tap_listener("CAMEL",
|
|
|
|
p_camelcounter,
|
|
|
|
p_camelcounter->filter,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
camelcounter_packet,
|
|
|
|
camelcounter_draw);
|
From Florent.Drouin@alcatel.fr:
Please find two new TAP for Camel Statistics.
The first one updates counters related to camel operations. It is located in the GSM submenu. The second one , named Camel Service Response Time, gives the time ellapsed between a couple of camel specifics operations. (For example InitialDP/Continue or InitialDP GPRS/Continue GPRS). With Wireshark, you can have the Min/Max/Mean delay time for your traces files, and with Tshark, you have the additional information for percentile (1%,95% 99% etc )
To enable the use of the Camel statistics, you have 2 new parameters in the preferences,
- SRT, enable the service Response Time calculation.
- persistentSRT, keep the data in a context, even after the camel session has been closed. This is mandatory with Wireshark, to have a clean display of the stats.
Only the new files checked in for now because of include problems.
svn path=/trunk/; revision=19420
2006-10-03 22:12:47 +00:00
|
|
|
|
|
|
|
if(error_string){
|
|
|
|
/* error, we failed to attach to the tap. clean up */
|
|
|
|
g_free(p_camelcounter->filter);
|
|
|
|
g_free(p_camelcounter);
|
|
|
|
|
|
|
|
fprintf(stderr, "tshark: Couldn't register camel,counter tap: %s\n",
|
|
|
|
error_string->str);
|
|
|
|
g_string_free(error_string, TRUE);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void /* Next line mandatory */
|
|
|
|
register_tap_listener_camelcounter(void)
|
|
|
|
{
|
|
|
|
register_stat_cmd_arg("camel,counter", camelcounter_init, NULL);
|
|
|
|
}
|