From Michael Lum:

ANSI and GSM MAP stats enhancements and cleanups;

	enhanced parameter dissection related to SS for GSM A-interface
	and MAP;

	minor GSM SMS fix;

	GSM SS enhancements for parameter dissection;

	MTP3 statistics tap.

svn path=/trunk/; revision=10655
This commit is contained in:
Guy Harris 2004-04-21 05:53:59 +00:00
parent f1c30d72c8
commit c6aeb05249
17 changed files with 1004 additions and 230 deletions

View File

@ -1853,6 +1853,7 @@ Michael Lum <mlum [AT] telostech.com> {
Tap for ANSI MAP message statistics
Tap for ISUP message statistics
Tap for GSM MAP message statistics
Tap for MTP3 MSU statistics and summary
}
Shiang-Ming Huang <smhuang [AT] pcs.csie.nctu.edu.tw> {

View File

@ -1,7 +1,7 @@
/* to_str.c
* Routines for utilities to convert various other types to strings.
*
* $Id: to_str.c,v 1.43 2004/03/23 01:02:40 guy Exp $
* $Id: to_str.c,v 1.44 2004/04/21 05:53:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -58,6 +58,7 @@
#endif
#include "to_str.h"
#include "value_string.h"
#include "resolv.h"
#include "pint.h"
#include "atalk-utils.h"

View File

@ -3,7 +3,7 @@
# a) common to both files and
# b) portable between both files
#
# $Id: Makefile.common,v 1.9 2004/03/26 00:28:39 guy Exp $
# $Id: Makefile.common,v 1.10 2004/04/21 05:53:59 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
@ -93,6 +93,7 @@ ETHEREAL_TAP_SRC = \
fc_stat.c \
gsm_a_stat.c \
gsm_map_stat.c \
gsm_map_summary.c \
h225_counter.c \
h225_ras_srt.c \
hostlist_eth.c \
@ -108,6 +109,8 @@ ETHEREAL_TAP_SRC = \
isup_stat.c \
ldap_stat.c \
mgcp_stat.c \
mtp3_stat.c \
mtp3_summary.c \
rpc_progs.c \
rpc_stat.c \
rtp_analysis.c \

View File

@ -5,7 +5,7 @@
*
* MUCH code modified from service_response_time_table.c.
*
* $Id: ansi_map_stat.c,v 1.20 2004/04/12 08:53:01 ulfl Exp $
* $Id: ansi_map_stat.c,v 1.21 2004/04/21 05:53:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -60,17 +60,32 @@ typedef struct column_arrows {
GtkWidget *descend_pm;
} column_arrows;
typedef struct _my_columns_t {
guint32 value;
gchar *strptr;
GtkJustification just;
} my_columns_t;
#define ANSI_MAP_INIT_TABLE_NUM_COLUMNS 5
static my_columns_t columns[ANSI_MAP_INIT_TABLE_NUM_COLUMNS] = {
{ 60, "Op Code", GTK_JUSTIFY_LEFT },
{ 290, "Operation Name", GTK_JUSTIFY_LEFT },
{ 50, "Count", GTK_JUSTIFY_RIGHT },
{ 100, "Total Bytes", GTK_JUSTIFY_RIGHT },
{ 50, "Average Bytes", GTK_JUSTIFY_RIGHT }
};
typedef struct _ansi_map_stat_dlg_t {
GtkWidget *win;
GtkWidget *scrolled_win;
GtkWidget *table;
char *entries[3];
char *entries[ANSI_MAP_INIT_TABLE_NUM_COLUMNS];
} ansi_map_stat_dlg_t;
#define N_MESSAGE_TYPES 256
typedef struct _ansi_map_stat_t {
int message_type[N_MESSAGE_TYPES];
int message_type[ANSI_MAP_MAX_NUM_MESSAGE_TYPES];
double size[ANSI_MAP_MAX_NUM_MESSAGE_TYPES];
} ansi_map_stat_t;
static ansi_map_stat_dlg_t dlg;
@ -101,7 +116,7 @@ ansi_map_stat_packet(
pinfo = pinfo;
#if 0 /* always false because message_type is 8 bit value */
if (data_p->message_type >= N_MESSAGE_TYPES)
if (data_p->message_type >= ANSI_MAP_MAX_NUM_MESSAGE_TYPES)
{
/*
* unknown PDU type !!!
@ -111,6 +126,7 @@ ansi_map_stat_packet(
#endif
stat.message_type[data_p->message_type]++;
stat.size[data_p->message_type] += data_p->size;
return(1);
}
@ -139,6 +155,14 @@ ansi_map_stat_draw(
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 2, strp);
g_free(strp);
strp = g_strdup_printf("%.0f", stat.size[ansi_map_opr_code_strings[i].value]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 3, strp);
g_free(strp);
strp = g_strdup_printf("%.2f", stat.size[ansi_map_opr_code_strings[i].value]/stat.message_type[ansi_map_opr_code_strings[i].value]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 4, strp);
g_free(strp);
i++;
}
@ -159,7 +183,7 @@ ansi_map_stat_gtk_click_column_cb(
gtk_clist_freeze(clist);
for (i=0; i < 3; i++)
for (i=0; i < ANSI_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
gtk_widget_hide(col_arrows[i].ascend_pm);
gtk_widget_hide(col_arrows[i].descend_pm);
@ -182,7 +206,6 @@ ansi_map_stat_gtk_click_column_cb(
{
/*
* Columns 0-1 sorted in descending order by default
* Columns 2 sorted in ascending order by default
*/
if (column <= 1)
{
@ -220,16 +243,15 @@ ansi_map_stat_gtk_sort_column(
switch (clist->sort_column)
{
case 0:
/* FALLTHRU */
case 1:
/* text columns */
return(strcmp(text1, text2));
case 2:
default:
/* number columns */
i1 = strtol(text1, NULL, 0);
i2 = strtol(text2, NULL, 0);
return(i1 - i2);
case 1:
return(strcmp(text1, text2));
}
g_assert_not_reached();
@ -264,8 +286,6 @@ ansi_map_stat_gtk_win_create(
ansi_map_stat_dlg_t *dlg_p,
char *title)
{
#define INIT_TABLE_NUM_COLUMNS 3
char *default_titles[] = { "Op Code", "Operation Name", "Count" };
int i;
column_arrows *col_arrows;
GdkBitmap *ascend_bm, *descend_bm;
@ -288,13 +308,13 @@ ansi_map_stat_gtk_win_create(
dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
/* We must display dialog widget before calling gdk_pixmap_create_from_xpm_d() */
/* We must display dialog widget before calling gdk_pixmap_create_from_xpm_d() */
gtk_widget_show_all(dlg_p->win);
dlg_p->table = gtk_clist_new(INIT_TABLE_NUM_COLUMNS);
dlg_p->table = gtk_clist_new(ANSI_MAP_INIT_TABLE_NUM_COLUMNS);
col_arrows =
(column_arrows *) g_malloc(sizeof(column_arrows) * INIT_TABLE_NUM_COLUMNS);
(column_arrows *) g_malloc(sizeof(column_arrows) * ANSI_MAP_INIT_TABLE_NUM_COLUMNS);
win_style =
gtk_widget_get_style(dlg_p->scrolled_win);
@ -311,13 +331,13 @@ ansi_map_stat_gtk_win_create(
&win_style->bg[GTK_STATE_NORMAL],
(gchar **)clist_descend_xpm);
for (i = 0; i < INIT_TABLE_NUM_COLUMNS; i++)
for (i = 0; i < ANSI_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
col_arrows[i].table = gtk_table_new(2, 2, FALSE);
gtk_table_set_col_spacings(GTK_TABLE(col_arrows[i].table), 5);
column_lb = gtk_label_new(default_titles[i]);
column_lb = gtk_label_new(columns[i].strptr);
gtk_table_attach(GTK_TABLE(col_arrows[i].table), column_lb,
0, 1, 0, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
@ -342,6 +362,8 @@ ansi_map_stat_gtk_win_create(
gtk_widget_show(col_arrows[i].ascend_pm);
}
gtk_clist_set_column_justification(GTK_CLIST(dlg_p->table), i, columns[i].just);
gtk_clist_set_column_widget(GTK_CLIST(dlg_p->table), i, col_arrows[i].table);
gtk_widget_show(col_arrows[i].table);
}
@ -351,9 +373,10 @@ ansi_map_stat_gtk_win_create(
gtk_clist_set_sort_column(GTK_CLIST(dlg_p->table), 0);
gtk_clist_set_sort_type(GTK_CLIST(dlg_p->table), GTK_SORT_ASCENDING);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 0, 60);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 1, 290);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 2, 50);
for (i = 0; i < ANSI_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), i, columns[i].value);
}
gtk_clist_set_shadow_type(GTK_CLIST(dlg_p->table), GTK_SHADOW_IN);
gtk_clist_column_titles_show(GTK_CLIST(dlg_p->table));
@ -361,7 +384,7 @@ ansi_map_stat_gtk_win_create(
SIGNAL_CONNECT(dlg_p->table, "click-column", ansi_map_stat_gtk_click_column_cb, col_arrows);
/* Button row. */
/* Button row. */
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
@ -369,10 +392,10 @@ ansi_map_stat_gtk_win_create(
gtk_widget_grab_default(bt_close);
SIGNAL_CONNECT(bt_close, "clicked", ansi_map_stat_gtk_dlg_close_cb, dlg_p);
/* Catch the "key_press_event" signal in the window, so that we can
catch the ESC key being pressed and act as if the "Close" button had
been selected. */
dlg_set_cancel(dlg_p->win, bt_close);
/* Catch the "key_press_event" signal in the window, so that we can
catch the ESC key being pressed and act as if the "Close" button had
been selected. */
dlg_set_cancel(dlg_p->win, bt_close);
gtk_widget_show_all(dlg_p->win);
}
@ -421,6 +444,10 @@ ansi_map_stat_gtk_cb(
dlg.entries[2] = g_strdup("0");
dlg.entries[3] = g_strdup("0");
dlg.entries[4] = g_strdup("0");
gtk_clist_insert(GTK_CLIST(dlg.table), i, dlg.entries);
gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer) i);

View File

@ -5,7 +5,7 @@
*
* MUCH code modified from service_response_time_table.c.
*
* $Id: gsm_map_stat.c,v 1.7 2004/04/12 08:59:41 ulfl Exp $
* $Id: gsm_map_stat.c,v 1.8 2004/04/21 05:53:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -53,6 +53,7 @@
#include "compat_macros.h"
#include "packet-gsm_map.h"
#include "gsm_map_stat.h"
typedef struct column_arrows {
GtkWidget *table;
@ -60,20 +61,40 @@ typedef struct column_arrows {
GtkWidget *descend_pm;
} column_arrows;
#define GSM_MAP_INIT_TABLE_NUM_COLUMNS 10
typedef struct _my_columns_t {
guint32 value;
gchar *strptr;
GtkJustification just;
} my_columns_t;
static my_columns_t columns[GSM_MAP_INIT_TABLE_NUM_COLUMNS] = {
{ 40, "ID", GTK_JUSTIFY_LEFT },
{ 210, "Operation Code", GTK_JUSTIFY_LEFT },
{ 60, "Invokes", GTK_JUSTIFY_RIGHT },
{ 100, "Num Bytes", GTK_JUSTIFY_RIGHT },
{ 80, "Avg Bytes", GTK_JUSTIFY_RIGHT },
{ 60, "RetResult", GTK_JUSTIFY_RIGHT },
{ 100, "Num Bytes", GTK_JUSTIFY_RIGHT },
{ 80, "Avg Bytes", GTK_JUSTIFY_RIGHT },
{ 100, "Total Bytes", GTK_JUSTIFY_RIGHT },
{ 80, "Avg Bytes", GTK_JUSTIFY_RIGHT }
};
typedef struct _gsm_map_stat_dlg_t {
GtkWidget *win;
GtkWidget *scrolled_win;
GtkWidget *table;
char *entries[3];
char *entries[GSM_MAP_INIT_TABLE_NUM_COLUMNS];
} gsm_map_stat_dlg_t;
typedef struct _gsm_map_stat_t {
int opr_code[0xff];
} gsm_map_stat_t;
static gsm_map_stat_dlg_t dlg;
static gsm_map_stat_t stat;
/*
* used by gsm_map_summary.c
*/
gsm_map_stat_t gsm_map_stat;
static void
@ -82,7 +103,7 @@ gsm_map_stat_reset(
{
tapdata = tapdata;
memset((void *) &stat, 0, sizeof(gsm_map_stat_t));
memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t));
}
@ -100,7 +121,7 @@ gsm_map_stat_packet(
pinfo = pinfo;
#if 0 /* always false because message_type is 8 bit value */
if (data_p->opr_code_idx > sizeof(stat.opr_code))
if (data_p->opr_code_idx > sizeof(gsm_map_stat.opr_code))
{
/*
* unknown message type !!!
@ -109,7 +130,16 @@ gsm_map_stat_packet(
}
#endif
stat.opr_code[data_p->opr_code_idx]++;
if (data_p->invoke)
{
gsm_map_stat.opr_code[data_p->opr_code_idx]++;
gsm_map_stat.size[data_p->opr_code_idx] += data_p->size;
}
else
{
gsm_map_stat.opr_code_rr[data_p->opr_code_idx]++;
gsm_map_stat.size_rr[data_p->opr_code_idx] += data_p->size;
}
return(1);
}
@ -133,10 +163,39 @@ gsm_map_stat_draw(
{
j = gtk_clist_find_row_from_data(GTK_CLIST(dlg.table), (gpointer) i);
strp = g_strdup_printf("%d", stat.opr_code[i]);
strp = g_strdup_printf("%d", gsm_map_stat.opr_code[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 2, strp);
g_free(strp);
strp = g_strdup_printf("%.0f", gsm_map_stat.size[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 3, strp);
g_free(strp);
strp = g_strdup_printf("%.2f", gsm_map_stat.size[i]/gsm_map_stat.opr_code[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 4, strp);
g_free(strp);
strp = g_strdup_printf("%u", gsm_map_stat.opr_code_rr[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 5, strp);
g_free(strp);
strp = g_strdup_printf("%.0f", gsm_map_stat.size_rr[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 6, strp);
g_free(strp);
strp = g_strdup_printf("%.2f", gsm_map_stat.size_rr[i]/gsm_map_stat.opr_code_rr[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 7, strp);
g_free(strp);
strp = g_strdup_printf("%.0f", gsm_map_stat.size[i] + gsm_map_stat.size_rr[i]);
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 8, strp);
g_free(strp);
strp = g_strdup_printf("%.2f",
(gsm_map_stat.size[i] + gsm_map_stat.size_rr[i])/(gsm_map_stat.opr_code[i] + gsm_map_stat.opr_code_rr[i]));
gtk_clist_set_text(GTK_CLIST(dlg.table), j, 9, strp);
g_free(strp);
i++;
}
@ -157,7 +216,7 @@ gsm_map_stat_gtk_click_column_cb(
gtk_clist_freeze(clist);
for (i=0; i < 3; i++)
for (i=0; i < GSM_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
gtk_widget_hide(col_arrows[i].ascend_pm);
gtk_widget_hide(col_arrows[i].descend_pm);
@ -180,7 +239,6 @@ gsm_map_stat_gtk_click_column_cb(
{
/*
* Columns 0-1 sorted in descending order by default
* Columns 2 sorted in ascending order by default
*/
if (column <= 1)
{
@ -218,16 +276,15 @@ gsm_map_stat_gtk_sort_column(
switch (clist->sort_column)
{
case 0:
/* FALLTHRU */
case 1:
/* text columns */
return(strcmp(text1, text2));
case 2:
default:
/* number columns */
i1 = strtol(text1, NULL, 0);
i2 = strtol(text2, NULL, 0);
return(i1 - i2);
case 1:
return(strcmp(text1, text2));
}
g_assert_not_reached();
@ -262,8 +319,6 @@ gsm_map_stat_gtk_win_create(
gsm_map_stat_dlg_t *dlg_p,
char *title)
{
#define INIT_TABLE_NUM_COLUMNS 3
char *default_titles[] = { "ID", "Operation Code", "Count" };
int i;
column_arrows *col_arrows;
GdkBitmap *ascend_bm, *descend_bm;
@ -286,13 +341,13 @@ gsm_map_stat_gtk_win_create(
dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
dlg_p->table = gtk_clist_new(INIT_TABLE_NUM_COLUMNS);
dlg_p->table = gtk_clist_new(GSM_MAP_INIT_TABLE_NUM_COLUMNS);
/* We must display dialog widget before calling gdk_pixmap_create_from_xpm_d() */
/* We must display dialog widget before calling gdk_pixmap_create_from_xpm_d() */
gtk_widget_show_all(dlg_p->win);
col_arrows =
(column_arrows *) g_malloc(sizeof(column_arrows) * INIT_TABLE_NUM_COLUMNS);
(column_arrows *) g_malloc(sizeof(column_arrows) * GSM_MAP_INIT_TABLE_NUM_COLUMNS);
win_style =
gtk_widget_get_style(dlg_p->scrolled_win);
@ -309,13 +364,13 @@ gsm_map_stat_gtk_win_create(
&win_style->bg[GTK_STATE_NORMAL],
(gchar **)clist_descend_xpm);
for (i = 0; i < INIT_TABLE_NUM_COLUMNS; i++)
for (i = 0; i < GSM_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
col_arrows[i].table = gtk_table_new(2, 2, FALSE);
gtk_table_set_col_spacings(GTK_TABLE(col_arrows[i].table), 5);
column_lb = gtk_label_new(default_titles[i]);
column_lb = gtk_label_new(columns[i].strptr);
gtk_table_attach(GTK_TABLE(col_arrows[i].table), column_lb,
0, 1, 0, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
@ -340,6 +395,8 @@ gsm_map_stat_gtk_win_create(
gtk_widget_show(col_arrows[i].ascend_pm);
}
gtk_clist_set_column_justification(GTK_CLIST(dlg_p->table), i, columns[i].just);
gtk_clist_set_column_widget(GTK_CLIST(dlg_p->table), i, col_arrows[i].table);
gtk_widget_show(col_arrows[i].table);
}
@ -349,9 +406,10 @@ gsm_map_stat_gtk_win_create(
gtk_clist_set_sort_column(GTK_CLIST(dlg_p->table), 0);
gtk_clist_set_sort_type(GTK_CLIST(dlg_p->table), GTK_SORT_ASCENDING);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 0, 60);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 1, 290);
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), 2, 50);
for (i = 0; i < GSM_MAP_INIT_TABLE_NUM_COLUMNS; i++)
{
gtk_clist_set_column_width(GTK_CLIST(dlg_p->table), i, columns[i].value);
}
gtk_clist_set_shadow_type(GTK_CLIST(dlg_p->table), GTK_SHADOW_IN);
gtk_clist_column_titles_show(GTK_CLIST(dlg_p->table));
@ -359,7 +417,7 @@ gsm_map_stat_gtk_win_create(
SIGNAL_CONNECT(dlg_p->table, "click-column", gsm_map_stat_gtk_click_column_cb, col_arrows);
/* Button row. */
/* Button row. */
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
@ -367,10 +425,10 @@ gsm_map_stat_gtk_win_create(
SIGNAL_CONNECT(bt_close, "clicked", gsm_map_stat_gtk_dlg_close_cb, dlg_p);
gtk_widget_grab_default(bt_close);
/* Catch the "key_press_event" signal in the window, so that we can
catch the ESC key being pressed and act as if the "Close" button had
been selected. */
dlg_set_cancel(dlg_p->win, bt_close);
/* Catch the "key_press_event" signal in the window, so that we can
catch the ESC key being pressed and act as if the "Close" button had
been selected. */
dlg_set_cancel(dlg_p->win, bt_close);
gtk_widget_show_all(dlg_p->win);
}
@ -418,6 +476,14 @@ gsm_map_stat_gtk_cb(
dlg.entries[1] = g_strdup(gsm_map_opr_code_strings[i].strptr);
dlg.entries[2] = g_strdup("0");
dlg.entries[3] = g_strdup("0");
dlg.entries[4] = g_strdup("0");
dlg.entries[5] = g_strdup("0");
dlg.entries[6] = g_strdup("0");
dlg.entries[7] = g_strdup("0");
dlg.entries[8] = g_strdup("0");
dlg.entries[9] = g_strdup("0");
dlg.entries[10] = g_strdup("0");
gtk_clist_insert(GTK_CLIST(dlg.table), i, dlg.entries);
gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer) i);
@ -437,7 +503,7 @@ register_tap_listener_gtkgsm_map_stat(void)
register_ethereal_tap("gsm_map,", gsm_map_stat_gtk_init);
memset((void *) &stat, 0, sizeof(gsm_map_stat_t));
memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t));
err_p =
register_tap_listener("gsm_map", NULL, NULL,

View File

@ -5,7 +5,7 @@
*
* MUCH code modified from service_response_time_table.c.
*
* $Id: isup_stat.c,v 1.21 2004/04/12 08:53:02 ulfl Exp $
* $Id: isup_stat.c,v 1.22 2004/04/21 05:53:59 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -67,10 +67,8 @@ typedef struct _isup_stat_dlg_t {
char *entries[4];
} isup_stat_dlg_t;
#define N_MESSAGE_TYPES 256
typedef struct _isup_stat_t {
int message_type[N_MESSAGE_TYPES];
int message_type[ISUP_MAX_NUM_MESSAGE_TYPES];
} isup_stat_t;
@ -102,7 +100,7 @@ isup_stat_packet(
pinfo = pinfo;
#if 0 /* always false because message_type is 8 bit value */
if (data_p->message_type >= N_MESSAGE_TYPES)
if (data_p->message_type >= ISUP_MAX_NUM_MESSAGE_TYPES)
{
/*
* unknown message type !!!

View File

@ -79,7 +79,7 @@
* UIM
* 3GPP2 N.S0003
*
* $Id: packet-ansi_map.c,v 1.14 2004/03/27 11:32:28 guy Exp $
* $Id: packet-ansi_map.c,v 1.15 2004/04/21 05:53:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -6302,7 +6302,8 @@ param_digits(ASN1_SCK *asn1, proto_tree *tree, guint len, gchar *add_string)
{
proto_tree_add_text(tree, asn1->tvb,
asn1->offset, value,
"IA5 Digits");
"IA5 Digits: %s",
tvb_format_text(asn1->tvb, asn1->offset, value));
asn1->offset += value;
}
@ -12403,9 +12404,8 @@ dissect_ansi_map_component(ASN1_SCK *asn1, proto_tree *tree, guint *len_p)
}
static void
dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint32 *opr_code_p)
{
static ansi_map_tap_rec_t tap_rec;
guint saved_offset = 0;
guint len;
guint tag;
@ -12417,6 +12417,8 @@ dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
gboolean def_len;
*opr_code_p = -1;
#define TCAP_NAT_OPR_CODE_TAG 0xd0
if (check_ansi_map_tag(asn1, TCAP_NAT_OPR_CODE_TAG))
{
@ -12429,7 +12431,8 @@ dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
}
else
{
/* XXX */
proto_tree_add_text(tree, asn1->tvb,
asn1->offset, -1, "Unexpected tag, not National or Private TCAP Operation Code");
return;
}
@ -12472,9 +12475,7 @@ dissect_ansi_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
if (NULL == str) return;
tap_rec.message_type = val;
tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
*opr_code_p = val;
if (check_col(pinfo->cinfo, COL_INFO))
{
@ -12943,7 +12944,7 @@ dissect_ansi_map_rr(ASN1_SCK *asn1, proto_tree *tree)
}
static void
dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint *opr_code_p)
{
guint len;
proto_tree *subtree;
@ -12968,7 +12969,7 @@ dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
ansi_map_is_invoke = TRUE;
dissect_ansi_opr_code(asn1, pinfo, tree);
dissect_ansi_opr_code(asn1, pinfo, tree, opr_code_p);
dissect_ansi_params(asn1, tree);
}
@ -12976,6 +12977,7 @@ dissect_ansi_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
static void
dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_map_tree)
{
static ansi_map_tap_rec_t tap_rec;
guint saved_offset;
guint tag;
guint len;
@ -12984,6 +12986,7 @@ dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_ma
proto_tree *subtree, *tag_subtree;
gboolean def_len;
static int i = 0;
gint opr_code;
saved_offset = asn1->offset;
@ -13018,10 +13021,12 @@ dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_ma
tag_subtree = proto_item_add_subtree(tag_item, ett_components);
opr_code = -1;
switch (tag)
{
case ANSI_TC_INVOKE_L:
dissect_ansi_map_invoke(asn1, pinfo, tag_subtree);
dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
break;
case ANSI_TC_RRL:
@ -13037,7 +13042,7 @@ dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_ma
break;
case ANSI_TC_INVOKE_N:
dissect_ansi_map_invoke(asn1, pinfo, tag_subtree);
dissect_ansi_map_invoke(asn1, pinfo, tag_subtree, &opr_code);
break;
case ANSI_TC_RRN:
@ -13045,10 +13050,19 @@ dissect_ansi_map_message(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *ansi_ma
break;
default:
/* XXX */
break;
}
proto_item_set_len(item, asn1->offset - saved_offset);
if (opr_code != -1)
{
tap_rec.message_type = opr_code;
tap_rec.size = asn1->offset - saved_offset;
tap_queue_packet(ansi_map_tap, pinfo, &tap_rec);
}
}
static void

View File

@ -1,6 +1,6 @@
/* packet-ansi_map.h
*
* $Id: packet-ansi_map.h,v 1.1 2003/12/12 19:55:27 guy Exp $
* $Id: packet-ansi_map.h,v 1.2 2004/04/21 05:53:55 guy Exp $
*
* Copyright 2003, Michael Lum <mlum [AT] telostech.com>,
* In association with Telos Technology Inc.
@ -24,8 +24,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define ANSI_MAP_MAX_NUM_MESSAGE_TYPES 256
typedef struct _ansi_map_tap_rec_t {
guint8 message_type;
guint16 size;
} ansi_map_tap_rec_t;

View File

@ -38,7 +38,7 @@
* Formats and coding
* (3GPP TS 24.080 version 4.3.0 Release 4)
*
* $Id: packet-gsm_a.c,v 1.12 2004/03/19 07:54:57 guy Exp $
* $Id: packet-gsm_a.c,v 1.13 2004/04/21 05:53:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -6201,15 +6201,55 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *a
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_A_TC_START_SUBTREE(subtree, saved_offset, tag, "Error Code",
ett_tc_err_code, &def_len[1], &temp_len, temp_subtree);
if (temp_len > 0)
switch (tag)
{
proto_tree_add_text(temp_subtree, asn1->tvb,
asn1->offset, temp_len, "Error Code");
case 0x02:
GSM_A_TC_START_SUBTREE(subtree, saved_offset, tag, "Local Error Code",
ett_tc_err_code, &def_len[1], &temp_len, temp_subtree);
asn1->offset += temp_len;
if (temp_len > 0)
{
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, temp_len, &int_val);
str = match_strval(int_val, gsm_ss_err_code_strings);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, temp_len, "Error Code: %s (%d)",
(str == NULL) ? "Unknown Error Code" : str,
int_val);
}
break;
case 0x06:
GSM_A_TC_START_SUBTREE(subtree, saved_offset, tag, "Global Error Code",
ett_tc_err_code, &def_len[1], &temp_len, temp_subtree);
if (temp_len > 0)
{
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, temp_len, &int_val);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, temp_len, "Error Code: %d",
int_val);
}
break;
default:
GSM_A_TC_START_SUBTREE(subtree, saved_offset, tag, "Unknown Error Code",
ett_tc_err_code, &def_len[1], &temp_len, temp_subtree);
if (temp_len > 0)
{
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, temp_len, &int_val);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, temp_len, "Error Code: %d",
int_val);
}
break;
}
if (!def_len[1])
@ -11183,14 +11223,13 @@ proto_register_gsm_a(void)
};
/* Setup protocol subtree array */
#define NUM_INDIVIDUAL_ELEMS 33
#define NUM_INDIVIDUAL_ELEMS 31
static gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSMAP_MSG +
NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_RR + NUM_GSM_DTAP_MSG_CC +
NUM_GSM_DTAP_MSG_GMM + NUM_GSM_DTAP_MSG_SMS +
NUM_GSM_DTAP_MSG_SM + NUM_GSM_DTAP_MSG_SS + NUM_GSM_RP_MSG +
NUM_GSM_BSSMAP_ELEM + NUM_GSM_DTAP_ELEM];
memset((void *) ett, -1, sizeof(ett));
NUM_GSM_BSSMAP_ELEM + NUM_GSM_DTAP_ELEM +
NUM_GSM_SS_ETT];
ett[0] = &ett_bssmap_msg;
ett[1] = &ett_dtap_msg;
@ -11224,66 +11263,81 @@ proto_register_gsm_a(void)
ett[28] = &ett_tc_err_code;
ett[29] = &ett_tc_prob_code;
ett[30] = &ett_tc_sequence;
ett[31] = &gsm_ss_ett_sequence;
ett[32] = &gsm_ss_ett_param;
last_offset = NUM_INDIVIDUAL_ELEMS;
for (i=0; i < NUM_GSM_BSSMAP_MSG; i++, last_offset++)
{
ett_gsm_bssmap_msg[i] = -1;
ett[last_offset] = &ett_gsm_bssmap_msg[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_MM; i++, last_offset++)
{
ett_gsm_dtap_msg_mm[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_mm[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_RR; i++, last_offset++)
{
ett_gsm_dtap_msg_rr[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_rr[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_CC; i++, last_offset++)
{
ett_gsm_dtap_msg_cc[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_cc[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_GMM; i++, last_offset++)
{
ett_gsm_dtap_msg_gmm[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_gmm[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_SMS; i++, last_offset++)
{
ett_gsm_dtap_msg_sms[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_sms[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_SM; i++, last_offset++)
{
ett_gsm_dtap_msg_sm[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_sm[i];
}
for (i=0; i < NUM_GSM_DTAP_MSG_SS; i++, last_offset++)
{
ett_gsm_dtap_msg_ss[i] = -1;
ett[last_offset] = &ett_gsm_dtap_msg_ss[i];
}
for (i=0; i < NUM_GSM_RP_MSG; i++, last_offset++)
{
ett_gsm_rp_msg[i] = -1;
ett[last_offset] = &ett_gsm_rp_msg[i];
}
for (i=0; i < NUM_GSM_BSSMAP_ELEM; i++, last_offset++)
{
ett_gsm_bssmap_elem[i] = -1;
ett[last_offset] = &ett_gsm_bssmap_elem[i];
}
for (i=0; i < NUM_GSM_DTAP_ELEM; i++, last_offset++)
{
ett_gsm_dtap_elem[i] = -1;
ett[last_offset] = &ett_gsm_dtap_elem[i];
}
for (i=0; i < NUM_GSM_SS_ETT; i++, last_offset++)
{
gsm_ss_ett[i] = -1;
ett[last_offset] = &gsm_ss_ett[i];
}
/* Register the protocol name and description */
proto_a_bssmap =

View File

@ -7,7 +7,7 @@
* Changed to run on new version of TCAP, many changes for
* EOC matching, and parameter separation. (2003)
*
* $Id: packet-gsm_map.c,v 1.10 2004/03/27 11:32:28 guy Exp $
* $Id: packet-gsm_map.c,v 1.11 2004/04/21 05:53:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -313,6 +313,7 @@ static gint ett_param = -1;
static gint ett_params = -1;
static gint ett_problem = -1;
static gint ett_opr_code = -1;
static gint ett_err_code = -1;
typedef struct dgt_set_t
{
@ -1431,7 +1432,10 @@ op_send_rti_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
start_offset = asn1->offset;
if (tcap_check_tag(asn1, 0x89))
/*
* spec says [9] but 'real data' show '04' not '89' !
*/
if (tcap_check_tag(asn1, 0x04))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
@ -1439,6 +1443,14 @@ op_send_rti_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
GSM_MAP_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_MAP_P_IMSI, "IMSI");
}
if (tcap_check_tag(asn1, 0x04))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_MAP_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_MAP_P_ROAMING_NUM, "Roaming Number");
}
dissect_map_params(asn1, subtree, len - (asn1->offset - start_offset));
if (!def_len)
@ -2512,19 +2524,6 @@ dissect_map_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint
proto_item *item;
proto_tree *subtree;
gboolean def_len;
static gsm_map_tap_rec_t tap_rec[4];
static gsm_map_tap_rec_t *tap_p;
static int tap_current=0;
/*
* set tap record pointer
*/
tap_current++;
if (tap_current == 4)
{
tap_current = 0;
}
tap_p = &tap_rec[tap_current];
if (tcap_check_tag(asn1, MAP_OPR_CODE_TAG))
{
@ -2562,10 +2561,6 @@ dissect_map_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint
}
*opr_code_p = val;
tap_p->opr_code_idx = *op_idx_p;
tap_queue_packet(gsm_map_tap, pinfo, tap_p);
}
return(MAP_OK);
@ -2601,14 +2596,16 @@ dissect_map_eoc(ASN1_SCK *asn1, proto_tree *tree)
static void
dissect_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
{
proto_tree *subtree;
guint orig_offset, saved_offset;
guint len;
guint tag;
proto_item *item;
gint op_idx;
gboolean def_len;
int ret;
proto_tree *subtree;
guint orig_offset, saved_offset;
guint len;
guint tag;
proto_item *item;
gint op_idx;
gboolean def_len;
int ret;
int opr_code_sts;
static gsm_map_tap_rec_t tap_rec;
orig_offset = asn1->offset;
saved_offset = asn1->offset;
@ -2632,7 +2629,9 @@ dissect_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
dissect_map_lnkId(asn1, subtree);
if (dissect_map_opr_code(asn1, pinfo, subtree, &op_idx, &g_opr_code) == MAP_OK)
opr_code_sts = dissect_map_opr_code(asn1, pinfo, subtree, &op_idx, &g_opr_code);
if (opr_code_sts == MAP_OK)
{
if (def_len)
{
@ -2662,19 +2661,30 @@ dissect_map_invoke(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree)
}
proto_item_set_len(item, asn1->offset - orig_offset);
if (opr_code_sts == MAP_OK)
{
tap_rec.invoke = TRUE;
tap_rec.opr_code_idx = op_idx;
tap_rec.size = asn1->offset - orig_offset;
tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
}
}
static void
dissect_map_rr(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gchar *str)
{
guint tag, len, comp_len;
gint op_idx;
guint orig_offset, saved_offset;
proto_item *item;
proto_tree *seq_subtree, *subtree;
gboolean def_len;
gboolean comp_def_len;
guint tag, len, comp_len;
gint op_idx;
guint orig_offset, saved_offset;
proto_item *item;
proto_tree *seq_subtree, *subtree;
gboolean def_len;
gboolean comp_def_len;
int opr_code_sts;
static gsm_map_tap_rec_t tap_rec;
tag = -1;
orig_offset = asn1->offset;
@ -2709,6 +2719,8 @@ dissect_map_rr(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gchar *str)
tag = -1;
asn1_id_decode1(asn1, &tag);
opr_code_sts = MAP_FAIL;
if (TCAP_CONSTRUCTOR(tag))
{
GSM_MAP_START_SUBTREE(subtree, saved_offset, tag, "Sequence",
@ -2717,7 +2729,9 @@ dissect_map_rr(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gchar *str)
saved_offset = asn1->offset;
if (dissect_map_opr_code(asn1, pinfo, seq_subtree, &op_idx, &g_opr_code) == MAP_OK)
opr_code_sts = dissect_map_opr_code(asn1, pinfo, seq_subtree, &op_idx, &g_opr_code);
if (opr_code_sts == MAP_OK)
{
len -= asn1->offset - saved_offset;
@ -2746,6 +2760,15 @@ dissect_map_rr(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gchar *str)
}
proto_item_set_len(item, asn1->offset - orig_offset);
if (opr_code_sts == MAP_OK)
{
tap_rec.invoke = FALSE;
tap_rec.opr_code_idx = op_idx;
tap_rec.size = asn1->offset - orig_offset;
tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
}
}
@ -2754,9 +2777,11 @@ dissect_map_re(ASN1_SCK *asn1, proto_tree *tree)
{
guint tag, len, comp_len;
guint orig_offset, saved_offset;
proto_item *item, *null_item;
proto_tree *subtree;
proto_item *item;
proto_tree *subtree, *temp_subtree;
gboolean comp_def_len, def_len;
gchar *str;
gint32 int_val;
tag = -1;
orig_offset = asn1->offset;
@ -2782,38 +2807,66 @@ dissect_map_re(ASN1_SCK *asn1, proto_tree *tree)
dissect_map_invokeId(asn1, subtree);
#define MAP_LOCAL_ERR_CODE_TAG 0x2
#define MAP_GBL_ERR_CODE_TAG 0x6
if (tcap_check_tag(asn1, MAP_LOCAL_ERR_CODE_TAG))
{
tag = -1;
dissect_map_tag(asn1, subtree, &tag, "Local Error Code Tag", &null_item);
}
else if (tcap_check_tag(asn1, MAP_GBL_ERR_CODE_TAG))
{
tag = -1;
dissect_map_tag(asn1, subtree, &tag, "Global Error Code Tag", &null_item);
}
else
{
proto_tree_add_text(subtree, asn1->tvb, asn1->offset, comp_len,
"Unknown Error Code");
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
asn1->offset += comp_len;
#define MAP_LOCAL_ERR_CODE_TAG 0x2
#define MAP_GBL_ERR_CODE_TAG 0x6
if (!comp_def_len)
switch (tag)
{
case MAP_LOCAL_ERR_CODE_TAG:
GSM_MAP_START_SUBTREE(subtree, saved_offset, tag, "Local Error Code",
ett_err_code,
&def_len, &len, temp_subtree);
if (len > 0)
{
dissect_map_eoc(asn1, subtree);
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, len, &int_val);
str = match_strval(int_val, gsm_ss_err_code_strings);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, len, "Error Code: %s (%d)",
(str == NULL) ? "Unknown Error Code" : str,
int_val);
}
break;
proto_item_set_len(item, asn1->offset - orig_offset);
case MAP_GBL_ERR_CODE_TAG:
GSM_MAP_START_SUBTREE(subtree, saved_offset, tag, "Global Error Code",
ett_err_code,
&def_len, &len, temp_subtree);
return(MAP_OK);
if (len > 0)
{
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, len, &int_val);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, len, "Error Code: %d",
int_val);
}
break;
default:
GSM_MAP_START_SUBTREE(subtree, saved_offset, tag, "Unknown Error Code",
ett_err_code,
&def_len, &len, temp_subtree);
if (len > 0)
{
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, len, &int_val);
proto_tree_add_text(temp_subtree, asn1->tvb,
saved_offset, len, "Error Code: %d",
int_val);
}
break;
}
dissect_map_len(asn1, subtree, &def_len, &len);
dissect_map_integer(asn1, subtree, len, "Error Code:");
dissect_map_params(asn1, subtree, comp_len - (asn1->offset - saved_offset));
if (!def_len)
@ -3033,7 +3086,7 @@ proto_register_map(void)
};
/* Setup protocol subtree array */
#define NUM_INDIVIDUAL_PARAMS 8
#define NUM_INDIVIDUAL_PARAMS 9
static gint *ett[NUM_INDIVIDUAL_PARAMS+(GSM_MAP_NUM_OP*2)+NUM_PARAM_1];
memset((void *) ett, 0, sizeof(ett));
@ -3046,6 +3099,7 @@ proto_register_map(void)
ett[5] = &ett_param;
ett[6] = &ett_params;
ett[7] = &ett_problem;
ett[8] = &ett_err_code;
last_offset = NUM_INDIVIDUAL_PARAMS;

View File

@ -1,6 +1,6 @@
/* packet-gsm_map.h
*
* $Id: packet-gsm_map.h,v 1.1 2004/02/11 04:27:44 guy Exp $
* $Id: packet-gsm_map.h,v 1.2 2004/04/21 05:53:56 guy Exp $
*
* Copyright 2004, Michael Lum <mlum [AT] telostech.com>,
* In association with Telos Technology Inc.
@ -24,8 +24,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define GSM_MAP_MAX_NUM_OPR_CODES 256
typedef struct _gsm_map_tap_rec_t {
gboolean invoke;
guint8 opr_code_idx;
guint16 size;
} gsm_map_tap_rec_t;

View File

@ -11,7 +11,7 @@
* Technical realization of Short Message Service (SMS)
* (3GPP TS 23.040 version 5.4.0 Release 5)
*
* $Id: packet-gsm_sms.c,v 1.11 2004/03/27 11:32:29 guy Exp $
* $Id: packet-gsm_sms.c,v 1.12 2004/04/21 05:53:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2574,8 +2574,6 @@ proto_register_gsm_sms(void)
#define NUM_INDIVIDUAL_PARMS 12
static gint *ett[NUM_INDIVIDUAL_PARMS+NUM_MSGS+NUM_UDH_IEIS];
memset((void *) ett, -1, sizeof(ett));
ett[0] = &ett_gsm_sms;
ett[1] = &ett_pid;
ett[2] = &ett_pi;
@ -2593,11 +2591,13 @@ proto_register_gsm_sms(void)
for (i=0; i < NUM_MSGS; i++, last_offset++)
{
ett_msgs[i] = -1;
ett[last_offset] = &ett_msgs[i];
}
for (i=0; i < NUM_UDH_IEIS; i++, last_offset++)
{
ett_udh_ieis[i] = -1;
ett[last_offset] = &ett_udh_ieis[i];
}

View File

@ -19,7 +19,7 @@
* Michael Lum <mlum [AT] telostech.com>,
* Created (2004).
*
* $Id: packet-gsm_ss.c,v 1.2 2004/03/27 11:32:29 guy Exp $
* $Id: packet-gsm_ss.c,v 1.3 2004/04/21 05:53:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -63,6 +63,73 @@
#include "packet-gsm_ss.h"
const value_string gsm_ss_err_code_strings[] = {
{ 1, "Unknown Subscriber" },
{ 3, "Unknown MSC" },
{ 5, "Unidentified Subscriber" },
{ 6, "Absent Subscriber SM" },
{ 7, "Unknown Equipment" },
{ 8, "Roaming Not Allowed" },
{ 9, "Illegal Subscriber" },
{ 10, "Bearer Service Not Provisioned" },
{ 11, "Teleservice Not Provisioned" },
{ 12, "Illegal Equipment" },
{ 13, "Call Barred" },
{ 14, "Forwarding Violation" },
{ 15, "CUG Reject" },
{ 16, "Illegal SS Operation" },
{ 17, "SS Error Status" },
{ 18, "SS Not Available" },
{ 19, "SS Subscription Violation" },
{ 20, "SS Incompatibility" },
{ 21, "Facility Not Supported" },
{ 25, "No Handover Number Available" },
{ 26, "Subsequent Handover Failure" },
{ 27, "Absent Subscriber" },
{ 28, "Incompatible Terminal" },
{ 29, "Short Term Denial" },
{ 30, "Long Term Denial" },
{ 31, "Subscriber Busy For MT SMS" },
{ 32, "SM Delivery Failure" },
{ 33, "Message Waiting List Full" },
{ 34, "System Failure" },
{ 35, "Data Missing" },
{ 36, "Unexpected Data Value" },
{ 37, "PW Registration Failure" },
{ 38, "Negative PW Check" },
{ 39, "No Roaming Number Available" },
{ 40, "Tracing Buffer Full" },
{ 42, "Target Cell Outside Group Call Area" },
{ 43, "Number Of PW Attempts Violation" },
{ 44, "Number Changed" },
{ 45, "Busy Subscriber" },
{ 46, "No Subscriber Reply" },
{ 47, "Forwarding Failed" },
{ 48, "OR Not Allowed" },
{ 49, "ATI Not Allowed" },
{ 50, "No Group Call Number Available" },
{ 51, "Resource Limitation" },
{ 52, "Unauthorized Requesting Network" },
{ 53, "Unauthorized LCS Client" },
{ 54, "Position Method Failure" },
{ 58, "Unknown Or Unreachable LCS Client" },
{ 59, "MM Event Not Supported" },
{ 60, "ATSI Not Allowed" },
{ 61, "ATM Not Allowed" },
{ 62, "Information Not Available" },
{ 71, "Unknown Alphabet" },
{ 72, "USSD Busy" },
{ 120, "Nbr Sb Exceeded" },
{ 121, "Rejected By User" },
{ 122, "Rejected By Network" },
{ 123, "Deflection To Served Subscriber" },
{ 124, "Special Service Code" },
{ 125, "Invalid Deflected To Number" },
{ 126, "Max Number Of MPTY Participants Exceeded" },
{ 127, "Resources Not Available" },
{ 0, NULL }
};
const value_string gsm_ss_opr_code_strings[] = {
{ 10, "Register SS" },
{ 11, "Erase SS" },
@ -78,6 +145,8 @@ const value_string gsm_ss_opr_code_strings[] = {
{ 60, "Unstructured SS Request" },
{ 61, "Unstructured SS Notify" },
{ 77, "Erase CC Entry" },
{ 117, "Call Deflection" },
{ 118, "User User Service" },
{ 119, "Access Register CC Entry" },
{ 120, "Forward CUG Info" },
{ 121, "Split MPTY" },
@ -86,6 +155,9 @@ const value_string gsm_ss_opr_code_strings[] = {
{ 124, "Build MPTY" },
{ 125, "Forward Charge Advice" },
{ 126, "Explicit CT" },
{ 116, "LCS Location Notification" },
{ 115, "LCS MOLR" },
{ 0, NULL }
};
@ -94,8 +166,7 @@ const value_string gsm_ss_opr_code_strings[] = {
static int hf_null = -1;
#define HF_NULL &hf_null
gint gsm_ss_ett_sequence = -1;
gint gsm_ss_ett_param = -1;
gint gsm_ss_ett[NUM_GSM_SS_ETT]; /* initialization is left to users */
static gboolean gsm_ss_seven_bit = FALSE;
static gboolean gsm_ss_eight_bit = FALSE;
@ -747,7 +818,7 @@ param_ussdDCS(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field)
"Data Coding Scheme (%d)",
value);
subtree = proto_item_add_subtree(item, gsm_ss_ett_param);
subtree = proto_item_add_subtree(item, gsm_ss_ett[GSM_SS_ETT_PARAM]);
if ((value & 0xf0) == 0x00)
{
@ -1005,6 +1076,111 @@ param_ia5String(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field)
asn1->offset += len;
}
static void
param_password(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field)
{
guint saved_offset;
hf_field = hf_field;
saved_offset = asn1->offset;
proto_tree_add_text(tree, asn1->tvb, saved_offset, len, "%s",
tvb_format_text(asn1->tvb, saved_offset, len));
asn1->offset += len;
}
static void
param_guidanceInfo(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field)
{
guint saved_offset;
gint32 value;
gchar *str = NULL;
hf_field = hf_field;
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, 1, &value);
switch (value)
{
case 0: str = "enterPW"; break;
case 1: str = "enterNewPW"; break;
case 2: str = "enterNewPW-Again"; break;
default:
str = "Unknown";
break;
}
proto_tree_add_text(tree, asn1->tvb, saved_offset, len, str);
}
static void
param_forwardingOpt(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field)
{
guint saved_offset;
gint32 value;
char bigbuf[1024];
gchar *str = NULL;
hf_field = hf_field;
saved_offset = asn1->offset;
asn1_int32_value_decode(asn1, 1, &value);
other_decode_bitfield_value(bigbuf, value, 0x80, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : %snotification to forwarding party",
bigbuf,
(value & 0x80) ? "" : "no ");
other_decode_bitfield_value(bigbuf, value, 0x40, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : %sredirecting presentation",
bigbuf,
(value & 0x40) ? "" : "no ");
other_decode_bitfield_value(bigbuf, value, 0x20, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : %snotification to calling party",
bigbuf,
(value & 0x20) ? "" : "no ");
other_decode_bitfield_value(bigbuf, value, 0x10, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : unused",
bigbuf);
switch ((value & 0x0c) >> 2)
{
case 0x00: str = "MS not reachable"; break;
case 0x01: str = "MS busy"; break;
case 0x02: str = "No reply"; break;
case 0x03: str = "Unconditional (in SRI result) or Deflection"; break;
}
other_decode_bitfield_value(bigbuf, value, 0x0c, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : forwarding reason, %s (%u)",
bigbuf,
str,
(value & 0x0c) >> 2);
other_decode_bitfield_value(bigbuf, value, 0x03, 8);
proto_tree_add_text(tree, asn1->tvb,
saved_offset, 1,
"%s : unused",
bigbuf);
asn1->offset += len;
}
typedef enum
{
@ -1017,6 +1193,9 @@ typedef enum
GSM_SS_P_USSD_DCS, /* USSD Data Coding Scheme */
GSM_SS_P_USSD_STRING, /* USSD String */
GSM_SS_P_IA5_STRING, /* IA5 String */
GSM_SS_P_PASSWORD, /* Password */
GSM_SS_P_GUIDANCE_INFO, /* Guidance Info */
GSM_SS_P_FORWARDING_OPT, /* Forwarding Options */
GSM_SS_P_NONE /* NONE */
}
param_idx_t;
@ -1033,6 +1212,9 @@ static void (*param_1_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf
param_ussdDCS, /* USSD Data Coding Scheme */
param_ussdString, /* USSD String */
param_ia5String, /* IA5 String */
param_password, /* Password */
param_guidanceInfo, /* Guidance Info */
param_forwardingOpt, /* Forwarding Options */
NULL /* NONE */
};
@ -1046,6 +1228,9 @@ static int *param_1_hf[] = {
HF_NULL, /* USSD Data Coding Scheme */
HF_NULL, /* USSD String */
HF_NULL, /* IA5 String */
HF_NULL, /* Password */
HF_NULL, /* Guidance Info */
HF_NULL, /* Forwarding Options */
NULL /* NONE */
};
@ -1093,7 +1278,7 @@ static int *param_1_hf[] = {
\
if (Ga1 == GSM_SS_P_NONE) \
{ \
_ett_param_idx = gsm_ss_ett_param; \
_ett_param_idx = gsm_ss_ett[GSM_SS_ETT_PARAM]; \
_param_fcn = NULL; \
_param_hf = HF_NULL; \
} \
@ -1148,7 +1333,7 @@ param_forwardingFeature(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Forwarding Feature",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
if (tcap_check_tag(asn1, 0x82))
@ -1196,7 +1381,7 @@ param_forwardingFeature(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_NONE, "Forwarding Options");
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_FORWARDING_OPT, "Forwarding Options");
}
if (tcap_check_tag(asn1, 0x87))
@ -1237,7 +1422,7 @@ param_forwardingFeatureList(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Forwarding Feature List",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
@ -1264,6 +1449,107 @@ param_forwardingFeatureList(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
}
}
static void
param_callBarringFeature(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
guint tag, len;
gboolean def_len;
proto_tree *subtree;
exp_len = exp_len;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Call Barring Feature",
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
if (tcap_check_tag(asn1, 0x82))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_BEARERSERVICE, "Bearerservice");
}
if (tcap_check_tag(asn1, 0x83))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_TELESERVICE, "Teleservice");
}
if (tcap_check_tag(asn1, 0x84))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_SS_STATUS, "SS-Status");
}
if (!def_len)
{
saved_offset = asn1->offset;
asn1_eoc_decode(asn1, -1);
proto_tree_add_text(subtree, asn1->tvb,
saved_offset, asn1->offset - saved_offset, "End of Contents");
}
}
static void
param_callBarringFeatureList(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset, start_offset;
guint tag, len;
gboolean def_len;
proto_tree *subtree;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Call Barring Feature List",
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
while ((tvb_length_remaining(asn1->tvb, asn1->offset) > 0) &&
(!tcap_check_tag(asn1, 0)))
{
if ((exp_len != 0) &&
((asn1->offset - saved_offset) >= exp_len))
{
break;
}
param_callBarringFeature(asn1, subtree, len - (asn1->offset - start_offset));
}
if (!def_len)
{
saved_offset = asn1->offset;
asn1_eoc_decode(asn1, -1);
proto_tree_add_text(subtree, asn1->tvb,
saved_offset, asn1->offset - saved_offset, "End of Contents");
}
}
static void
param_ssData(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
saved_offset = asn1->offset;
/* XXX */
op_generic_ss(asn1, tree, exp_len);
}
static void
param_ssInfo(ASN1_SCK *asn1, proto_tree *tree)
{
@ -1279,7 +1565,7 @@ param_ssInfo(ASN1_SCK *asn1, proto_tree *tree)
{
case 0xa0: /* forwardingInfo */
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Forwarding Info",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
@ -1306,13 +1592,20 @@ param_ssInfo(ASN1_SCK *asn1, proto_tree *tree)
case 0xa1: /* callBarringInfo */
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Call Barring Info",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
/* XXX */
op_generic_ss(asn1, subtree, len - (asn1->offset - start_offset));
if (tcap_check_tag(asn1, 0x04))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_SS_CODE, "SS-Code");
}
param_callBarringFeatureList(asn1, subtree, len - (asn1->offset - start_offset));
if (!def_len)
{
@ -1326,13 +1619,12 @@ param_ssInfo(ASN1_SCK *asn1, proto_tree *tree)
case 0xa3: /* ss-Data */
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "ss-Data",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
/* XXX */
op_generic_ss(asn1, subtree, len - (asn1->offset - start_offset));
param_ssData(asn1, subtree, len - (asn1->offset - start_offset));
if (!def_len)
{
@ -1345,7 +1637,20 @@ param_ssInfo(ASN1_SCK *asn1, proto_tree *tree)
break;
default:
/* XXX */
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Unexpected TAG",
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
op_generic_ss(asn1, subtree, len);
if (!def_len)
{
saved_offset = asn1->offset;
asn1_eoc_decode(asn1, -1);
proto_tree_add_text(subtree, asn1->tvb,
saved_offset, asn1->offset - saved_offset, "End of Contents");
}
break;
}
}
@ -1362,7 +1667,7 @@ param_ssForBS(ASN1_SCK *asn1, proto_tree *tree)
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Sequence",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
@ -1425,7 +1730,51 @@ param_ussdArg(ASN1_SCK *asn1, proto_tree *tree)
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Sequence",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_USSD_DCS, "USSD Data Coding Scheme");
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_USSD_STRING, "USSD String");
rem_len = len - (asn1->offset - start_offset);
if (rem_len > 0)
{
op_generic_ss(asn1, subtree, rem_len);
}
if (!def_len)
{
saved_offset = asn1->offset;
asn1_eoc_decode(asn1, -1);
proto_tree_add_text(subtree, asn1->tvb,
saved_offset, asn1->offset - saved_offset, "End of Contents");
}
}
static void
param_ussdRes(ASN1_SCK *asn1, proto_tree *tree)
{
guint saved_offset, start_offset;
guint tag, len, rem_len;
gboolean def_len = FALSE;
proto_tree *subtree;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Sequence",
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
@ -1486,7 +1835,7 @@ op_generic_ss(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
if (TCAP_CONSTRUCTOR(tag))
{
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Sequence",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
op_generic_ss(asn1, subtree, len);
@ -1530,7 +1879,7 @@ op_generic_ss(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
proto_tree_add_text(tree, asn1->tvb,
saved_offset, (asn1->offset - saved_offset) + len, "Parameter");
subtree = proto_item_add_subtree(item, gsm_ss_ett_param);
subtree = proto_item_add_subtree(item, gsm_ss_ett[GSM_SS_ETT_PARAM]);
proto_tree_add_text(subtree, asn1->tvb,
saved_offset, len_offset - saved_offset,
@ -1564,16 +1913,8 @@ op_register_ss(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
if (TCAP_CONSTRUCTOR(tag) == FALSE)
{
/*
* Hmmm, unexpected
*/
return;
}
GSM_SS_START_SUBTREE(tree, saved_offset, tag, "Sequence",
gsm_ss_ett_sequence,
gsm_ss_ett[GSM_SS_ETT_SEQUENCE],
&def_len, &len, subtree);
start_offset = asn1->offset;
@ -1631,6 +1972,22 @@ op_register_ss(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_NONE, "Default Priority");
}
if (tcap_check_tag(asn1, 0x88))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_NONE, "Number Users");
}
if (tcap_check_tag(asn1, 0x89))
{
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(subtree, saved_offset, tag, GSM_SS_P_NONE, "Long FTN supported");
}
rem_len = len - (asn1->offset - start_offset);
if (rem_len > 0)
@ -1777,26 +2134,122 @@ op_interrogate_ss_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
case 0x80: /* SS-Status */
GSM_SS_PARAM_DISPLAY(tree, saved_offset, tag, GSM_SS_P_SS_STATUS, "SS-Status");
return;
break;
case 0x82: /* BasicServiceGroupList */
/* FALLTHRU */
/* XXX */
asn1->offset = saved_offset;
op_generic_ss(asn1, tree, exp_len);
break;
case 0x83: /* ForwardingFeatureList */
/* FALLTHRU */
asn1->offset = saved_offset;
param_forwardingFeatureList(asn1, tree, exp_len);
break;
case 0x84: /* GenericServiceInfo */
/*
* XXX
* needs implementing, let "generic" parameter dissector handle it for now
*/
/* XXX */
asn1->offset = saved_offset;
op_generic_ss(asn1, tree, exp_len);
break;
default:
/* do nothing - unexpected tag */
asn1->offset = saved_offset;
op_generic_ss(asn1, tree, exp_len);
return;
}
}
op_generic_ss(asn1, tree, 0);
static void
op_reg_password(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
guint tag, rem_len;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(tree, saved_offset, tag, GSM_SS_P_SS_CODE, "SS-Code");
rem_len = exp_len - (asn1->offset - saved_offset);
if (rem_len > 0)
{
op_generic_ss(asn1, tree, rem_len);
}
}
static void
op_reg_password_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
guint tag, rem_len;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(tree, saved_offset, tag, GSM_SS_P_PASSWORD, "New Password");
rem_len = exp_len - (asn1->offset - saved_offset);
if (rem_len > 0)
{
op_generic_ss(asn1, tree, rem_len);
}
}
static void
op_get_password(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
guint tag, rem_len;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(tree, saved_offset, tag, GSM_SS_P_GUIDANCE_INFO, "Guidance Info");
rem_len = exp_len - (asn1->offset - saved_offset);
if (rem_len > 0)
{
op_generic_ss(asn1, tree, rem_len);
}
}
static void
op_get_password_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
guint tag, rem_len;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
asn1_id_decode1(asn1, &tag);
GSM_SS_PARAM_DISPLAY(tree, saved_offset, tag, GSM_SS_P_PASSWORD, "Current Password");
rem_len = exp_len - (asn1->offset - saved_offset);
if (rem_len > 0)
{
op_generic_ss(asn1, tree, rem_len);
}
}
static void
@ -1869,6 +2322,20 @@ op_proc_uss_req(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
param_ussdArg(asn1, tree);
}
static void
op_proc_uss_req_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
param_ussdRes(asn1, tree);
}
static void
op_uss_req(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
@ -1883,6 +2350,20 @@ op_uss_req(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
param_ussdArg(asn1, tree);
}
static void
op_uss_req_rr(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
guint saved_offset;
exp_len = exp_len;
if (tvb_length_remaining(asn1->tvb, asn1->offset) <= 0) return;
saved_offset = asn1->offset;
param_ussdRes(asn1, tree);
}
static void
op_uss_notify(ASN1_SCK *asn1, proto_tree *tree, guint exp_len)
{
@ -1905,49 +2386,57 @@ static void (*op_fcn[])(ASN1_SCK *asn1, proto_tree *tree, guint exp_len) = {
op_deactivate_ss, /* DeactivateSS */
op_interrogate_ss, /* InterrogateSS */
NULL, /* NotifySS */
NULL, /* RegisterPassword */
NULL, /* GetPassword */
op_reg_password, /* RegisterPassword */
op_get_password, /* GetPassword */
op_proc_uss_data, /* ProcessUnstructuredSS-Data */
NULL, /* ForwardCheckSS-Indication */
op_proc_uss_req, /* ProcessUnstructuredSS-Request */
op_uss_req, /* UnstructuredSS-Request */
op_uss_req, /* UnstructuredSS-Request */
op_uss_notify, /* UnstructuredSS-Notify */
NULL, /* EraseCC-Entry */
NULL, /* LCS-LocationNotification */
NULL, /* LCS-MOLR */
NULL, /* AccessRegisterCCEntry */
NULL, /* ForwardCUG-Info */
NULL, /* SplitMPTY */
NULL, /* RetrieveMPTY */
NULL, /* HoldMPTY */
NULL, /* BuildMPTY */
NULL /* NO ARGS */, /* SplitMPTY */
NULL /* NO ARGS */, /* RetrieveMPTY */
NULL /* NO ARGS */, /* HoldMPTY */
NULL /* NO ARGS */, /* BuildMPTY */
NULL, /* ForwardChargeAdvice */
NULL, /* ExplicitCT */
NULL, /* LCS-LocationNotification */
NULL, /* LCS-MOLR */
NULL /* NONE */
};
static void (*op_fcn_rr[])(ASN1_SCK *asn1, proto_tree *tree, guint exp_len) = {
op_register_ss_rr, /* RegisterSS */
op_erase_ss_rr, /* EraseSS */
op_activate_ss_rr, /* ActivateSS */
op_register_ss_rr, /* RegisterSS */
op_erase_ss_rr, /* EraseSS */
op_activate_ss_rr, /* ActivateSS */
op_deactivate_ss_rr, /* DeactivateSS */
op_interrogate_ss_rr, /* InterrogateSS */
NULL, /* NotifySS */
NULL, /* RegisterPassword */
NULL, /* GetPassword */
op_reg_password_rr, /* RegisterPassword */
op_get_password_rr, /* GetPassword */
op_proc_uss_data_rr, /* ProcessUnstructuredSS-Data */
NULL, /* ForwardCheckSS-Indication */
NULL, /* ProcessUnstructuredSS-Request */
NULL, /* UnstructuredSS-Request */
NULL, /* UnstructuredSS-Notify */
op_proc_uss_req_rr, /* ProcessUnstructuredSS-Request */
op_uss_req_rr, /* UnstructuredSS-Request */
NULL /* NO ARGS */, /* UnstructuredSS-Notify */
NULL, /* EraseCC-Entry */
NULL, /* LCS Location Notification */
NULL, /* LCS MOLR */
NULL, /* AccessRegisterCCEntry */
NULL, /* ForwardCUG-Info */
NULL, /* SplitMPTY */
NULL, /* RetrieveMPTY */
NULL, /* HoldMPTY */
NULL, /* BuildMPTY */
NULL, /* ForwardChargeAdvice */
NULL /* NO ARGS */, /* ForwardChargeAdvice */
NULL, /* ExplicitCT */
NULL, /* LCS-LocationNotification */
NULL, /* LCS-MOLR */
NULL /* NONE */
};
@ -1978,8 +2467,8 @@ gsm_ss_dissect(ASN1_SCK *asn1, proto_tree *tree, guint exp_len,
break;
case TCAP_COMP_RE:
/* XXX */
break;
dissect_fcn = NULL;
return;
default:
/*

View File

@ -1,6 +1,6 @@
/* packet-gsm_ss.h
*
* $Id: packet-gsm_ss.h,v 1.2 2004/03/27 11:32:29 guy Exp $
* $Id: packet-gsm_ss.h,v 1.3 2004/04/21 05:53:56 guy Exp $
*
* Copyright 2004, Michael Lum <mlum [AT] telostech.com>,
* In association with Telos Technology Inc.
@ -24,10 +24,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
extern gint gsm_ss_ett_sequence;
extern gint gsm_ss_ett_param;
typedef enum
{
GSM_SS_ETT_SEQUENCE,
GSM_SS_ETT_PARAM
}
gsm_ss_ett_e;
#define NUM_GSM_SS_ETT sizeof(gsm_ss_ett_e)
extern gint gsm_ss_ett[];
extern const value_string gsm_ss_opr_code_strings[];
extern const value_string gsm_ss_err_code_strings[];
extern void param_AddressString(ASN1_SCK *asn1, proto_tree *tree, guint len, int hf_field);
extern void gsm_ss_dissect(ASN1_SCK *asn1, proto_tree *tree, guint exp_len, guint opr_code, guint comp_type_tag);

View File

@ -1,6 +1,6 @@
/* packet-isup.h
*
* $Id: packet-isup.h,v 1.1 2003/12/12 19:55:27 guy Exp $
* $Id: packet-isup.h,v 1.2 2004/04/21 05:53:56 guy Exp $
*
* Copyright 2003, Michael Lum <mlum [AT] telostech.com>,
* In association with Telos Technology Inc.
@ -24,6 +24,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define ISUP_MAX_NUM_MESSAGE_TYPES 256
typedef struct _isup_tap_rec_t {
guint8 message_type;
} isup_tap_rec_t;

View File

@ -9,7 +9,7 @@
* Copyright 2001, Michael Tuexen <tuexen [AT] fh-muenster.de>
* Updated for ANSI and Chinese ITU support by Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
* $Id: packet-mtp3.c,v 1.26 2004/02/29 08:30:10 guy Exp $
* $Id: packet-mtp3.c,v 1.27 2004/04/21 05:53:56 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -36,6 +36,7 @@
# include "config.h"
#endif
#include <string.h>
#include <glib.h>
#ifdef NEED_SNPRINTF_H
@ -43,10 +44,14 @@
#endif
#include <epan/packet.h>
#include "tap.h"
#include "prefs.h"
/* Initialize the protocol and registered fields */
static int proto_mtp3 = -1;
static int mtp3_tap = -1;
static module_t *mtp3_module;
static int hf_mtp3_service_indicator = -1;
@ -124,7 +129,7 @@ static mtp3_addr_pc_t mtp3_addr_dpc, mtp3_addr_opc;
#define ANSI_8BIT_SLS_MASK 0xFF
#define CHINESE_ITU_SLS_MASK 0xF
static const value_string service_indicator_code_vals[] = {
static const value_string mtp3_service_indicator_code_vals[] = {
{ 0x0, "Signalling Network Management Message (SNM)" },
{ 0x1, "Maintenance Regular Message (MTN)" },
{ 0x2, "Maintenance Special Message (MTNS)" },
@ -144,6 +149,19 @@ static const value_string service_indicator_code_vals[] = {
{ 0, NULL }
};
const value_string mtp3_service_indicator_code_short_vals[] = {
{ 0x0, "SNM" },
{ 0x1, "MTN" },
{ 0x2, "MTNS" },
{ 0x3, "SCCP" },
{ 0x4, "TUP" },
{ 0x5, "ISUP" },
{ 0x6, "DUP (CC)" },
{ 0x7, "DUP (FAC/CANC)" },
{ 0x8, "MTP Test" },
{ 0, NULL }
};
static const value_string network_indicator_vals[] = {
{ 0x0, "International network" },
{ 0x1, "Spare (for international use only)" },
@ -455,6 +473,7 @@ dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void
dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
mtp3_tap_rec_t tap_rec;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *mtp3_item = NULL;
@ -491,10 +510,21 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
memset(&mtp3_addr_opc, 0, sizeof(mtp3_addr_opc));
memset(&mtp3_addr_dpc, 0, sizeof(mtp3_addr_dpc));
/* Dissect the packet (even if !tree so can call sub-dissectors and update
* the source and destination address columns) */
dissect_mtp3_sio(tvb, pinfo, mtp3_tree);
dissect_mtp3_routing_label(tvb, pinfo, mtp3_tree);
tap_rec.addr_opc = mtp3_addr_opc;
tap_rec.addr_dpc = mtp3_addr_dpc;
tap_rec.si_code = (tvb_get_guint8(tvb, SIO_OFFSET) & SERVICE_INDICATOR_MASK);
tap_rec.size = tvb_length(tvb);
tap_queue_packet(mtp3_tap, pinfo, &tap_rec);
dissect_mtp3_payload(tvb, pinfo, tree);
}
@ -506,7 +536,7 @@ proto_register_mtp3(void)
static hf_register_info hf[] = {
{ &hf_mtp3_service_indicator,
{ "Service indicator", "mtp3.service_indicator",
FT_UINT8, BASE_HEX, VALS(service_indicator_code_vals), SERVICE_INDICATOR_MASK,
FT_UINT8, BASE_HEX, VALS(mtp3_service_indicator_code_vals), SERVICE_INDICATOR_MASK,
"", HFILL }},
{ &hf_mtp3_network_indicator,
{ "Network indicator", "mtp3.network_indicator",
@ -632,6 +662,8 @@ proto_register_mtp3(void)
"MTP3 Service indicator",
FT_UINT8, BASE_HEX);
mtp3_tap = register_tap("mtp3");
mtp3_module = prefs_register_protocol(proto_mtp3, NULL);
prefs_register_enum_preference(mtp3_module, "standard", "MTP3 standard",

View File

@ -1,6 +1,6 @@
/* packet-mtp3.h
*
* $Id: packet-mtp3.h,v 1.4 2003/12/08 21:36:53 guy Exp $
* $Id: packet-mtp3.h,v 1.5 2004/04/21 05:53:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -43,6 +43,13 @@ typedef struct _mtp3_addr_pc_t {
guint8 ni;
} mtp3_addr_pc_t;
typedef struct _mtp3_tap_rec_t {
mtp3_addr_pc_t addr_opc;
mtp3_addr_pc_t addr_dpc;
guint8 si_code;
guint16 size;
} mtp3_tap_rec_t;
#define ITU_PC_LENGTH 2
#define ITU_PC_MASK 0x3FFF
@ -58,3 +65,14 @@ typedef struct _mtp3_addr_pc_t {
#define ANSI_PC_STRING_LENGTH 16
extern void mtp3_addr_to_str_buf(const guint8 *data, gchar *buf);
/*
* the following allows TAP code access to the different SIs
* without having to duplicate it
*/
extern const value_string mtp3_service_indicator_code_short_vals[];
/*
* I only want to gather stats for non-spare SI codes
*/
#define MTP3_NUM_SI_CODE 9