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