Have the time field in the Graph Analyzis windos use the same time format as used...
[metze/wireshark/wip.git] / gtk / gsm_a_stat.c
1 /* gsm_a_stat.c
2  *
3  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
4  * In association with Telos Technology Inc.
5  *
6  * MUCH code modified from service_response_time_table.c.
7  *
8  * $Id$
9  *
10  * Wireshark - Network traffic analyzer
11  * By Gerald Combs <gerald@wireshark.org>
12  * Copyright 1998 Gerald Combs
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  */
28
29 /*
30  * This TAP provides statistics for the GSM A-Interface:
31  */
32
33 #ifdef HAVE_CONFIG_H
34 # include "config.h"
35 #endif
36 #include <string.h>
37
38 #include <gtk/gtk.h>
39
40 #include "epan/packet_info.h"
41 #include "epan/epan.h"
42 #include "epan/value_string.h"
43 #include <epan/stat_cmd_args.h>
44 #include <epan/tap.h>
45 #include <epan/dissectors/packet-bssap.h>
46 #include <epan/dissectors/packet-gsm_a_common.h>
47
48 #include "../stat_menu.h"
49 #include "../simple_dialog.h"
50
51 #include "gtk/gui_stat_menu.h"
52 #include "gtk/dlg_utils.h"
53 #include "gtk/filter_dlg.h"
54 #include "gtk/gui_utils.h"
55
56 #include "gtk/old-gtk-compat.h"
57
58 enum
59 {
60     IEI_COLUMN,
61     MSG_NAME_COLUMN,
62     COUNT_COLUMN,
63     N_COLUMN /* The number of columns */
64 };
65
66 typedef struct _gsm_a_stat_dlg_t {
67     GtkWidget       *win;
68     GtkWidget       *scrolled_win;
69     GtkWidget       *table;
70 } gsm_a_stat_dlg_t;
71
72 typedef struct _gsm_a_stat_t {
73     int     bssmap_message_type[0xff];
74     int     dtap_mm_message_type[0xff];
75     int     dtap_rr_message_type[0xff];
76     int     dtap_cc_message_type[0xff];
77     int     dtap_gmm_message_type[0xff];
78     int     dtap_sms_message_type[0xff];
79     int     dtap_sm_message_type[0xff];
80     int     dtap_ss_message_type[0xff];
81     int     dtap_tp_message_type[0xff];
82     int     sacch_rr_message_type[0xff];
83 } gsm_a_stat_t;
84
85
86 static gsm_a_stat_dlg_t     dlg_bssmap;
87 static gsm_a_stat_dlg_t     dlg_dtap_mm;
88 static gsm_a_stat_dlg_t     dlg_dtap_rr;
89 static gsm_a_stat_dlg_t     dlg_dtap_cc;
90 static gsm_a_stat_dlg_t     dlg_dtap_gmm;
91 static gsm_a_stat_dlg_t     dlg_dtap_sms;
92 static gsm_a_stat_dlg_t     dlg_dtap_sm;
93 static gsm_a_stat_dlg_t     dlg_dtap_ss;
94 static gsm_a_stat_dlg_t     dlg_dtap_tp;
95 static gsm_a_stat_dlg_t     dlg_sacch_rr;
96 static gsm_a_stat_t         gsm_a_stat;
97
98 /* Create list */
99 static
100 GtkWidget* create_list(void)
101 {
102
103     GtkListStore *list_store;
104     GtkWidget *list;
105     GtkTreeViewColumn *column;
106     GtkCellRenderer *renderer;
107     GtkTreeSortable *sortable;
108     GtkTreeView     *list_view;
109     GtkTreeSelection  *selection;
110
111     /* Create the store */
112     list_store = gtk_list_store_new(N_COLUMN,   /* Total number of columns XXX*/
113                                G_TYPE_UINT,     /* IEI              */
114                                G_TYPE_STRING,   /* Message Name     */
115                                G_TYPE_UINT);    /* Count            */
116
117     /* Create a view */
118     list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
119
120     list_view = GTK_TREE_VIEW(list);
121     sortable = GTK_TREE_SORTABLE(list_store);
122
123     /* Speed up the list display */
124     gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
125
126     /* Setup the sortable columns */
127     gtk_tree_sortable_set_sort_column_id(sortable, IEI_COLUMN, GTK_SORT_ASCENDING);
128     gtk_tree_view_set_headers_clickable(list_view, FALSE);
129
130     /* The view now holds a reference.  We can get rid of our own reference */
131     g_object_unref (G_OBJECT (list_store));
132
133     /*
134      * Create the first column packet, associating the "text" attribute of the
135      * cell_renderer to the first column of the model
136      */
137     renderer = gtk_cell_renderer_text_new ();
138     column = gtk_tree_view_column_new_with_attributes ("IEI", renderer,
139         "text", IEI_COLUMN,
140         NULL);
141
142     /* gtk_tree_view_column_set_cell_data_func(column, renderer, present_as_hex_func,
143         GINT_TO_POINTER(IEI_COLUMN), NULL);
144         */
145
146     gtk_tree_view_column_set_sort_column_id(column, IEI_COLUMN);
147     gtk_tree_view_column_set_resizable(column, TRUE);
148     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
149     gtk_tree_view_column_set_min_width(column, 50);
150
151     /* Add the column to the view. */
152     gtk_tree_view_append_column (list_view, column);
153
154     /* Second column.. Message Name. */
155     renderer = gtk_cell_renderer_text_new ();
156     column = gtk_tree_view_column_new_with_attributes ("Message Name", renderer,
157         "text", MSG_NAME_COLUMN,
158         NULL);
159     gtk_tree_view_column_set_sort_column_id(column, MSG_NAME_COLUMN);
160     gtk_tree_view_column_set_resizable(column, TRUE);
161     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
162     gtk_tree_view_column_set_min_width(column, 280);
163     gtk_tree_view_append_column (list_view, column);
164
165     /* Third column.. Count. */
166     renderer = gtk_cell_renderer_text_new ();
167     column = gtk_tree_view_column_new_with_attributes ("Count", renderer,
168         "text", COUNT_COLUMN,
169         NULL);
170
171
172     gtk_tree_view_column_set_sort_column_id(column, COUNT_COLUMN);
173     gtk_tree_view_column_set_resizable(column, TRUE);
174     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
175     gtk_tree_view_column_set_min_width(column, 50);
176     gtk_tree_view_append_column (list_view, column);
177
178     /* Now enable the sorting of each column */
179     gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), TRUE);
180     gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(list_view), TRUE);
181
182     /* Setup the selection handler */
183     selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
184     gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
185
186     return list;
187
188 }
189 static void
190 gsm_a_stat_reset(
191     void        *tapdata)
192 {
193     gsm_a_stat_t    *stat_p = tapdata;
194
195     memset(stat_p, 0, sizeof(gsm_a_stat_t));
196 }
197
198
199 static gboolean
200 gsm_a_stat_packet(
201     void        *tapdata,
202     packet_info     *pinfo _U_,
203     epan_dissect_t  *edt _U_,
204     const void      *data)
205 {
206     gsm_a_stat_t    *stat_p = tapdata;
207     const gsm_a_tap_rec_t   *data_p = data;
208
209     switch (data_p->pdu_type)
210     {
211     case BSSAP_PDU_TYPE_BSSMAP:
212         stat_p->bssmap_message_type[data_p->message_type]++;
213         break;
214
215     case BSSAP_PDU_TYPE_DTAP:
216         switch (data_p->protocol_disc)
217         {
218         case PD_CC:
219             stat_p->dtap_cc_message_type[data_p->message_type]++;
220             break;
221         case PD_MM:
222             stat_p->dtap_mm_message_type[data_p->message_type]++;
223             break;
224         case PD_RR:
225             stat_p->dtap_rr_message_type[data_p->message_type]++;
226             break;
227         case PD_GMM:
228             stat_p->dtap_gmm_message_type[data_p->message_type]++;
229             break;
230         case PD_SMS:
231             stat_p->dtap_sms_message_type[data_p->message_type]++;
232             break;
233         case PD_SM:
234             stat_p->dtap_sm_message_type[data_p->message_type]++;
235             break;
236         case PD_SS:
237             stat_p->dtap_ss_message_type[data_p->message_type]++;
238             break;
239         case PD_TP:
240             stat_p->dtap_tp_message_type[data_p->message_type]++;
241             break;
242         default:
243             /*
244              * unsupported PD
245              */
246             return(FALSE);
247     }
248     break;
249
250     case GSM_A_PDU_TYPE_SACCH:
251         switch (data_p->protocol_disc)
252         {
253         case 0:
254             stat_p->sacch_rr_message_type[data_p->message_type]++;
255             break;
256         default:
257             /* unknown Short PD */
258             break;
259         }
260         break;
261
262     default:
263     /*
264      * unknown PDU type !!!
265      */
266     return(FALSE);
267     }
268
269     return(TRUE);
270 }
271
272
273 static void
274 gsm_a_stat_draw_aux(
275     gsm_a_stat_dlg_t    *dlg_p,
276     int                 *message_count,
277     const value_string  *msg_strings)
278 {
279     GtkListStore *list_store;
280     GtkTreeIter  iter;
281     int          i;
282
283
284     if (dlg_p->win != NULL){
285         i = 0;
286         list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (dlg_p->table))); /* Get store */
287
288         while (msg_strings[i].strptr){
289             /* Creates a new row at position. iter will be changed to point to this new row.
290              * If position is larger than the number of rows on the list, then the new row will be appended to the list.
291              * The row will be filled with the values given to this function.
292              * :
293              * should generally be preferred when inserting rows in a sorted list store.
294              */
295             gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
296                     IEI_COLUMN, msg_strings[i].value,
297                     MSG_NAME_COLUMN, (char *)msg_strings[i].strptr,
298                     COUNT_COLUMN, message_count[msg_strings[i].value],
299                     -1);
300             i++;
301         }
302     }
303 }
304
305 static void
306 gsm_a_stat_draw(
307     void        *tapdata)
308 {
309     gsm_a_stat_t    *stat_p = tapdata;
310
311     if (!tapdata) return;
312
313     if (dlg_bssmap.win != NULL)
314     {
315         gsm_a_stat_draw_aux(&dlg_bssmap,
316             stat_p->bssmap_message_type,
317             gsm_a_bssmap_msg_strings);
318     }
319
320     if (dlg_dtap_mm.win != NULL)
321     {
322         gsm_a_stat_draw_aux(&dlg_dtap_mm,
323             stat_p->dtap_mm_message_type,
324             gsm_a_dtap_msg_mm_strings);
325     }
326
327     if (dlg_dtap_rr.win != NULL)
328     {
329         gsm_a_stat_draw_aux(&dlg_dtap_rr,
330             stat_p->dtap_rr_message_type,
331             gsm_a_dtap_msg_rr_strings);
332     }
333
334     if (dlg_dtap_cc.win != NULL)
335     {
336         gsm_a_stat_draw_aux(&dlg_dtap_cc,
337             stat_p->dtap_cc_message_type,
338             gsm_a_dtap_msg_cc_strings);
339     }
340
341     if (dlg_dtap_gmm.win != NULL)
342     {
343         gsm_a_stat_draw_aux(&dlg_dtap_gmm,
344             stat_p->dtap_gmm_message_type,
345             gsm_a_dtap_msg_gmm_strings);
346     }
347
348     if (dlg_dtap_sms.win != NULL)
349     {
350         gsm_a_stat_draw_aux(&dlg_dtap_sms,
351             stat_p->dtap_sms_message_type,
352             gsm_a_dtap_msg_sms_strings);
353     }
354
355     if (dlg_dtap_sm.win != NULL)
356     {
357         gsm_a_stat_draw_aux(&dlg_dtap_sm,
358             stat_p->dtap_sm_message_type,
359             gsm_a_dtap_msg_sm_strings);
360     }
361
362     if (dlg_dtap_ss.win != NULL)
363     {
364         gsm_a_stat_draw_aux(&dlg_dtap_ss,
365             stat_p->dtap_ss_message_type,
366             gsm_a_dtap_msg_ss_strings);
367     }
368
369     if (dlg_dtap_tp.win != NULL)
370     {
371         gsm_a_stat_draw_aux(&dlg_dtap_tp,
372             stat_p->dtap_tp_message_type,
373             gsm_a_dtap_msg_tp_strings);
374     }
375
376     if (dlg_sacch_rr.win != NULL)
377     {
378         gsm_a_stat_draw_aux(&dlg_sacch_rr,
379             stat_p->sacch_rr_message_type,
380             gsm_a_rr_short_pd_msg_strings);
381     }
382 }
383
384
385
386 static void
387 gsm_a_stat_gtk_win_destroy_cb(
388     GtkWindow       *win _U_,
389     gpointer        user_data)
390 {
391     memset((void *) user_data, 0, sizeof(gsm_a_stat_dlg_t));
392 }
393
394
395 static void
396 gsm_a_stat_gtk_win_create(
397     gsm_a_stat_dlg_t    *dlg_p,
398     const char      *title)
399 {
400     GtkWidget       *vbox;
401     GtkWidget       *bt_close;
402     GtkWidget       *bbox;
403
404
405     dlg_p->win = dlg_window_new(title);  /* transient_for top_level */
406     gtk_window_set_destroy_with_parent (GTK_WINDOW(dlg_p->win), TRUE);
407     gtk_window_set_default_size(GTK_WINDOW(dlg_p->win), 490, 500);
408
409     vbox = gtk_vbox_new(FALSE, 3);
410     gtk_container_add(GTK_CONTAINER(dlg_p->win), vbox);
411     gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
412
413     dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
414     gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
415
416     dlg_p->table = create_list();
417     gtk_container_add(GTK_CONTAINER(dlg_p->scrolled_win), dlg_p->table);
418
419     /* Button row. */
420     bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
421     gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
422
423     bt_close = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
424     window_set_cancel_button(dlg_p->win, bt_close, window_cancel_button_cb);
425
426     g_signal_connect(dlg_p->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
427     g_signal_connect(dlg_p->win, "destroy", G_CALLBACK(gsm_a_stat_gtk_win_destroy_cb), dlg_p);
428
429     gtk_widget_show_all(dlg_p->win);
430     window_present(dlg_p->win);
431 }
432
433 void gsm_a_stat_gtk_bssmap_cb(GtkAction *action _U_, gpointer user_data _U_ )
434 {
435  /*   int           i;*/
436
437
438     /*
439      * if the window is already open, bring it to front
440      */
441     if (dlg_bssmap.win)
442     {
443     gdk_window_raise(gtk_widget_get_window(dlg_bssmap.win));
444     return;
445     }
446
447     gsm_a_stat_gtk_win_create(&dlg_bssmap, "GSM A-I/F BSSMAP Statistics");
448     gsm_a_stat_draw(&gsm_a_stat);
449 }
450
451
452 static void
453 gsm_a_stat_gtk_bssmap_init(
454     const char      *optarg _U_,
455     void* userdata _U_)
456 {
457     gsm_a_stat_gtk_bssmap_cb(NULL, NULL);
458 }
459
460 static void
461 gsm_a_stat_gtk_dtap_cb(
462     GtkAction *action _U_,
463     gpointer user_data _U_,
464     gsm_a_stat_dlg_t    *dlg_dtap_p,
465     const char      *title,
466     const value_string  *dtap_msg_strings _U_)
467 {
468
469     /*
470      * if the window is already open, bring it to front
471      */
472     if (dlg_dtap_p->win)
473     {
474     gdk_window_raise(gtk_widget_get_window(dlg_dtap_p->win));
475     return;
476     }
477
478     gsm_a_stat_gtk_win_create(dlg_dtap_p, title);
479
480     gsm_a_stat_draw(&gsm_a_stat);
481 }
482
483 void
484 gsm_a_stat_gtk_dtap_mm_cb(GtkAction *action, gpointer user_data )
485 {
486     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_mm,
487     "GSM A-I/F DTAP Mobility Management Statistics",
488     gsm_a_dtap_msg_mm_strings);
489 }
490
491 static void
492 gsm_a_stat_gtk_dtap_mm_init(const char      *optarg _U_,
493                             void* userdata _U_)
494 {
495     gsm_a_stat_gtk_dtap_mm_cb(NULL, NULL);
496 }
497
498 void
499 gsm_a_stat_gtk_dtap_rr_cb(GtkAction *action, gpointer user_data )
500 {
501     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_rr,
502     "GSM A-I/F DTAP Radio Resource Management Statistics",
503     gsm_a_dtap_msg_rr_strings);
504 }
505
506 static void
507 gsm_a_stat_gtk_dtap_rr_init(const char      *optarg _U_,
508                             void* userdata _U_)
509 {
510     gsm_a_stat_gtk_dtap_rr_cb(NULL, NULL);
511 }
512
513 void
514 gsm_a_stat_gtk_dtap_cc_cb(GtkAction *action, gpointer user_data )
515 {
516     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_cc,
517     "GSM A-I/F DTAP Call Control Statistics",
518     gsm_a_dtap_msg_cc_strings);
519 }
520
521 static void
522 gsm_a_stat_gtk_dtap_cc_init(const char      *optarg _U_,
523                             void* userdata _U_)
524 {
525     gsm_a_stat_gtk_dtap_cc_cb(NULL, NULL);
526 }
527
528 void
529 gsm_a_stat_gtk_dtap_gmm_cb(GtkAction *action, gpointer user_data )
530 {
531     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_gmm,
532     "GSM A-I/F DTAP GPRS Mobility Management Statistics",
533     gsm_a_dtap_msg_gmm_strings);
534 }
535
536 static void
537 gsm_a_stat_gtk_dtap_gmm_init(const char     *optarg _U_,
538                              void* userdata _U_)
539 {
540     gsm_a_stat_gtk_dtap_gmm_cb(NULL, NULL);
541 }
542
543 void
544 gsm_a_stat_gtk_dtap_sms_cb(GtkAction *action, gpointer user_data )
545 {
546     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_sms,
547     "GSM A-I/F DTAP Short Message Service Statistics",
548     gsm_a_dtap_msg_sms_strings);
549 }
550
551 static void
552 gsm_a_stat_gtk_dtap_sms_init(const char     *optarg _U_,
553                              void* userdata _U_)
554 {
555     gsm_a_stat_gtk_dtap_sms_cb(NULL, NULL);
556 }
557
558 void
559 gsm_a_stat_gtk_dtap_sm_cb(GtkAction *action, gpointer user_data )
560 {
561     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_sm,
562     "GSM A-I/F DTAP GPRS Session Management Statistics",
563     gsm_a_dtap_msg_sm_strings);
564 }
565
566 static void
567 gsm_a_stat_gtk_dtap_sm_init(const char      *optarg _U_,
568                             void* userdata _U_)
569 {
570     gsm_a_stat_gtk_dtap_sm_cb(NULL, NULL);
571 }
572
573 void
574 gsm_a_stat_gtk_dtap_ss_cb(GtkAction *action, gpointer user_data )
575 {
576     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_ss,
577     "GSM A-I/F DTAP Supplementary Services Statistics",
578     gsm_a_dtap_msg_ss_strings);
579 }
580
581 static void
582 gsm_a_stat_gtk_dtap_ss_init(
583     const char      *optarg _U_,
584     void        *userdata _U_)
585 {
586     gsm_a_stat_gtk_dtap_ss_cb(NULL, NULL);
587 }
588
589 void
590 gsm_a_stat_gtk_dtap_tp_cb(GtkAction *action, gpointer user_data )
591 {
592     gsm_a_stat_gtk_dtap_cb(action, user_data, &dlg_dtap_tp,
593     "GSM A-I/F DTAP Special Conformance Testing Functions Statistics",
594     gsm_a_dtap_msg_tp_strings);
595 }
596
597 static void
598 gsm_a_stat_gtk_dtap_tp_init(
599     const char      *optarg _U_,
600     void        *userdata _U_)
601 {
602     gsm_a_stat_gtk_dtap_tp_cb(NULL, NULL);
603 }
604
605 void
606 gsm_a_stat_gtk_sacch_rr_cb(GtkAction *action _U_, gpointer user_data _U_ )
607 {
608
609     /*
610      * if the window is already open, bring it to front
611      */
612     if (dlg_sacch_rr.win)
613     {
614     gdk_window_raise(gtk_widget_get_window(dlg_sacch_rr.win));
615     return;
616     }
617
618     gsm_a_stat_gtk_win_create(&dlg_sacch_rr, "GSM A-I/F SACCH Statistics");
619     gsm_a_stat_draw(&gsm_a_stat);
620 }
621
622 static void
623 gsm_a_stat_gtk_sacch_rr_init(
624     const char      *optarg _U_,
625     void* userdata _U_)
626 {
627     gsm_a_stat_gtk_sacch_rr_cb(NULL, NULL);
628 }
629
630 void
631 register_tap_listener_gtkgsm_a_stat(void)
632 {
633     GString     *err_p;
634
635
636     memset((void *) &gsm_a_stat, 0, sizeof(gsm_a_stat_t));
637
638     err_p =
639     register_tap_listener("gsm_a", &gsm_a_stat, NULL, 0,
640         gsm_a_stat_reset,
641         gsm_a_stat_packet,
642         gsm_a_stat_draw);
643
644     if (err_p != NULL)
645     {
646         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
647         g_string_free(err_p, TRUE);
648
649         exit(1);
650     }
651
652     register_stat_cmd_arg("gsm_a,bssmap", gsm_a_stat_gtk_bssmap_init,NULL);
653
654     register_stat_cmd_arg("gsm_a,dtap_mm", gsm_a_stat_gtk_dtap_mm_init,NULL);
655
656     register_stat_cmd_arg("gsm_a,dtap_rr", gsm_a_stat_gtk_dtap_rr_init,NULL);
657
658     register_stat_cmd_arg("gsm_a,dtap_cc", gsm_a_stat_gtk_dtap_cc_init,NULL);
659
660     register_stat_cmd_arg("gsm_a,dtap_gmm", gsm_a_stat_gtk_dtap_gmm_init,NULL);
661
662     register_stat_cmd_arg("gsm_a,dtap_sms", gsm_a_stat_gtk_dtap_sms_init,NULL);
663
664     register_stat_cmd_arg("gsm_a,dtap_sm", gsm_a_stat_gtk_dtap_sm_init,NULL);
665
666     register_stat_cmd_arg("gsm_a,dtap_ss", gsm_a_stat_gtk_dtap_ss_init,NULL);
667
668     register_stat_cmd_arg("gsm_a,dtap_tp", gsm_a_stat_gtk_dtap_tp_init,NULL);
669
670     register_stat_cmd_arg("gsm_a,sacch", gsm_a_stat_gtk_sacch_rr_init,NULL);
671 }