Dissect Bearer cap in Signal info.
[metze/wireshark/wip.git] / epan / dissectors / packet-gsm_a_common.h
1 /* packet-gsm_a_common.h
2  *
3  * $Id$
4  *
5  *   Reference [3]
6  *   Mobile radio interface Layer 3 specification;
7  *   Core network protocols;
8  *   Stage 3
9  *   (3GPP TS 24.008 version 4.7.0 Release 4)
10  *   (ETSI TS 124 008 V6.8.0 (2005-03))
11  *
12  *   Reference [5]
13  *   Point-to-Point (PP) Short Message Service (SMS)
14  *   support on mobile radio interface
15  *   (3GPP TS 24.011 version 4.1.1 Release 4)
16  *
17  *   Reference [7]
18  *   Mobile radio interface Layer 3 specification;
19  *   Core network protocols;
20  *   Stage 3
21  *   (3GPP TS 24.008 version 5.9.0 Release 5)
22  *
23  *   Reference [8]
24  *   Mobile radio interface Layer 3 specification;
25  *   Core network protocols;
26  *   Stage 3
27  *   (3GPP TS 24.008 version 6.7.0 Release 6)
28  *       (3GPP TS 24.008 version 6.8.0 Release 6)
29  *
30  * Copyright 2003, Michael Lum <mlum [AT] telostech.com>,
31  * In association with Telos Technology Inc.
32  *
33  * Wireshark - Network traffic analyzer
34  * By Gerald Combs <gerald@wireshark.org>
35  * Copyright 1998 Gerald Combs
36  *
37  * This program is free software; you can redistribute it and/or
38  * modify it under the terms of the GNU General Public License
39  * as published by the Free Software Foundation; either version 2
40  * of the License, or (at your option) any later version.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License
48  * along with this program; if not, write to the Free Software
49  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
50  */
51 #ifndef __PACKET_GSM_A_COMMON_H__
52 #define __PACKET_GSM_A_COMMON_H__
53
54 #include "packet-sccp.h"
55
56 /* PROTOTYPES/FORWARDS */
57 typedef guint8 (*elem_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
58 typedef void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
59
60 typedef struct dgt_set_t
61 {
62         unsigned char out[15];
63 }
64 dgt_set_t;
65
66 int my_dgt_tbcd_unpack( 
67         char    *out,           /* ASCII pattern out */
68         guchar  *in,            /* packed pattern in */
69         int             num_octs,       /* Number of octets to unpack */
70         dgt_set_t       *dgt            /* Digit definitions */
71         );
72
73 /* globals needed as a result of spltting the packet-gsm_a.c into several files
74  * until further restructuring can take place to make them more modular
75  */
76
77 /* common PD values */
78 extern const value_string protocol_discriminator_vals[];
79 extern const value_string gsm_a_pd_short_str_vals[];
80
81 extern guint8 de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
82
83 /* Needed to share the packet-gsm_a_common.c functions */
84 extern const value_string gsm_bssmap_elem_strings[];
85 extern gint ett_gsm_bssmap_elem[];
86 extern elem_fcn bssmap_elem_fcn[];
87 extern int hf_gsm_a_bssmap_elem_id;
88
89 extern const value_string gsm_dtap_elem_strings[];
90 extern gint ett_gsm_dtap_elem[];
91 extern elem_fcn dtap_elem_fcn[];
92 extern int hf_gsm_a_dtap_elem_id;
93
94 extern const value_string gsm_rp_elem_strings[];
95 extern gint ett_gsm_rp_elem[];
96 extern elem_fcn rp_elem_fcn[];
97 extern int hf_gsm_a_rp_elem_id;
98
99 extern const value_string gsm_rr_elem_strings[];
100 extern gint ett_gsm_rr_elem[];
101 extern elem_fcn rr_elem_fcn[];
102 extern int hf_gsm_a_rr_elem_id;
103 extern void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn);
104
105 extern const value_string gsm_common_elem_strings[];
106 extern gint ett_gsm_common_elem[];
107 extern elem_fcn common_elem_fcn[];
108 extern int hf_gsm_a_common_elem_id;
109
110 extern const value_string gsm_gm_elem_strings[];
111 extern gint ett_gsm_gm_elem[];
112 extern elem_fcn gm_elem_fcn[];
113 extern int hf_gsm_a_gm_elem_id;
114 extern void get_gmm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn);
115 extern void get_sm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn);
116
117 extern sccp_msg_info_t* sccp_msg;
118 extern sccp_assoc_info_t* sccp_assoc;
119
120 extern int gsm_a_tap;
121 extern gboolean lower_nibble;
122 extern packet_info *gsm_a_dtap_pinfo;
123
124 /* common field values */
125 extern int hf_gsm_a_length;
126 extern int hf_gsm_a_extension;
127 extern int hf_gsm_a_tmsi;
128 extern int hf_gsm_a_L3_protocol_discriminator;
129 extern int hf_gsm_a_b8spare;
130 extern int hf_gsm_a_skip_ind;
131 extern int hf_gsm_a_rr_chnl_needed_ch1;
132
133 /* for the nasty hack below */
134 #define GSM_BSSMAP_APDU_IE      0x49
135
136 /* flags for the packet-gsm_a_common routines */
137 #define GSM_A_PDU_TYPE_BSSMAP   BSSAP_PDU_TYPE_BSSMAP /* i.e. 0 - until split complete at least! */
138 #define GSM_A_PDU_TYPE_DTAP             BSSAP_PDU_TYPE_DTAP   /* i.e. 1 - until split complete at least! */
139 #define GSM_A_PDU_TYPE_RP               2
140 #define GSM_A_PDU_TYPE_RR               3
141 #define GSM_A_PDU_TYPE_COMMON   4
142 #define GSM_A_PDU_TYPE_GM               5
143
144 extern const char* get_gsm_a_msg_string(int pdu_type, int idx);
145
146 /*
147  * this should be set on a per message basis, if possible
148  */
149 #define IS_UPLINK_FALSE         0
150 #define IS_UPLINK_TRUE          1
151 #define IS_UPLINK_UNKNOWN       2
152
153 /* Defines and nasty static for handling half octet mandatory V IEs 
154  * TODO: Note origimally UPPER_NIBBLE was -2 and LOWER_NIBBLE was -1
155  * changed here to unsigned integer as it wouldn't compile (Warnings on Ubuntu)
156  * uggly hack...
157  */
158 #define UPPER_NIBBLE    (2)
159 #define LOWER_NIBBLE    (1)
160
161 /* FUNCTIONS */
162
163 /* ELEMENT FUNCTIONS */
164
165 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
166         if (((edc_len) > (edc_max_len))||lower_nibble) \
167         { \
168                 proto_tree_add_text(tree, tvb, \
169                         curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
170                 curr_offset += ((edc_len) - (edc_max_len)); \
171         }
172
173 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
174         if ((sdc_len) < (sdc_min_len)) \
175         { \
176                 proto_tree_add_text(tree, tvb, \
177                         curr_offset, (sdc_len), "Short Data (?)"); \
178                 curr_offset += (sdc_len); \
179                 return(curr_offset - offset); \
180         }
181
182 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
183         if ((edc_len) != (edc_eq_len)) \
184         { \
185                 proto_tree_add_text(tree, tvb, \
186                         curr_offset, (edc_len), "Unexpected Data Length"); \
187                 curr_offset += (edc_len); \
188                 return(curr_offset - offset); \
189         }
190
191 #define NO_MORE_DATA_CHECK(nmdc_len) \
192         if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
193
194 #define SET_ELEM_VARS(SEV_pdu_type, SEV_elem_names, SEV_elem_ett, SEV_elem_funcs) \
195         switch (SEV_pdu_type) \
196         { \
197         case GSM_A_PDU_TYPE_BSSMAP: \
198                 SEV_elem_names = gsm_bssmap_elem_strings; \
199                 SEV_elem_ett = ett_gsm_bssmap_elem; \
200                 SEV_elem_funcs = bssmap_elem_fcn; \
201                 break; \
202         case GSM_A_PDU_TYPE_DTAP: \
203                 SEV_elem_names = gsm_dtap_elem_strings; \
204                 SEV_elem_ett = ett_gsm_dtap_elem; \
205                 SEV_elem_funcs = dtap_elem_fcn; \
206                 break; \
207         case GSM_A_PDU_TYPE_RP: \
208                 SEV_elem_names = gsm_rp_elem_strings; \
209                 SEV_elem_ett = ett_gsm_rp_elem; \
210                 SEV_elem_funcs = rp_elem_fcn; \
211                 break; \
212         case GSM_A_PDU_TYPE_RR: \
213                 SEV_elem_names = gsm_rr_elem_strings; \
214                 SEV_elem_ett = ett_gsm_rr_elem; \
215                 SEV_elem_funcs = rr_elem_fcn; \
216                 break; \
217         case GSM_A_PDU_TYPE_COMMON: \
218                 SEV_elem_names = gsm_common_elem_strings; \
219                 SEV_elem_ett = ett_gsm_common_elem; \
220                 SEV_elem_funcs = common_elem_fcn; \
221                 break; \
222         case GSM_A_PDU_TYPE_GM: \
223                 SEV_elem_names = gsm_gm_elem_strings; \
224                 SEV_elem_ett = ett_gsm_gm_elem; \
225                 SEV_elem_funcs = gm_elem_fcn; \
226                 break; \
227         default: \
228                 proto_tree_add_text(tree, \
229                         tvb, curr_offset, -1, \
230                         "Unknown PDU type (%u)", SEV_pdu_type); \
231                 return(consumed); \
232         }
233
234 /*
235  * Type Length Value (TLV) element dissector
236  */
237 extern guint8 elem_tlv(tvbuff_t *tvb, proto_tree *tree, guint8 iei, gint pdu_type, int idx, guint32 offset, guint len, const gchar *name_add);
238
239 /*
240  * Type Value (TV) element dissector
241  *
242  * Length cannot be used in these functions, big problem if a element dissector
243  * is not defined for these.
244  */
245 extern guint8 elem_tv(tvbuff_t *tvb, proto_tree *tree, guint8 iei, gint pdu_type, int idx, guint32 offset, const gchar *name_add);
246
247 /*
248  * Type Value (TV) element dissector
249  * Where top half nibble is IEI and bottom half nibble is value.
250  *
251  * Length cannot be used in these functions, big problem if a element dissector
252  * is not defined for these.
253  */
254 extern guint8 elem_tv_short(tvbuff_t *tvb, proto_tree *tree, guint8 iei, gint pdu_type, int idx, guint32 offset, const gchar *name_add);
255
256 /*
257  * Type (T) element dissector
258  */
259 extern guint8 elem_t(tvbuff_t *tvb, proto_tree *tree, guint8 iei, gint pdu_type, int idx, guint32 offset, const gchar *name_add);
260
261 /*
262  * Length Value (LV) element dissector
263  */
264 extern guint8 elem_lv(tvbuff_t *tvb, proto_tree *tree, gint pdu_type, int idx, guint32 offset, guint len, const gchar *name_add);
265
266 /*
267  * Value (V) element dissector
268  *
269  * Length cannot be used in these functions, big problem if a element dissector
270  * is not defined for these.
271  */
272 extern guint8 elem_v(tvbuff_t *tvb, proto_tree *tree, gint pdu_type, int idx, guint32 offset);
273
274 /*
275  * Short Value (V_SHORT) element dissector
276  *
277  * Length is (ab)used in these functions to indicate upper nibble of the octet (-2) or lower nibble (-1)
278  * noting that the tv_short dissector always sets the length to -1, as the upper nibble is the IEI.
279  * This is expected to be used upper nibble first, as the tables of 24.008.
280  */
281
282 extern guint8 elem_v_short(tvbuff_t *tvb, proto_tree *tree, gint pdu_type, int idx, guint32 offset);
283
284
285 #define ELEM_MAND_TLV(EMT_iei, EMT_pdu_type, EMT_elem_idx, EMT_elem_name_addition) \
286 {\
287         if ((consumed = elem_tlv(tvb, tree, (guint8) EMT_iei, EMT_pdu_type, EMT_elem_idx, curr_offset, curr_len, EMT_elem_name_addition)) > 0) \
288         { \
289                 curr_offset += consumed; \
290                 curr_len -= consumed; \
291         } \
292         else \
293         { \
294                 proto_tree_add_text(tree, \
295                         tvb, curr_offset, 0, \
296                         "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
297                         EMT_iei, \
298                         get_gsm_a_msg_string(EMT_pdu_type, EMT_elem_idx), \
299                         (EMT_elem_name_addition == NULL) || (EMT_elem_name_addition[0] == '\0') ? "" : EMT_elem_name_addition \
300                         ); \
301         } \
302         if (curr_len <= 0) return; \
303 }
304
305 #define ELEM_OPT_TLV(EOT_iei, EOT_pdu_type, EOT_elem_idx, EOT_elem_name_addition) \
306 {\
307         if ((consumed = elem_tlv(tvb, tree, (guint8) EOT_iei, EOT_pdu_type, EOT_elem_idx, curr_offset, curr_len, EOT_elem_name_addition)) > 0) \
308         { \
309                 curr_offset += consumed; \
310                 curr_len -= consumed; \
311         } \
312         if (curr_len <= 0) return; \
313 }
314
315 #define ELEM_MAND_TV(EMT_iei, EMT_pdu_type, EMT_elem_idx, EMT_elem_name_addition) \
316 {\
317         if ((consumed = elem_tv(tvb, tree, (guint8) EMT_iei, EMT_pdu_type, EMT_elem_idx, curr_offset, EMT_elem_name_addition)) > 0) \
318         { \
319                 curr_offset += consumed; \
320                 curr_len -= consumed; \
321         } \
322         else \
323         { \
324                 proto_tree_add_text(tree, \
325                         tvb, curr_offset, 0, \
326                         "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
327                         EMT_iei, \
328                         get_gsm_a_msg_string(EMT_pdu_type, EMT_elem_idx), \
329                         (EMT_elem_name_addition == NULL) || (EMT_elem_name_addition[0] == '\0') ? "" : EMT_elem_name_addition \
330                 ); \
331         } \
332         if (curr_len <= 0) return; \
333 }
334
335 #define ELEM_OPT_TV(EOT_iei, EOT_pdu_type, EOT_elem_idx, EOT_elem_name_addition) \
336 {\
337         if ((consumed = elem_tv(tvb, tree, (guint8) EOT_iei, EOT_pdu_type, EOT_elem_idx, curr_offset, EOT_elem_name_addition)) > 0) \
338         { \
339                 curr_offset += consumed; \
340                 curr_len -= consumed; \
341         } \
342         if (curr_len <= 0) return; \
343 }
344
345 #define ELEM_OPT_TV_SHORT(EOT_iei, EOT_pdu_type, EOT_elem_idx, EOT_elem_name_addition) \
346 {\
347         if ((consumed = elem_tv_short(tvb, tree, EOT_iei, EOT_pdu_type, EOT_elem_idx, curr_offset, EOT_elem_name_addition)) > 0) \
348         { \
349                 curr_offset += consumed; \
350                 curr_len -= consumed; \
351         } \
352         if (curr_len <= 0) return; \
353 }
354
355 #define ELEM_OPT_T(EOT_iei, EOT_pdu_type, EOT_elem_idx, EOT_elem_name_addition) \
356 {\
357         if ((consumed = elem_t(tvb, tree, (guint8) EOT_iei, EOT_pdu_type, EOT_elem_idx, curr_offset, EOT_elem_name_addition)) > 0) \
358         { \
359                 curr_offset += consumed; \
360                 curr_len -= consumed; \
361         } \
362         if (curr_len <= 0) return; \
363 }
364
365 #define ELEM_MAND_LV(EML_pdu_type, EML_elem_idx, EML_elem_name_addition) \
366 {\
367         if ((consumed = elem_lv(tvb, tree, EML_pdu_type, EML_elem_idx, curr_offset, curr_len, EML_elem_name_addition)) > 0) \
368         { \
369                 curr_offset += consumed; \
370                 curr_len -= consumed; \
371         } \
372         else \
373         { \
374                 /* Mandatory, but nothing we can do */ \
375         } \
376         if (curr_len <= 0) return; \
377 }
378
379 #define ELEM_MAND_V(EMV_pdu_type, EMV_elem_idx) \
380 {\
381         if ((consumed = elem_v(tvb, tree, EMV_pdu_type, EMV_elem_idx, curr_offset)) > 0) \
382         { \
383                 curr_offset += consumed; \
384                 curr_len -= consumed; \
385         } \
386         else \
387         { \
388                 /* Mandatory, but nothing we can do */ \
389         } \
390         if (curr_len <= 0) return; \
391 }
392
393 #define ELEM_MAND_V_SHORT(EMV_pdu_type, EMV_elem_idx) \
394 {\
395         if ((consumed = elem_v_short(tvb, tree, EMV_pdu_type, EMV_elem_idx, curr_offset)) > 0) \
396         { \
397                 curr_offset += consumed; \
398                 curr_len -= consumed; \
399         } \
400         else \
401         { \
402                 /* Mandatory, but nothing we can do */ \
403         } \
404         if (curr_len <= 0) return; \
405 }
406
407 /*
408  * this enum must be kept in-sync with 'gsm_a_pd_str'
409  * it is used as an index into the array
410  */
411 typedef enum
412 {
413         PD_GCC = 0,
414         PD_BCC,
415         PD_RSVD_1,
416         PD_CC,
417         PD_GTTP,
418         PD_MM,
419         PD_RR,
420         PD_UNK_1,
421         PD_GMM,
422         PD_SMS,
423         PD_SM,
424         PD_SS,
425         PD_LCS,
426         PD_UNK_2,
427         PD_RSVD_EXT,
428         PD_RSVD_TEST
429 }
430 gsm_a_pd_str_e;
431
432 typedef struct _gsm_a_tap_rec_t {
433         /*
434          * value from packet-bssap.h
435          */
436         guint8          pdu_type;
437         guint8          message_type;
438         gsm_a_pd_str_e  protocol_disc;
439 } gsm_a_tap_rec_t;
440
441 void dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
442
443 void dtap_mm_mm_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
444
445 guint8 be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc);
446 guint8 be_cell_id_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
447 guint8 be_chan_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
448
449 guint8 de_lai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
450 guint8 de_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
451 guint8 de_cell_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
452 guint8 de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
453 guint8 de_bearer_cap_uplink(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
454
455 guint8 de_ms_cm_1(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
456 guint8 de_ms_cm_2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
457
458 guint8 de_sm_apn(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
459 guint8 de_sm_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
460 guint8 de_sm_pflow_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
461
462 guint8 de_gmm_drx_param(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
463 guint8 de_gmm_ms_net_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
464 guint8 de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
465 guint8 de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
466
467 guint8 de_rr_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
468 guint8 de_rr_cell_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
469 guint8 de_rr_ch_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
470 guint8 de_rr_ch_mode(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
471 guint8 de_rr_chnl_needed(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
472 guint8 de_rr_cip_mode_set(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
473 guint8 de_rr_cm_enq_mask(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
474 guint8 de_rr_meas_res(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
475 guint8 de_rr_multirate_conf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
476 guint8 de_rr_sus_cau(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
477 guint8 de_rr_tlli(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len);
478
479 guint8 de_rej_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
480 guint8 de_d_gb_call_ref(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
481
482 void dtap_rr_ho_cmd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len);
483
484 /*
485  * the following allows TAP code access to the messages
486  * without having to duplicate it. With MSVC and a 
487  * libwireshark.dll, we need a special declaration.
488  */
489 WS_VAR_IMPORT const value_string gsm_a_bssmap_msg_strings[];
490 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_mm_strings[];
491 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_rr_strings[];
492 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_cc_strings[];
493 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_gmm_strings[];
494 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_sms_strings[];
495 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_sm_strings[];
496 WS_VAR_IMPORT const value_string gsm_a_dtap_msg_ss_strings[];
497 WS_VAR_IMPORT const gchar *gsm_a_pd_str[];
498
499 extern const value_string gsm_a_qos_del_of_err_sdu_vals[];
500 extern const value_string gsm_a_qos_del_order_vals[];
501 extern const value_string gsm_a_qos_traffic_cls_vals[];
502 extern const value_string gsm_a_qos_ber_vals[];
503 extern const value_string gsm_a_qos_sdu_err_rat_vals[];
504 extern const value_string gsm_a_qos_traff_hdl_pri_vals[];
505
506 extern const value_string gsm_a_type_of_number_values[];
507 extern const value_string gsm_a_numbering_plan_id_values[]; 
508
509 typedef enum
510 {
511         /* Common Information Elements [3] 10.5.1 */
512         DE_CELL_ID,                             /* Cell Identity */
513         DE_CIPH_KEY_SEQ_NUM,    /* Ciphering Key Sequence Number */
514         DE_LAI,                                 /* Location Area Identification */
515         DE_MID,                                 /* Mobile Identity */
516         DE_MS_CM_1,                             /* Mobile Station Classmark 1 */
517         DE_MS_CM_2,                             /* Mobile Station Classmark 2 */
518         DE_MS_CM_3,                             /* Mobile Station Classmark 3 */
519         DE_SPARE_NIBBLE,                        /* Spare Half Octet */
520         DE_D_GB_CALL_REF,               /* Descriptive group or broadcast call reference */
521         DE_G_CIPH_KEY_NUM,              /* Group Cipher Key Number */
522         DE_PD_SAPI,                             /* PD and SAPI $(CCBS)$ */
523         DE_PRIO,                                /* Priority Level */
524         DE_PLMN_LIST,                   /* PLMN List */
525
526         DE_COMMON_NONE                                                  /* NONE */
527 }
528 common_elem_idx_t;
529
530 typedef enum
531 {
532         /* Mobility Management Information Elements [3] 10.5.3 */
533         DE_AUTH_PARAM_RAND,                             /* Authentication Parameter RAND */
534         DE_AUTH_PARAM_AUTN,                             /* Authentication Parameter AUTN (UMTS authentication challenge only) */
535         DE_AUTH_RESP_PARAM,                             /* Authentication Response Parameter */
536         DE_AUTH_RESP_PARAM_EXT,                 /* Authentication Response Parameter (extension) (UMTS authentication challenge only) */
537         DE_AUTH_FAIL_PARAM,                             /* Authentication Failure Parameter (UMTS authentication challenge only) */
538         DE_CM_SRVC_TYPE,                                /* CM Service Type */
539         DE_ID_TYPE,                                             /* Identity Type */
540         DE_LOC_UPD_TYPE,                                /* Location Updating Type */
541         DE_NETWORK_NAME,                                /* Network Name */
542         DE_REJ_CAUSE,                                   /* Reject Cause */
543         DE_FOP,                                                 /* Follow-on Proceed */
544         DE_TIME_ZONE,                                   /* Time Zone */
545         DE_TIME_ZONE_TIME,                              /* Time Zone and Time */
546         DE_CTS_PERM,                                    /* CTS Permission */
547         DE_LSA_ID,                                              /* LSA Identifier */
548         DE_DAY_SAVING_TIME,                             /* Daylight Saving Time */
549         DE_EMERGENCY_NUM_LIST,                  /* Emergency Number List */
550         /* Call Control Information Elements 10.5.4 */
551         DE_AUX_STATES,                                  /* Auxiliary States */
552         DE_BEARER_CAP,                                  /* Bearer Capability */
553         DE_CC_CAP,                                              /* Call Control Capabilities */
554         DE_CALL_STATE,                                  /* Call State */
555         DE_CLD_PARTY_BCD_NUM,                   /* Called Party BCD Number */
556         DE_CLD_PARTY_SUB_ADDR,                  /* Called Party Subaddress */
557         DE_CLG_PARTY_BCD_NUM,                   /* Calling Party BCD Number */
558         DE_CLG_PARTY_SUB_ADDR,                  /* Calling Party Subaddress */
559         DE_CAUSE,                                               /* Cause */
560         DE_CLIR_SUP,                                    /* CLIR Suppression */
561         DE_CLIR_INV,                                    /* CLIR Invocation */
562         DE_CONGESTION,                                  /* Congestion Level */
563         DE_CONN_NUM,                                    /* Connected Number */
564         DE_CONN_SUB_ADDR,                               /* Connected Subaddress */
565         DE_FACILITY,                                    /* Facility */
566         DE_HLC,                                                 /* High Layer Compatibility */
567         DE_KEYPAD_FACILITY,                             /* Keypad Facility */
568         DE_LLC,                                                 /* Low Layer Compatibility */
569         DE_MORE_DATA,                                   /* More Data */
570         DE_NOT_IND,                                             /* Notification Indicator */
571         DE_PROG_IND,                                    /* Progress Indicator */
572         DE_RECALL_TYPE,                                 /* Recall type $(CCBS)$ */
573         DE_RED_PARTY_BCD_NUM,                   /* Redirecting Party BCD Number */
574         DE_RED_PARTY_SUB_ADDR,                  /* Redirecting Party Subaddress */
575         DE_REPEAT_IND,                                  /* Repeat Indicator */
576         DE_REV_CALL_SETUP_DIR,                  /* Reverse Call Setup Direction */
577         DE_SETUP_CONTAINER,                             /* SETUP Container $(CCBS)$ */
578         DE_SIGNAL,                                              /* Signal */
579         DE_SS_VER_IND,                                  /* SS Version Indicator */
580         DE_USER_USER,                                   /* User-user */
581         DE_ALERT_PATTERN,                               /* Alerting Pattern $(NIA)$ */
582         DE_ALLOWED_ACTIONS,                             /* Allowed Actions $(CCBS)$ */
583         DE_SI,                                                  /* Stream Identifier */
584         DE_NET_CC_CAP,                                  /* Network Call Control Capabilities */
585         DE_CAUSE_NO_CLI,                                /* Cause of No CLI */
586         DE_IMM_MOD_IND,                                 /* Immediate Modification Indicator */
587         DE_SUP_CODEC_LIST,                              /* Supported Codec List */
588         DE_SRVC_CAT,                                    /* Service Category */
589         /* Short Message Service Information Elements [5] 8.1.4 */
590         DE_CP_USER_DATA,                                /* CP-User Data */
591         DE_CP_CAUSE,                                    /* CP-Cause */
592         /* Tests procedures information elements 3GPP TS 44.014 6.4.0 and 3GPP TS 34.109 6.4.0 */
593         DE_TP_SUB_CHANNEL,                      /* Close TCH Loop Cmd Sub-channel */
594         DE_TP_ACK,                      /* Open Loop Cmd Ack */
595         DE_TP_LOOP_TYPE,                        /* Close Multi-slot Loop Cmd Loop type*/
596         DE_TP_LOOP_ACK,                 /* Close Multi-slot Loop Ack Result */
597         DE_TP_TESTED_DEVICE,                    /* Test Interface Tested device */
598         DE_TP_PDU_DESCRIPTION,                  /* GPRS Test Mode Cmd PDU description */
599         DE_TP_MODE_FLAG,                        /* GPRS Test Mode Cmd Mode flag */
600         DE_TP_EGPRS_MODE_FLAG,                  /* EGPRS Start Radio Block Loopback Cmd Mode flag */
601         DE_TP_UE_TEST_LOOP_MODE,                        /* Close UE Test Loop Mode */
602         DE_TP_UE_POSITIONING_TECHNOLOGY,                        /* UE Positioning Technology */
603         DE_TP_RLC_SDU_COUNTER_VALUE,                    /* RLC SDU Counter Value */
604         DE_NONE                                                 /* NONE */
605 }
606 dtap_elem_idx_t;
607
608 typedef enum
609 {
610         /* GPRS Mobility Management Information Elements [3] 10.5.5 */
611         DE_ATTACH_RES,                                  /* [7] 10.5.1 Attach Result*/
612         DE_ATTACH_TYPE,                                 /* [7] 10.5.2 Attach Type */
613         DE_CIPH_ALG,                                    /* [7] 10.5.3 Cipher Algorithm */
614         DE_TMSI_STAT,                                   /* [7] 10.5.4 TMSI Status */
615         DE_DETACH_TYPE,                                 /* [7] 10.5.5 Detach Type */
616         DE_DRX_PARAM,                                   /* [7] 10.5.6 DRX Parameter */
617         DE_FORCE_TO_STAND,                              /* [7] 10.5.7 Force to Standby */
618         DE_FORCE_TO_STAND_H,                    /* [7] 10.5.8 Force to Standby - Info is in the high nibble */
619         DE_P_TMSI_SIG,                                  /* [7] 10.5.9 P-TMSI Signature */
620         DE_P_TMSI_SIG_2,                                /* [7] 10.5.10 P-TMSI Signature 2 */
621         DE_ID_TYPE_2,                                   /* [7] 10.5.11 Identity Type 2 */
622         DE_IMEISV_REQ,                                  /* [7] 10.5.12 IMEISV Request */
623         DE_REC_N_PDU_NUM_LIST,                  /* [7] 10.5.13 Receive N-PDU Numbers List */
624         DE_MS_NET_CAP,                                  /* [7] 10.5.14 MS Network Capability */
625         DE_MS_RAD_ACC_CAP,                              /* [7] 10.5.15 MS Radio Access Capability */
626         DE_GMM_CAUSE,                                   /* [7] 10.5.16 GMM Cause */
627         DE_RAI,                                                 /* [7] 10.5.17 Routing Area Identification */
628         DE_UPD_RES,                                             /* [7] 10.5.18 Update Result */
629         DE_UPD_TYPE,                                    /* [7] 10.5.19 Update Type */
630         DE_AC_REF_NUM,                                  /* [7] 10.5.20 A&C Reference Number */
631         DE_AC_REF_NUM_H,                                /* A&C Reference Number - Info is in the high nibble */
632         DE_SRVC_TYPE,                                   /* [7] 10.5.20 Service Type */
633         DE_CELL_NOT,                                    /* [7] 10.5.21 Cell Notification */
634         DE_PS_LCS_CAP,                                  /* [7] 10.5.22 PS LCS Capability */
635         DE_NET_FEAT_SUP,                                /* [7] 10.5.23 Network Feature Support */
636         DE_RAT_INFO_CONTAINER,                  /* [7] 10.5.24 Inter RAT information container */
637         /* [7] 10.5.25 Requested MS information */
638         /* Session Management Information Elements [3] 10.5.6 */
639         DE_ACC_POINT_NAME,                              /* Access Point Name */
640         DE_NET_SAPI,                                    /* Network Service Access Point Identifier */
641         DE_PRO_CONF_OPT,                                /* Protocol Configuration Options */
642         DE_PD_PRO_ADDR,                                 /* Packet Data Protocol Address */
643         DE_QOS,                                                 /* Quality Of Service */
644         DE_SM_CAUSE,                                    /* SM Cause */
645         DE_LINKED_TI,                                   /* Linked TI */
646         DE_LLC_SAPI,                                    /* LLC Service Access Point Identifier */
647         DE_TEAR_DOWN_IND,                               /* Tear Down Indicator */
648         DE_PACKET_FLOW_ID,                              /* Packet Flow Identifier */
649         DE_TRAFFIC_FLOW_TEMPLATE,               /* Traffic Flow Template */
650         /* GPRS Common Information Elements [8] 10.5.7 */
651         DE_PDP_CONTEXT_STAT,                    /* [8] 10.5.7.1         PDP Context Status */
652         DE_RAD_PRIO,                                    /* [8] 10.5.7.2         Radio Priority */
653         DE_GPRS_TIMER,                                  /* [8] 10.5.7.3         GPRS Timer */
654         DE_GPRS_TIMER_2,                                /* [8] 10.5.7.4         GPRS Timer 2 */
655         DE_RAD_PRIO_2,                                  /* [8] 10.5.7.5         Radio Priority 2 */
656         DE_MBMS_CTX_STATUS,                             /* [8] 10.5.7.6         MBMS context status */
657         DE_GM_NONE                                                      /* NONE */
658 }
659 gm_elem_idx_t;
660
661 #endif /* __PACKET_GSM_A_COMMON_H__ */