Warningfix:
[obnox/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 #include "../register.h"
51 #include "../globals.h"
52
53 #include "gtk/gui_stat_menu.h"
54 #include "gtk/dlg_utils.h"
55 #include "gtk/filter_dlg.h"
56 #include "gtk/gui_utils.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 #if GTK_CHECK_VERSION(2,6,0)
124         /* Speed up the list display */
125         gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
126 #endif
127
128     /* Setup the sortable columns */
129     gtk_tree_sortable_set_sort_column_id(sortable, IEI_COLUMN, GTK_SORT_ASCENDING);
130     gtk_tree_view_set_headers_clickable(list_view, FALSE);
131
132     /* The view now holds a reference.  We can get rid of our own reference */
133     g_object_unref (G_OBJECT (list_store));
134
135     /* 
136          * Create the first column packet, associating the "text" attribute of the
137      * cell_renderer to the first column of the model 
138          */
139     renderer = gtk_cell_renderer_text_new ();
140     column = gtk_tree_view_column_new_with_attributes ("IEI", renderer, 
141                 "text", IEI_COLUMN, 
142                 NULL);
143
144         /* gtk_tree_view_column_set_cell_data_func(column, renderer, present_as_hex_func, 
145                 GINT_TO_POINTER(IEI_COLUMN), NULL);
146                 */
147  
148         gtk_tree_view_column_set_sort_column_id(column, IEI_COLUMN);
149     gtk_tree_view_column_set_resizable(column, TRUE);
150     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
151     gtk_tree_view_column_set_min_width(column, 50);
152
153         /* Add the column to the view. */
154     gtk_tree_view_append_column (list_view, column);
155
156     /* Second column.. Message Name. */
157     renderer = gtk_cell_renderer_text_new ();
158     column = gtk_tree_view_column_new_with_attributes ("Message Name", renderer, 
159                 "text", MSG_NAME_COLUMN,
160                 NULL);
161     gtk_tree_view_column_set_sort_column_id(column, MSG_NAME_COLUMN);
162     gtk_tree_view_column_set_resizable(column, TRUE);
163     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
164     gtk_tree_view_column_set_min_width(column, 280);
165     gtk_tree_view_append_column (list_view, column);
166
167     /* Third column.. Count. */
168     renderer = gtk_cell_renderer_text_new ();
169         column = gtk_tree_view_column_new_with_attributes ("Count", renderer, 
170                 "text", COUNT_COLUMN, 
171                 NULL);
172         
173
174     gtk_tree_view_column_set_sort_column_id(column, COUNT_COLUMN);
175     gtk_tree_view_column_set_resizable(column, TRUE);
176     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
177     gtk_tree_view_column_set_min_width(column, 50);
178     gtk_tree_view_append_column (list_view, column);
179
180     /* Now enable the sorting of each column */
181     gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), TRUE);
182     gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(list_view), TRUE);
183
184         /* Setup the selection handler */
185         selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
186         gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
187
188         return list;
189
190 }
191 static void
192 gsm_a_stat_reset(
193     void                *tapdata)
194 {
195     gsm_a_stat_t        *stat_p = tapdata;
196
197     memset(stat_p, 0, sizeof(gsm_a_stat_t));
198 }
199
200
201 static int
202 gsm_a_stat_packet(
203     void                *tapdata,
204     packet_info         *pinfo _U_,
205     epan_dissect_t      *edt _U_,
206     const void          *data)
207 {
208     gsm_a_stat_t        *stat_p = tapdata;
209     const gsm_a_tap_rec_t       *data_p = data;
210
211     switch (data_p->pdu_type)
212     {
213     case BSSAP_PDU_TYPE_BSSMAP:
214                 stat_p->bssmap_message_type[data_p->message_type]++;
215                 break;
216
217     case BSSAP_PDU_TYPE_DTAP:
218         switch (data_p->protocol_disc)
219         {
220                 case PD_CC:
221                         stat_p->dtap_cc_message_type[data_p->message_type]++;
222                         break;
223                 case PD_MM:
224                         stat_p->dtap_mm_message_type[data_p->message_type]++;
225                         break;
226                 case PD_RR:
227                         stat_p->dtap_rr_message_type[data_p->message_type]++;
228                         break;
229                 case PD_GMM:
230                         stat_p->dtap_gmm_message_type[data_p->message_type]++;
231                         break;
232                 case PD_SMS:
233                         stat_p->dtap_sms_message_type[data_p->message_type]++;
234                         break;
235                 case PD_SM:
236                         stat_p->dtap_sm_message_type[data_p->message_type]++;
237                         break;
238                 case PD_SS:
239                         stat_p->dtap_ss_message_type[data_p->message_type]++;
240                         break;
241                 case PD_TP:
242                         stat_p->dtap_tp_message_type[data_p->message_type]++;
243                         break;
244                 default:
245                         /*
246                          * unsupported PD
247                          */
248                         return(0);
249         }
250         break;
251
252    case GSM_A_PDU_TYPE_SACCH:
253            switch (data_p->protocol_disc)
254            {
255            case 0:
256                   stat_p->sacch_rr_message_type[data_p->message_type]++;
257                   break;
258            default:
259                   /* unknown Short PD */
260                   break;
261            }
262    break;
263
264     default:
265         /*
266          * unknown PDU type !!!
267          */
268         return(0);
269     }
270
271     return(1);
272 }
273
274
275 static void
276 gsm_a_stat_draw_aux(
277     gsm_a_stat_dlg_t    *dlg_p,
278     int                 *message_count,
279     const value_string  *msg_strings)
280 {
281     GtkListStore *list_store;
282         GtkTreeIter  iter;
283     int                  i;
284
285
286     if (dlg_p->win != NULL){
287                 i = 0;
288                 list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (dlg_p->table))); /* Get store */
289
290                 while (msg_strings[i].strptr){
291                         /* Creates a new row at position. iter will be changed to point to this new row. 
292                          * If position is larger than the number of rows on the list, then the new row will be appended to the list.
293                          * The row will be filled with the values given to this function.
294                          * :
295                          * should generally be preferred when inserting rows in a sorted list store.
296                          */
297 #if GTK_CHECK_VERSION(2,6,0)
298                         gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
299 #else
300                         gtk_list_store_append  (list_store, &iter);
301                         gtk_list_store_set  (list_store, &iter,
302 #endif
303                                         IEI_COLUMN, msg_strings[i].value,
304                                         MSG_NAME_COLUMN, (char *)msg_strings[i].strptr,
305                                         COUNT_COLUMN, message_count[msg_strings[i].value],
306                                         -1);
307                         i++;
308                 }
309     }
310 }
311
312 static void
313 gsm_a_stat_draw(
314     void                *tapdata)
315 {
316     gsm_a_stat_t        *stat_p = tapdata;
317
318         if (!tapdata) return;
319
320     if (dlg_bssmap.win != NULL)
321     {
322                 gsm_a_stat_draw_aux(&dlg_bssmap,
323                         stat_p->bssmap_message_type,
324                         gsm_a_bssmap_msg_strings);
325     }
326
327     if (dlg_dtap_mm.win != NULL)
328     {
329                 gsm_a_stat_draw_aux(&dlg_dtap_mm,
330                         stat_p->dtap_mm_message_type,
331                         gsm_a_dtap_msg_mm_strings);
332     }
333
334     if (dlg_dtap_rr.win != NULL)
335     {
336                 gsm_a_stat_draw_aux(&dlg_dtap_rr,
337                         stat_p->dtap_rr_message_type,
338                         gsm_a_dtap_msg_rr_strings);
339     }
340
341     if (dlg_dtap_cc.win != NULL)
342     {
343                 gsm_a_stat_draw_aux(&dlg_dtap_cc,
344                         stat_p->dtap_cc_message_type,
345                         gsm_a_dtap_msg_cc_strings);
346     }
347
348     if (dlg_dtap_gmm.win != NULL)
349     {
350                 gsm_a_stat_draw_aux(&dlg_dtap_gmm,
351                         stat_p->dtap_gmm_message_type,
352                         gsm_a_dtap_msg_gmm_strings);
353     }
354
355     if (dlg_dtap_sms.win != NULL)
356     {
357                 gsm_a_stat_draw_aux(&dlg_dtap_sms,
358                         stat_p->dtap_sms_message_type,
359                         gsm_a_dtap_msg_sms_strings);
360     }
361
362     if (dlg_dtap_sm.win != NULL)
363     {
364                 gsm_a_stat_draw_aux(&dlg_dtap_sm,
365                         stat_p->dtap_sm_message_type,
366                         gsm_a_dtap_msg_sm_strings);
367     }
368
369     if (dlg_dtap_ss.win != NULL)
370     {
371                 gsm_a_stat_draw_aux(&dlg_dtap_ss,
372                         stat_p->dtap_ss_message_type,
373                         gsm_a_dtap_msg_ss_strings);
374     }
375
376     if (dlg_dtap_tp.win != NULL)
377     {
378                 gsm_a_stat_draw_aux(&dlg_dtap_tp,
379                         stat_p->dtap_tp_message_type,
380                         gsm_a_dtap_msg_tp_strings);
381     }
382
383     if (dlg_sacch_rr.win != NULL)
384     {
385                 gsm_a_stat_draw_aux(&dlg_sacch_rr,
386                         stat_p->sacch_rr_message_type,
387                         gsm_a_sacch_msg_rr_strings);
388     }
389 }
390
391
392
393 static void
394 gsm_a_stat_gtk_win_destroy_cb(
395     GtkWindow           *win _U_,
396     gpointer            user_data _U_)
397 {
398     memset((void *) user_data, 0, sizeof(gsm_a_stat_dlg_t));
399 }
400
401
402 static void
403 gsm_a_stat_gtk_win_create(
404     gsm_a_stat_dlg_t    *dlg_p,
405     const char          *title)
406 {
407     GtkWidget           *vbox;
408     GtkWidget           *bt_close;
409     GtkWidget           *bbox;
410
411
412     dlg_p->win = window_new(GTK_WINDOW_TOPLEVEL, title);
413     gtk_window_set_default_size(GTK_WINDOW(dlg_p->win), 490, 500);
414
415     vbox = gtk_vbox_new(FALSE, 3);
416         gtk_container_add(GTK_CONTAINER(dlg_p->win), vbox);
417     gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
418
419     dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
420     gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
421
422         dlg_p->table = create_list();
423     gtk_container_add(GTK_CONTAINER(dlg_p->scrolled_win), dlg_p->table);
424
425         /* Button row. */
426     bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
427     gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
428
429     bt_close = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
430     window_set_cancel_button(dlg_p->win, bt_close, window_cancel_button_cb);
431
432     g_signal_connect(dlg_p->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
433     g_signal_connect(dlg_p->win, "destroy", G_CALLBACK(gsm_a_stat_gtk_win_destroy_cb), dlg_p);
434
435     gtk_widget_show_all(dlg_p->win);
436     window_present(dlg_p->win);
437 }
438
439
440 static void
441 gsm_a_stat_gtk_bssmap_cb(
442     GtkWidget           *w _U_,
443     gpointer            d _U_)
444 {
445  /*   int                       i;*/
446
447
448     /*
449      * if the window is already open, bring it to front
450      */
451     if (dlg_bssmap.win)
452     {
453         gdk_window_raise(dlg_bssmap.win->window);
454         return;
455     }
456
457     gsm_a_stat_gtk_win_create(&dlg_bssmap, "GSM A-I/F BSSMAP Statistics");
458     gsm_a_stat_draw(&gsm_a_stat);
459 }
460
461
462 static void
463 gsm_a_stat_gtk_bssmap_init(
464     const char          *optarg _U_,
465     void* userdata _U_)
466 {
467     gsm_a_stat_gtk_bssmap_cb(NULL, NULL);
468 }
469
470
471 static void
472 gsm_a_stat_gtk_dtap_cb(
473     GtkWidget           *w _U_,
474     gpointer            d _U_,
475     gsm_a_stat_dlg_t    *dlg_dtap_p,
476     const char          *title,
477     const value_string  *dtap_msg_strings _U_)
478 {
479
480     /*
481      * if the window is already open, bring it to front
482      */
483     if (dlg_dtap_p->win)
484     {
485         gdk_window_raise(dlg_dtap_p->win->window);
486         return;
487     }
488
489     gsm_a_stat_gtk_win_create(dlg_dtap_p, title);
490
491     gsm_a_stat_draw(&gsm_a_stat);
492 }
493
494 static void
495 gsm_a_stat_gtk_dtap_mm_cb(
496     GtkWidget           *w _U_,
497     gpointer            d _U_)
498 {
499     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_mm,
500         "GSM A-I/F DTAP Mobility Management Statistics",
501         gsm_a_dtap_msg_mm_strings);
502 }
503
504 static void
505 gsm_a_stat_gtk_dtap_mm_init(const char          *optarg _U_,
506                             void* userdata _U_)
507 {
508     gsm_a_stat_gtk_dtap_mm_cb(NULL, NULL);
509 }
510
511 static void
512 gsm_a_stat_gtk_dtap_rr_cb(
513     GtkWidget           *w _U_,
514     gpointer            d _U_)
515 {
516     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_rr,
517         "GSM A-I/F DTAP Radio Resource Management Statistics",
518         gsm_a_dtap_msg_rr_strings);
519 }
520
521 static void
522 gsm_a_stat_gtk_dtap_rr_init(const char          *optarg _U_,
523                             void* userdata _U_)
524 {
525     gsm_a_stat_gtk_dtap_rr_cb(NULL, NULL);
526 }
527
528 static void
529 gsm_a_stat_gtk_dtap_cc_cb(
530     GtkWidget           *w _U_,
531     gpointer            d _U_)
532 {
533     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_cc,
534         "GSM A-I/F DTAP Call Control Statistics",
535         gsm_a_dtap_msg_cc_strings);
536 }
537
538 static void
539 gsm_a_stat_gtk_dtap_cc_init(const char          *optarg _U_,
540                             void* userdata _U_)
541 {
542     gsm_a_stat_gtk_dtap_cc_cb(NULL, NULL);
543 }
544
545 static void
546 gsm_a_stat_gtk_dtap_gmm_cb(
547     GtkWidget           *w _U_,
548     gpointer            d _U_)
549 {
550     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_gmm,
551         "GSM A-I/F DTAP GPRS Mobility Management Statistics",
552         gsm_a_dtap_msg_gmm_strings);
553 }
554
555 static void
556 gsm_a_stat_gtk_dtap_gmm_init(const char         *optarg _U_,
557                              void* userdata _U_)
558 {
559     gsm_a_stat_gtk_dtap_gmm_cb(NULL, NULL);
560 }
561
562 static void
563 gsm_a_stat_gtk_dtap_sms_cb(
564     GtkWidget           *w _U_,
565     gpointer            d _U_)
566 {
567     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_sms,
568         "GSM A-I/F DTAP Short Message Service Statistics",
569         gsm_a_dtap_msg_sms_strings);
570 }
571
572 static void
573 gsm_a_stat_gtk_dtap_sms_init(const char         *optarg _U_,
574                              void* userdata _U_)
575 {
576     gsm_a_stat_gtk_dtap_sms_cb(NULL, NULL);
577 }
578
579 static void
580 gsm_a_stat_gtk_dtap_sm_cb(
581     GtkWidget           *w _U_,
582     gpointer            d _U_)
583 {
584     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_sm,
585         "GSM A-I/F DTAP GPRS Session Management Statistics",
586         gsm_a_dtap_msg_sm_strings);
587 }
588
589 static void
590 gsm_a_stat_gtk_dtap_sm_init(const char          *optarg _U_,
591                             void* userdata _U_)
592 {
593     gsm_a_stat_gtk_dtap_sm_cb(NULL, NULL);
594 }
595
596 static void
597 gsm_a_stat_gtk_dtap_ss_cb(
598     GtkWidget           *w _U_,
599     gpointer            d _U_)
600 {
601     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_ss,
602         "GSM A-I/F DTAP Supplementary Services Statistics",
603         gsm_a_dtap_msg_ss_strings);
604 }
605
606 static void
607 gsm_a_stat_gtk_dtap_ss_init(
608     const char          *optarg _U_,
609     void                *userdata _U_)
610 {
611     gsm_a_stat_gtk_dtap_ss_cb(NULL, NULL);
612 }
613
614 static void
615 gsm_a_stat_gtk_dtap_tp_cb(
616     GtkWidget           *w _U_,
617     gpointer            d _U_)
618 {
619     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_tp,
620         "GSM A-I/F DTAP Special Conformance Testing Functions Statistics",
621         gsm_a_dtap_msg_tp_strings);
622 }
623
624 static void
625 gsm_a_stat_gtk_dtap_tp_init(
626     const char          *optarg _U_,
627     void                *userdata _U_)
628 {
629     gsm_a_stat_gtk_dtap_tp_cb(NULL, NULL);
630 }
631
632 static void
633 gsm_a_stat_gtk_sacch_rr_cb(
634     GtkWidget           *w _U_,
635     gpointer            d _U_)
636 {
637  
638     /*
639      * if the window is already open, bring it to front
640      */
641     if (dlg_sacch_rr.win)
642     {
643         gdk_window_raise(dlg_sacch_rr.win->window);
644         return;
645     }
646
647     gsm_a_stat_gtk_win_create(&dlg_sacch_rr, "GSM A-I/F SACCH Statistics");
648     gsm_a_stat_draw(&gsm_a_stat);
649 }
650
651
652 static void
653 gsm_a_stat_gtk_sacch_rr_init(
654     const char          *optarg _U_,
655     void* userdata _U_)
656 {
657     gsm_a_stat_gtk_sacch_rr_cb(NULL, NULL);
658 }
659
660 void
661 register_tap_listener_gtkgsm_a_stat(void)
662 {
663     GString             *err_p;
664
665
666     memset((void *) &gsm_a_stat, 0, sizeof(gsm_a_stat_t));
667
668     err_p =
669         register_tap_listener("gsm_a", &gsm_a_stat, NULL,
670             gsm_a_stat_reset,
671             gsm_a_stat_packet,
672             gsm_a_stat_draw);
673
674     if (err_p != NULL)
675     {
676         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
677         g_string_free(err_p, TRUE);
678
679         exit(1);
680     }
681
682     register_stat_menu_item("GSM/A-Interface BSSMAP", REGISTER_STAT_GROUP_TELEPHONY,
683         gsm_a_stat_gtk_bssmap_cb, NULL, NULL, NULL);
684     register_stat_cmd_arg("gsm_a,bssmap", gsm_a_stat_gtk_bssmap_init,NULL);
685
686     register_stat_menu_item("GSM/A-Interface DTAP/Mobility Management", REGISTER_STAT_GROUP_TELEPHONY,
687         gsm_a_stat_gtk_dtap_mm_cb, NULL, NULL, NULL);
688     register_stat_cmd_arg("gsm_a,dtap_mm", gsm_a_stat_gtk_dtap_mm_init,NULL);
689
690     register_stat_menu_item("GSM/A-Interface DTAP/Radio Resource Management", REGISTER_STAT_GROUP_TELEPHONY,
691         gsm_a_stat_gtk_dtap_rr_cb, NULL, NULL, NULL);
692     register_stat_cmd_arg("gsm_a,dtap_rr", gsm_a_stat_gtk_dtap_rr_init,NULL);
693
694     register_stat_menu_item("GSM/A-Interface DTAP/Call Control", REGISTER_STAT_GROUP_TELEPHONY,
695         gsm_a_stat_gtk_dtap_cc_cb, NULL, NULL, NULL);
696     register_stat_cmd_arg("gsm_a,dtap_cc", gsm_a_stat_gtk_dtap_cc_init,NULL);
697
698     register_stat_menu_item("GSM/A-Interface DTAP/GPRS Mobility Management", REGISTER_STAT_GROUP_TELEPHONY,
699         gsm_a_stat_gtk_dtap_gmm_cb, NULL, NULL, NULL);
700     register_stat_cmd_arg("gsm_a,dtap_gmm", gsm_a_stat_gtk_dtap_gmm_init,NULL);
701
702     register_stat_menu_item("GSM/A-Interface DTAP/Short Message Service", REGISTER_STAT_GROUP_TELEPHONY,
703         gsm_a_stat_gtk_dtap_sms_cb, NULL, NULL, NULL);
704     register_stat_cmd_arg("gsm_a,dtap_sms", gsm_a_stat_gtk_dtap_sms_init,NULL);
705
706     register_stat_menu_item("GSM/A-Interface DTAP/GPRS Session Management", REGISTER_STAT_GROUP_TELEPHONY,
707         gsm_a_stat_gtk_dtap_sm_cb, NULL, NULL, NULL);
708     register_stat_cmd_arg("gsm_a,dtap_sm", gsm_a_stat_gtk_dtap_sm_init,NULL);
709
710     register_stat_menu_item("GSM/A-Interface DTAP/Supplementary Services", REGISTER_STAT_GROUP_TELEPHONY,
711         gsm_a_stat_gtk_dtap_ss_cb, NULL, NULL, NULL);
712     register_stat_cmd_arg("gsm_a,dtap_ss", gsm_a_stat_gtk_dtap_ss_init,NULL);
713
714     register_stat_menu_item("GSM/A-Interface DTAP/Special Conformance Testing Functions", REGISTER_STAT_GROUP_TELEPHONY,
715         gsm_a_stat_gtk_dtap_tp_cb, NULL, NULL, NULL);
716     register_stat_cmd_arg("gsm_a,dtap_tp", gsm_a_stat_gtk_dtap_tp_init,NULL);
717
718     register_stat_menu_item("GSM/A-Interface SACCH", REGISTER_STAT_GROUP_TELEPHONY,
719         gsm_a_stat_gtk_sacch_rr_cb, NULL, NULL, NULL);
720     register_stat_cmd_arg("gsm_a,sacch", gsm_a_stat_gtk_sacch_rr_init,NULL);
721 }