blob: e49e92e8b45635fea2fb4443507c8816b246104a [file] [log] [blame]
Harald Welte6a289e02009-08-20 02:33:14 +09001Index: wireshark/epan/dissectors/packet-gsm_a_rr.c
2===================================================================
3--- wireshark.orig/epan/dissectors/packet-gsm_a_rr.c
4+++ wireshark/epan/dissectors/packet-gsm_a_rr.c
Harald Welte6a289e02009-08-20 02:33:14 +09005@@ -301,9 +302,9 @@
6 { 0x00, "Extended Measurement Results" }, /* [3] 10.5.2.45 Extended Measurement Results */
7 { 0x00, "Extended Measurement Frequency List" }, /* [3] 10.5.2.46 Extended Measurement Frequency List */
8 { 0x00, "Suspension Cause" }, /* [3] 10.5.2.47 */
9-/* [3] 10.5.2.48 APDU ID
10- * [3] 10.5.2.49 APDU Flags
11- * [3] 10.5.2.50 APDU Data */
12+ { 0x00, "APDU ID" }, /* [3] 10.5.2.48 APDU ID */
13+ { 0x00, "APDU Flags" }, /* [3] 10.5.2.49 APDU Flags */
14+ { 0x00, "APDU Data" }, /* [3] 10.5.2.50 APDU Data */
15 { 0x00, "Handover to UTRAN Command" }, /* [3] 10.5.2.51 Handover To UTRAN Command */
16 /* [3] 10.5.2.52 Handover To cdma2000 Command
17 * [3] 10.5.2.53 (void)
18@@ -497,6 +498,9 @@
19 static int hf_gsm_a_rr_chnl_needed_ch3 = -1;
20 static int hf_gsm_a_rr_chnl_needed_ch4 = -1;
21 static int hf_gsm_a_rr_suspension_cause = -1;
22+static int hf_gsm_a_rr_apdu_id = -1;
23+static int hf_gsm_a_rr_apdu_flags = -1;
24+static int hf_gsm_a_rr_apdu_data = -1;
25 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8 = -1;
26 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b7 = -1;
27 static int hf_gsm_a_rr_set_of_amr_codec_modes_v1_b6 = -1;
28@@ -691,7 +695,7 @@
29 static char a_bigbuf[1024];
30
31 static dissector_handle_t data_handle;
32-
33+static dissector_handle_t rrlp_dissector;
34
35
36 #define NUM_GSM_RR_ELEM (sizeof(gsm_rr_elem_strings)/sizeof(value_string))
37@@ -6224,9 +6228,50 @@
38 }
39 /*
40 * [3] 10.5.2.48 APDU ID
41+ */
42+static const value_string gsm_a_rr_apdu_id_vals[] = {
43+ { 0, "RRLP (GSM 04.31) LCS" },
44+ { 0, NULL },
45+};
46+static guint16
47+de_rr_apdu_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
48+{
49+ proto_tree_add_item(tree, hf_gsm_a_rr_apdu_id, tvb, offset, 1, FALSE);
50+
51+ return 0;
52+}
53+
54+/*
55 * [3] 10.5.2.49 APDU Flags
56+ */
57+static const value_string gsm_a_rr_apdu_flags_vals[] = {
58+ { 1, "Last or only segment" },
59+ { 2, "First or only segment" },
60+ { 0, NULL },
61+};
62+static guint16
63+de_rr_apdu_flags(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
64+{
65+ proto_tree_add_item(tree, hf_gsm_a_rr_apdu_flags, tvb, offset, 1, FALSE);
66+
67+ return 1;
68+}
69+
70+/*
71 * [3] 10.5.2.50 APDU Data
72 */
73+static guint16
74+de_rr_apdu_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
75+{
76+ tvbuff_t *sub_tvb;
77+ static packet_info p_info;
78+
79+ sub_tvb = tvb_new_subset(tvb, offset, len, len);
80+
81+ call_dissector(rrlp_dissector, sub_tvb, &p_info, tree);
82+
83+ return len;
84+}
85
86 /*
87 * [3] 10.5.2.51 Handover To UTRAN Command
88@@ -6466,9 +6511,9 @@
89 de_rr_ext_meas_result, /* [3] 10.5.2.45 Extended Measurement Results */
90 de_rr_ext_meas_freq_list, /* [3] 10.5.2.46 Extended Measurement Frequency List */
91 de_rr_sus_cau, /* [3] 10.5.2.47 Suspension Cause */
92-/* [3] 10.5.2.48 APDU ID
93- * [3] 10.5.2.49 APDU Flags
94- * [3] 10.5.2.50 APDU Data */
95+ de_rr_apdu_id, /* [3] 10.5.2.48 APDU ID */
96+ de_rr_apdu_flags, /* [3] 10.5.2.49 APDU Flags */
97+ de_rr_apdu_data, /* [3] 10.5.2.50 APDU Data */
98 de_rr_ho_to_utran_cmd, /* [3] 10.5.2.51 Handover To UTRAN Command */
99 /* [3] 10.5.2.52 Handover To cdma2000 Command
100 * [3] 10.5.2.53 (void)
101@@ -7864,6 +7909,24 @@
102 }
103
104 /*
105+ * 9.1.53 Application Information
106+ */
107+static void
108+dtap_rr_app_inf(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
109+{
110+ guint32 curr_offset;
111+ guint32 consumed;
112+ guint curr_len;
113+
114+ curr_offset = offset;
115+ curr_len = len;
116+
117+ ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_APDU_ID);
118+ ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_APDU_FLAGS);
119+ ELEM_MAND_LV(GSM_A_PDU_TYPE_RR, DE_RR_APDU_DATA, NULL);
120+}
121+
122+/*
123 * [4] 9.1.54 Measurement Information
124 */
125 static const value_string gsm_a_rr_3g_wait_vals[] = {
126@@ -8386,7 +8449,7 @@
127
128 NULL, /* UTRAN Classmark Change/Handover To UTRAN Command */ /* spec conflict */
129
130- NULL, /* Application Information */
131+ dtap_rr_app_inf, /* Application Information */
132
133 NULL, /* NONE */
134 };
Harald Welte6a289e02009-08-20 02:33:14 +0900135@@ -9155,6 +9219,21 @@
136 FT_UINT8,BASE_DEC, VALS(gsm_a_rr_suspension_cause_vals), 0x0,
137 NULL, HFILL }
138 },
139+ { &hf_gsm_a_rr_apdu_id,
140+ { "APDU ID","gsm_a.rr.apdu_id",
141+ FT_UINT8,BASE_HEX, VALS(gsm_a_rr_apdu_id_vals), 0x0f,
142+ NULL, HFILL }
143+ },
144+ { &hf_gsm_a_rr_apdu_flags,
145+ { "APDU Flags","gsm_a.rr.apdu_flags",
146+ FT_UINT8,BASE_HEX, VALS(gsm_a_rr_apdu_flags_vals), 0xf0,
147+ NULL, HFILL }
148+ },
149+ { &hf_gsm_a_rr_apdu_data,
150+ { "APDU Data","gsm_a.rr.apdu_data",
151+ FT_BYTES,BASE_HEX, NULL, 0x00,
152+ NULL, HFILL }
153+ },
154 { &hf_gsm_a_rr_set_of_amr_codec_modes_v1_b8,
155 { "12,2 kbit/s codec rate", "gsm_a.rr.set_of_amr_codec_modes_v1b8",
156 FT_BOOLEAN,8, TFS(&gsm_a_rr_set_of_amr_codec_modes), 0x80,
157@@ -10157,4 +10236,5 @@
158 data_handle = find_dissector("data");
159 rrc_irat_ho_info_handle = find_dissector("rrc.irat.irat_ho_info");
160 rrc_irat_ho_to_utran_cmd_handle = find_dissector("rrc.irat.ho_to_utran_cmd");
161+ rrlp_dissector = find_dissector("rrlp");
162 }
163Index: wireshark/epan/dissectors/packet-gsm_a_common.h
164===================================================================
165--- wireshark.orig/epan/dissectors/packet-gsm_a_common.h
166+++ wireshark/epan/dissectors/packet-gsm_a_common.h
167@@ -1101,9 +1101,9 @@
168 DE_RR_EXT_MEAS_RESULT, /* [3] 10.5.2.45 Extended Measurement Results */
169 DE_RR_EXT_MEAS_FREQ_LIST, /* [3] 10.5.2.46 Extended Measurement Frequency List */
170 DE_RR_SUS_CAU, /* [3] 10.5.2.47 Suspension Cause */
171-/* [3] 10.5.2.48 APDU ID
172- * [3] 10.5.2.49 APDU Flags
173- * [3] 10.5.2.50 APDU Data */
174+ DE_RR_APDU_ID, /* [3] 10.5.2.48 APDU ID */
175+ DE_RR_APDU_FLAGS, /* [3] 10.5.2.49 APDU Flags */
176+ DE_RR_APDU_DATA, /* [3] 10.5.2.50 APDU Data */
177 DE_RR_HO_TO_UTRAN_CMD, /* [3] 10.5.2.51 Handover To UTRAN Command */
178 /* [3] 10.5.2.52 Handover To cdma2000 Command
179 * [3] 10.5.2.53 (void)