Handle -I in the options processing.
[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 = dlg_window_new(title);  /* transient_for top_level */
413         gtk_window_set_destroy_with_parent (GTK_WINDOW(dlg_p->win), TRUE);
414     gtk_window_set_default_size(GTK_WINDOW(dlg_p->win), 490, 500);
415
416     vbox = gtk_vbox_new(FALSE, 3);
417         gtk_container_add(GTK_CONTAINER(dlg_p->win), vbox);
418     gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
419
420     dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
421     gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
422
423         dlg_p->table = create_list();
424     gtk_container_add(GTK_CONTAINER(dlg_p->scrolled_win), dlg_p->table);
425
426         /* Button row. */
427     bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
428     gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
429
430     bt_close = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
431     window_set_cancel_button(dlg_p->win, bt_close, window_cancel_button_cb);
432
433     g_signal_connect(dlg_p->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
434     g_signal_connect(dlg_p->win, "destroy", G_CALLBACK(gsm_a_stat_gtk_win_destroy_cb), dlg_p);
435
436     gtk_widget_show_all(dlg_p->win);
437     window_present(dlg_p->win);
438 }
439
440
441 static void
442 gsm_a_stat_gtk_bssmap_cb(
443     GtkWidget           *w _U_,
444     gpointer            d _U_)
445 {
446  /*   int                       i;*/
447
448
449     /*
450      * if the window is already open, bring it to front
451      */
452     if (dlg_bssmap.win)
453     {
454         gdk_window_raise(dlg_bssmap.win->window);
455         return;
456     }
457
458     gsm_a_stat_gtk_win_create(&dlg_bssmap, "GSM A-I/F BSSMAP Statistics");
459     gsm_a_stat_draw(&gsm_a_stat);
460 }
461
462
463 static void
464 gsm_a_stat_gtk_bssmap_init(
465     const char          *optarg _U_,
466     void* userdata _U_)
467 {
468     gsm_a_stat_gtk_bssmap_cb(NULL, NULL);
469 }
470
471
472 static void
473 gsm_a_stat_gtk_dtap_cb(
474     GtkWidget           *w _U_,
475     gpointer            d _U_,
476     gsm_a_stat_dlg_t    *dlg_dtap_p,
477     const char          *title,
478     const value_string  *dtap_msg_strings _U_)
479 {
480
481     /*
482      * if the window is already open, bring it to front
483      */
484     if (dlg_dtap_p->win)
485     {
486         gdk_window_raise(dlg_dtap_p->win->window);
487         return;
488     }
489
490     gsm_a_stat_gtk_win_create(dlg_dtap_p, title);
491
492     gsm_a_stat_draw(&gsm_a_stat);
493 }
494
495 static void
496 gsm_a_stat_gtk_dtap_mm_cb(
497     GtkWidget           *w _U_,
498     gpointer            d _U_)
499 {
500     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_mm,
501         "GSM A-I/F DTAP Mobility Management Statistics",
502         gsm_a_dtap_msg_mm_strings);
503 }
504
505 static void
506 gsm_a_stat_gtk_dtap_mm_init(const char          *optarg _U_,
507                             void* userdata _U_)
508 {
509     gsm_a_stat_gtk_dtap_mm_cb(NULL, NULL);
510 }
511
512 static void
513 gsm_a_stat_gtk_dtap_rr_cb(
514     GtkWidget           *w _U_,
515     gpointer            d _U_)
516 {
517     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_rr,
518         "GSM A-I/F DTAP Radio Resource Management Statistics",
519         gsm_a_dtap_msg_rr_strings);
520 }
521
522 static void
523 gsm_a_stat_gtk_dtap_rr_init(const char          *optarg _U_,
524                             void* userdata _U_)
525 {
526     gsm_a_stat_gtk_dtap_rr_cb(NULL, NULL);
527 }
528
529 static void
530 gsm_a_stat_gtk_dtap_cc_cb(
531     GtkWidget           *w _U_,
532     gpointer            d _U_)
533 {
534     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_cc,
535         "GSM A-I/F DTAP Call Control Statistics",
536         gsm_a_dtap_msg_cc_strings);
537 }
538
539 static void
540 gsm_a_stat_gtk_dtap_cc_init(const char          *optarg _U_,
541                             void* userdata _U_)
542 {
543     gsm_a_stat_gtk_dtap_cc_cb(NULL, NULL);
544 }
545
546 static void
547 gsm_a_stat_gtk_dtap_gmm_cb(
548     GtkWidget           *w _U_,
549     gpointer            d _U_)
550 {
551     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_gmm,
552         "GSM A-I/F DTAP GPRS Mobility Management Statistics",
553         gsm_a_dtap_msg_gmm_strings);
554 }
555
556 static void
557 gsm_a_stat_gtk_dtap_gmm_init(const char         *optarg _U_,
558                              void* userdata _U_)
559 {
560     gsm_a_stat_gtk_dtap_gmm_cb(NULL, NULL);
561 }
562
563 static void
564 gsm_a_stat_gtk_dtap_sms_cb(
565     GtkWidget           *w _U_,
566     gpointer            d _U_)
567 {
568     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_sms,
569         "GSM A-I/F DTAP Short Message Service Statistics",
570         gsm_a_dtap_msg_sms_strings);
571 }
572
573 static void
574 gsm_a_stat_gtk_dtap_sms_init(const char         *optarg _U_,
575                              void* userdata _U_)
576 {
577     gsm_a_stat_gtk_dtap_sms_cb(NULL, NULL);
578 }
579
580 static void
581 gsm_a_stat_gtk_dtap_sm_cb(
582     GtkWidget           *w _U_,
583     gpointer            d _U_)
584 {
585     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_sm,
586         "GSM A-I/F DTAP GPRS Session Management Statistics",
587         gsm_a_dtap_msg_sm_strings);
588 }
589
590 static void
591 gsm_a_stat_gtk_dtap_sm_init(const char          *optarg _U_,
592                             void* userdata _U_)
593 {
594     gsm_a_stat_gtk_dtap_sm_cb(NULL, NULL);
595 }
596
597 static void
598 gsm_a_stat_gtk_dtap_ss_cb(
599     GtkWidget           *w _U_,
600     gpointer            d _U_)
601 {
602     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_ss,
603         "GSM A-I/F DTAP Supplementary Services Statistics",
604         gsm_a_dtap_msg_ss_strings);
605 }
606
607 static void
608 gsm_a_stat_gtk_dtap_ss_init(
609     const char          *optarg _U_,
610     void                *userdata _U_)
611 {
612     gsm_a_stat_gtk_dtap_ss_cb(NULL, NULL);
613 }
614
615 static void
616 gsm_a_stat_gtk_dtap_tp_cb(
617     GtkWidget           *w _U_,
618     gpointer            d _U_)
619 {
620     gsm_a_stat_gtk_dtap_cb(w, d, &dlg_dtap_tp,
621         "GSM A-I/F DTAP Special Conformance Testing Functions Statistics",
622         gsm_a_dtap_msg_tp_strings);
623 }
624
625 static void
626 gsm_a_stat_gtk_dtap_tp_init(
627     const char          *optarg _U_,
628     void                *userdata _U_)
629 {
630     gsm_a_stat_gtk_dtap_tp_cb(NULL, NULL);
631 }
632
633 static void
634 gsm_a_stat_gtk_sacch_rr_cb(
635     GtkWidget           *w _U_,
636     gpointer            d _U_)
637 {
638  
639     /*
640      * if the window is already open, bring it to front
641      */
642     if (dlg_sacch_rr.win)
643     {
644         gdk_window_raise(dlg_sacch_rr.win->window);
645         return;
646     }
647
648     gsm_a_stat_gtk_win_create(&dlg_sacch_rr, "GSM A-I/F SACCH Statistics");
649     gsm_a_stat_draw(&gsm_a_stat);
650 }
651
652
653 static void
654 gsm_a_stat_gtk_sacch_rr_init(
655     const char          *optarg _U_,
656     void* userdata _U_)
657 {
658     gsm_a_stat_gtk_sacch_rr_cb(NULL, NULL);
659 }
660
661 void
662 register_tap_listener_gtkgsm_a_stat(void)
663 {
664     GString             *err_p;
665
666
667     memset((void *) &gsm_a_stat, 0, sizeof(gsm_a_stat_t));
668
669     err_p =
670         register_tap_listener("gsm_a", &gsm_a_stat, NULL, 0,
671             gsm_a_stat_reset,
672             gsm_a_stat_packet,
673             gsm_a_stat_draw);
674
675     if (err_p != NULL)
676     {
677         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
678         g_string_free(err_p, TRUE);
679
680         exit(1);
681     }
682
683     register_stat_menu_item("_GSM/A-Interface BSSMAP", REGISTER_STAT_GROUP_TELEPHONY,
684         gsm_a_stat_gtk_bssmap_cb, NULL, NULL, NULL);
685     register_stat_cmd_arg("gsm_a,bssmap", gsm_a_stat_gtk_bssmap_init,NULL);
686
687     register_stat_menu_item("_GSM/A-Interface DTAP/Mobility Management", REGISTER_STAT_GROUP_TELEPHONY,
688         gsm_a_stat_gtk_dtap_mm_cb, NULL, NULL, NULL);
689     register_stat_cmd_arg("gsm_a,dtap_mm", gsm_a_stat_gtk_dtap_mm_init,NULL);
690
691     register_stat_menu_item("_GSM/A-Interface DTAP/Radio Resource Management", REGISTER_STAT_GROUP_TELEPHONY,
692         gsm_a_stat_gtk_dtap_rr_cb, NULL, NULL, NULL);
693     register_stat_cmd_arg("gsm_a,dtap_rr", gsm_a_stat_gtk_dtap_rr_init,NULL);
694
695     register_stat_menu_item("_GSM/A-Interface DTAP/Call Control", REGISTER_STAT_GROUP_TELEPHONY,
696         gsm_a_stat_gtk_dtap_cc_cb, NULL, NULL, NULL);
697     register_stat_cmd_arg("gsm_a,dtap_cc", gsm_a_stat_gtk_dtap_cc_init,NULL);
698
699     register_stat_menu_item("_GSM/A-Interface DTAP/GPRS Mobility Management", REGISTER_STAT_GROUP_TELEPHONY,
700         gsm_a_stat_gtk_dtap_gmm_cb, NULL, NULL, NULL);
701     register_stat_cmd_arg("gsm_a,dtap_gmm", gsm_a_stat_gtk_dtap_gmm_init,NULL);
702
703     register_stat_menu_item("_GSM/A-Interface DTAP/Short Message Service", REGISTER_STAT_GROUP_TELEPHONY,
704         gsm_a_stat_gtk_dtap_sms_cb, NULL, NULL, NULL);
705     register_stat_cmd_arg("gsm_a,dtap_sms", gsm_a_stat_gtk_dtap_sms_init,NULL);
706
707     register_stat_menu_item("_GSM/A-Interface DTAP/GPRS Session Management", REGISTER_STAT_GROUP_TELEPHONY,
708         gsm_a_stat_gtk_dtap_sm_cb, NULL, NULL, NULL);
709     register_stat_cmd_arg("gsm_a,dtap_sm", gsm_a_stat_gtk_dtap_sm_init,NULL);
710
711     register_stat_menu_item("_GSM/A-Interface DTAP/Supplementary Services", REGISTER_STAT_GROUP_TELEPHONY,
712         gsm_a_stat_gtk_dtap_ss_cb, NULL, NULL, NULL);
713     register_stat_cmd_arg("gsm_a,dtap_ss", gsm_a_stat_gtk_dtap_ss_init,NULL);
714
715     register_stat_menu_item("_GSM/A-Interface DTAP/Special Conformance Testing Functions", REGISTER_STAT_GROUP_TELEPHONY,
716         gsm_a_stat_gtk_dtap_tp_cb, NULL, NULL, NULL);
717     register_stat_cmd_arg("gsm_a,dtap_tp", gsm_a_stat_gtk_dtap_tp_init,NULL);
718
719     register_stat_menu_item("_GSM/A-Interface SACCH", REGISTER_STAT_GROUP_TELEPHONY,
720         gsm_a_stat_gtk_sacch_rr_cb, NULL, NULL, NULL);
721     register_stat_cmd_arg("gsm_a,sacch", gsm_a_stat_gtk_sacch_rr_init,NULL);
722 }