/src/wireshark/epan/dissectors/packet-gcsna.c
Line | Count | Source |
1 | | /* |
2 | | * packet-gcsna.c |
3 | | * |
4 | | * Wireshark - Network traffic analyzer |
5 | | * By Gerald Combs <gerald@wireshark.org> |
6 | | * Copyright 1998 Gerald Combs |
7 | | * |
8 | | * SPDX-License-Identifier: GPL-2.0-or-later |
9 | | * |
10 | | * Ref GCSNA: 3GPP2 C.S0097 v2.0 |
11 | | */ |
12 | | |
13 | | # include "config.h" |
14 | | |
15 | | #include <epan/packet.h> |
16 | | #include <epan/expert.h> |
17 | | |
18 | | void proto_reg_handoff_gcsna(void); |
19 | | void proto_register_gcsna(void); |
20 | | |
21 | | /* gcsna Handle for the dissection */ |
22 | | static dissector_handle_t gcsna_handle; |
23 | | static dissector_handle_t cdma2k_handle; |
24 | | |
25 | | /* Function handlers for each message/information fields */ |
26 | | static void gcsna_message_decode(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset, proto_tree *mainTree, uint16_t *noerror, packet_info *pinfo); |
27 | | static void gcsna_message_GCSNA1xCircuitService(proto_item *item, tvbuff_t *tvb, packet_info *pinfo, proto_tree *mainTree, proto_tree *tree, unsigned *offset); |
28 | | static void gcsna_message_GCSNAL2Ack(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset); |
29 | | static void gcsna_message_GCSNAServiceReject(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset); |
30 | | |
31 | | /*Initialize all the header parameters that are to be displayed*/ |
32 | | static int proto_gcsna; |
33 | | static int hf_gcsna_msghdr; |
34 | | static int hf_gcsna_msgid; |
35 | | static int hf_gcsna_rejSequence; |
36 | | static int hf_gcsna_cause; |
37 | | static int hf_gcsna_ackSequence; |
38 | | static int hf_gcsna_recordType; |
39 | | static int hf_gcsna_1xProtocolRevision; |
40 | | static int hf_gcsna_invalidMessageId; |
41 | | static int hf_gcsna_l2ack; |
42 | | static int hf_gcsna_servicereject; |
43 | | static int hf_gcsna_gcsna_option; |
44 | | static int hf_gcsna_gcsnaClass; |
45 | | static int hf_gcsna_gcsnaClassRev; |
46 | | static int hf_gcsna_altGCSNAOption; |
47 | | static int hf_gcsna_altGCSNAOptionIncluded; |
48 | | static int hf_gcsna_NumaltGCSNAOption; |
49 | | static int hf_gcsna_ackRequired; |
50 | | static int hf_gcsna_stopDupDetect; |
51 | | static int hf_gcsna_msgSequence; |
52 | | static int hf_gcsna_tlacEncapsulated; |
53 | | static int hf_gcsna_NumTLACEncapsulated1xL3PDU; |
54 | | static int hf_gcsna_tlacReserved; |
55 | | static int hf_gcsna_iwsidIncluded; |
56 | | static int hf_gcsna_iwsidValue; |
57 | | static int hf_gcsna_unsupported_reject_seq; |
58 | | |
59 | | /* Toggle sub-tree items */ |
60 | | static int ett_gcsna_msghdr; |
61 | | static int ett_gcsna_subtree; |
62 | | static int ett_gcsna_option; |
63 | | |
64 | | static expert_field ei_gcsna_error; |
65 | | |
66 | 275 | #define GCSNA1XCIRCUITSERVICE 0x01 |
67 | 7 | #define GCSNAL2ACK 0x02 |
68 | 6 | #define GCSNASERVICEREJECT 0x03 |
69 | | |
70 | | /* Msg Types */ |
71 | | static const value_string gcsna_message_types[] = { |
72 | | { 0x01, "GCSNA 1X Circuitservice" }, |
73 | | { 0x02, "GCSNA L2 Ack"}, |
74 | | { 0x03, "GCSNA Servicereject"}, |
75 | | { 0, NULL }, |
76 | | }; |
77 | | |
78 | | /* Cause Types */ |
79 | | static const value_string gcsna_cause_types[] = { |
80 | | { 0, "Invalid GCSNAOption" }, |
81 | | { 1, "Invalid 1xProtocolRevision" }, |
82 | | { 2, "Invalid GCSNAOption and 1xProtocolRevision"}, |
83 | | { 3, "Invalid Message Id"}, |
84 | | { 4, "GCSNA 1xParameters provisioning is not supported" }, |
85 | | { 5, "Unsupported RecordType in GCSNA 1xParameters message"}, |
86 | | { 0, NULL }, |
87 | | }; |
88 | | |
89 | | /* |
90 | | GCSNA Class GCSNA ClassRevision 1x Service |
91 | | +----------+-------------------+--------------------------------+ |
92 | | | | 0 | Release 8 1xCSFB from E-UTRAN | |
93 | | | +-------------------+--------------------------------+ |
94 | | | 0 | 1 | Release 9 e1xCSFB from E-UTRAN | |
95 | | | +-------------------+--------------------------------+ |
96 | | | | 2 | C.S0097-A supported eCSFB | |
97 | | +----------+-------------------+--------------------------------+ |
98 | | | 1 | 0 | SRVCC from E-UTRAN | |
99 | | +----------+-------------------+--------------------------------+ |
100 | | |
101 | | */ |
102 | | static const value_string gcsna_option_values[] = { |
103 | | { 0, "Release 8 1xCSFB from E-UTRAN" }, |
104 | | { 1, "Release 9 e1xCSFB from E-UTRAN" }, |
105 | | { 2, "C.S0097-A supported eCSFB"}, |
106 | | { 8, "SRVCC from E-UTRAN"}, |
107 | | { 0, NULL }, |
108 | | }; |
109 | | |
110 | | static const value_string gcsna_tru_false_values[] = { |
111 | | { 0, "False" }, |
112 | | { 1, "True" }, |
113 | | { 0, NULL }, |
114 | | }; |
115 | | |
116 | | /* Decoder for all the information elements of A21 Message Type */ |
117 | | static void |
118 | | gcsna_message_decode(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset, proto_tree *mainTree, uint16_t *noerror, packet_info *pinfo) |
119 | 299 | { |
120 | 299 | uint16_t msgId = -1; |
121 | 299 | msgId = tvb_get_uint8(tvb, *offset); |
122 | 299 | *offset += 1; |
123 | | |
124 | 299 | switch (msgId) |
125 | 299 | { |
126 | 275 | case GCSNA1XCIRCUITSERVICE: |
127 | 275 | { |
128 | 275 | gcsna_message_GCSNA1xCircuitService(item, tvb, pinfo, mainTree, tree, offset); |
129 | 275 | break; |
130 | 0 | } |
131 | | |
132 | 7 | case GCSNAL2ACK: |
133 | 7 | { |
134 | 7 | gcsna_message_GCSNAL2Ack(item, tvb, tree, offset); |
135 | 7 | break; |
136 | 0 | } |
137 | | |
138 | 6 | case GCSNASERVICEREJECT: |
139 | 6 | { |
140 | 6 | gcsna_message_GCSNAServiceReject(item, tvb, tree, offset); |
141 | 6 | break; |
142 | 0 | } |
143 | | |
144 | 11 | default: |
145 | 11 | { |
146 | 11 | *noerror = 0; |
147 | 11 | break; |
148 | 0 | } |
149 | 299 | } |
150 | 299 | } |
151 | | |
152 | | static void |
153 | | gcsna_message_GCSNA1xCircuitService(proto_item *item, tvbuff_t *tvb, packet_info *pinfo, proto_tree *mainTree, proto_tree *tree, unsigned *offset) |
154 | 275 | { |
155 | 275 | uint16_t alt_gcsna_incl = 0, num_alt_gcsna_opt = -1, iws_incl = 0; |
156 | 275 | uint8_t num_res; |
157 | 275 | unsigned bit_offset = *offset * 8; |
158 | 275 | proto_tree *subtree = NULL; |
159 | 275 | tvbuff_t *new_tvb; |
160 | | |
161 | | /* GCSNAOption 8 bits */ |
162 | 275 | item = proto_tree_add_item(tree, hf_gcsna_gcsna_option, tvb, *offset, 1, ENC_BIG_ENDIAN); |
163 | 275 | subtree = proto_item_add_subtree(item, ett_gcsna_option); |
164 | 275 | proto_tree_add_bits_item(subtree, hf_gcsna_gcsnaClass, tvb, bit_offset, 5, ENC_BIG_ENDIAN); |
165 | 275 | bit_offset += 5; |
166 | 275 | proto_tree_add_bits_item(subtree, hf_gcsna_gcsnaClassRev, tvb, bit_offset, 3, ENC_BIG_ENDIAN); |
167 | 275 | bit_offset += 3; |
168 | | |
169 | 275 | alt_gcsna_incl = tvb_get_bits8(tvb, bit_offset, 1); |
170 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_altGCSNAOptionIncluded, tvb, bit_offset, 1, ENC_BIG_ENDIAN); |
171 | 275 | bit_offset += 1; |
172 | 275 | if (alt_gcsna_incl) |
173 | 33 | { |
174 | 33 | num_alt_gcsna_opt = tvb_get_bits8(tvb, bit_offset, 8); |
175 | 33 | proto_tree_add_bits_item(tree, hf_gcsna_NumaltGCSNAOption, tvb, bit_offset, 8, ENC_BIG_ENDIAN); |
176 | 33 | bit_offset += 8; |
177 | | |
178 | 1.98k | while (num_alt_gcsna_opt != 0) |
179 | 1.95k | { |
180 | 1.95k | proto_tree_add_bits_item(tree, hf_gcsna_altGCSNAOption, tvb, bit_offset, 8, ENC_BIG_ENDIAN); |
181 | 1.95k | bit_offset += 8; |
182 | 1.95k | num_alt_gcsna_opt--; |
183 | 1.95k | } |
184 | 33 | } |
185 | | |
186 | 275 | iws_incl = tvb_get_bits8(tvb, bit_offset, 1); |
187 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_iwsidIncluded, tvb, bit_offset, 1, ENC_BIG_ENDIAN); |
188 | 275 | bit_offset++; |
189 | | |
190 | 275 | if (iws_incl) |
191 | 16 | { |
192 | 16 | proto_tree_add_bits_item(tree, hf_gcsna_iwsidValue, tvb, bit_offset, 16, ENC_BIG_ENDIAN); |
193 | 16 | bit_offset += 16; |
194 | 16 | } |
195 | | |
196 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_ackRequired, tvb, bit_offset, 1, ENC_BIG_ENDIAN); |
197 | 275 | bit_offset++; |
198 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_stopDupDetect, tvb, bit_offset, 1, ENC_BIG_ENDIAN); |
199 | 275 | bit_offset++; |
200 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_msgSequence, tvb, bit_offset, 6, ENC_BIG_ENDIAN); |
201 | 275 | bit_offset += 6; |
202 | | |
203 | 275 | proto_tree_add_bits_item(tree, hf_gcsna_NumTLACEncapsulated1xL3PDU, tvb, bit_offset, 2, ENC_BIG_ENDIAN); |
204 | 275 | bit_offset += 2; |
205 | | |
206 | | /* The sender shall include reserved bits to make this message integral number of octets up to TLACEncapsulated1xL3PDU field. |
207 | | * The sender shall set all bits in this field to '0'. The receiver shall ignore this field. |
208 | | */ |
209 | | |
210 | | /* calculate number of reserved bits */ |
211 | 275 | num_res = (8 - (bit_offset & 0x7)) & 0x7; |
212 | 275 | if (num_res) { |
213 | 272 | proto_tree_add_bits_item(tree, hf_gcsna_tlacReserved, tvb, bit_offset, num_res, ENC_BIG_ENDIAN); |
214 | 272 | bit_offset = bit_offset + num_res; |
215 | 272 | } |
216 | 275 | *offset = bit_offset >> 3; |
217 | | |
218 | 275 | proto_tree_add_item(tree, hf_gcsna_tlacEncapsulated, tvb, *offset, -1, ENC_NA); |
219 | | |
220 | 275 | if (cdma2k_handle) { |
221 | 271 | new_tvb = tvb_new_subset_remaining(tvb, *offset); |
222 | 271 | call_dissector(cdma2k_handle, new_tvb, pinfo, mainTree); |
223 | 271 | } |
224 | | /* set the offset to the end of the message */ |
225 | 275 | *offset += tvb_reported_length_remaining(tvb, *offset); |
226 | | |
227 | 275 | } |
228 | | |
229 | | static void gcsna_message_GCSNAL2Ack(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset) |
230 | 7 | { |
231 | 7 | proto_tree *subtree = NULL; |
232 | | |
233 | 7 | item = proto_tree_add_item(tree, hf_gcsna_l2ack, tvb, *offset, 1, ENC_NA); |
234 | 7 | subtree = proto_item_add_subtree(item, ett_gcsna_subtree); |
235 | | |
236 | 7 | proto_tree_add_bits_item(subtree, hf_gcsna_ackSequence, tvb, *offset * 8, 6, ENC_BIG_ENDIAN); |
237 | 7 | *offset += 1; |
238 | 7 | } |
239 | | |
240 | | static void gcsna_message_GCSNAServiceReject(proto_item *item, tvbuff_t *tvb, proto_tree *tree, unsigned *offset) |
241 | 6 | { |
242 | 6 | uint32_t cause_val = 0, num_fields = 0, l_offset = 0; |
243 | 6 | proto_tree *subtree = NULL; |
244 | | |
245 | 6 | item = proto_tree_add_item(tree, hf_gcsna_servicereject, tvb, *offset, 1, ENC_NA); |
246 | 6 | subtree = proto_item_add_subtree(item, ett_gcsna_subtree); |
247 | | |
248 | 6 | l_offset = *offset * 8; |
249 | 6 | proto_tree_add_bits_item(subtree, hf_gcsna_rejSequence, tvb, l_offset, 6, ENC_BIG_ENDIAN); |
250 | 6 | l_offset += 6; |
251 | 6 | proto_tree_add_bits_item(subtree, hf_gcsna_cause, tvb, l_offset, 8, ENC_BIG_ENDIAN); |
252 | 6 | cause_val = tvb_get_bits8(tvb, *offset * 8 + 6, 8); |
253 | 6 | l_offset += 8; |
254 | | |
255 | 6 | switch (cause_val) |
256 | 6 | { |
257 | 2 | case 0: |
258 | 3 | case 2: |
259 | 3 | { |
260 | 3 | num_fields = tvb_get_bits8(tvb, l_offset, 8); |
261 | 3 | l_offset += 8; |
262 | | |
263 | 6 | while (num_fields > 0) |
264 | 3 | { |
265 | 3 | proto_tree_add_bits_item(subtree, hf_gcsna_gcsnaClass, tvb, l_offset, 5, ENC_BIG_ENDIAN); |
266 | 3 | l_offset += 5; |
267 | 3 | proto_tree_add_bits_item(subtree, hf_gcsna_gcsnaClassRev, tvb, l_offset, 3, ENC_BIG_ENDIAN); |
268 | 3 | l_offset += 3; |
269 | 3 | num_fields--; |
270 | 3 | } |
271 | | |
272 | 3 | if (cause_val == 2) |
273 | 0 | { |
274 | 0 | proto_tree_add_bits_item(subtree, hf_gcsna_1xProtocolRevision, tvb, l_offset, 8, ENC_BIG_ENDIAN); |
275 | 0 | l_offset += 8; |
276 | 0 | } |
277 | | |
278 | 3 | break; |
279 | 2 | } |
280 | | |
281 | 1 | case 1: |
282 | 1 | { |
283 | 1 | proto_tree_add_bits_item(subtree, hf_gcsna_1xProtocolRevision, tvb, l_offset, 8, ENC_BIG_ENDIAN); |
284 | 1 | l_offset += 8; |
285 | 1 | break; |
286 | 2 | } |
287 | | |
288 | 1 | case 3: |
289 | 1 | { |
290 | 1 | proto_tree_add_bits_item(subtree, hf_gcsna_invalidMessageId, tvb, l_offset, 8, ENC_BIG_ENDIAN); |
291 | 1 | l_offset += 8; |
292 | 1 | break; |
293 | 2 | } |
294 | | |
295 | | /*This Cause Value is not supported in IWS Stack*/ |
296 | 0 | case 5: |
297 | 0 | { |
298 | 0 | num_fields = tvb_get_bits8(tvb, l_offset, 8); |
299 | 0 | l_offset += 8; |
300 | |
|
301 | 0 | while (num_fields > 0) |
302 | 0 | { |
303 | 0 | proto_tree_add_bits_item(subtree, hf_gcsna_recordType, tvb, l_offset, 8, ENC_BIG_ENDIAN); |
304 | 0 | l_offset += 8; |
305 | 0 | num_fields--; |
306 | 0 | } |
307 | 0 | break; |
308 | 2 | } |
309 | | |
310 | 1 | default: |
311 | 1 | { |
312 | 1 | proto_tree_add_item(subtree, hf_gcsna_unsupported_reject_seq, tvb, (l_offset + 7) / 8, -1, ENC_NA); |
313 | 1 | l_offset = tvb_captured_length(tvb) * 8; |
314 | 1 | break; |
315 | 2 | } |
316 | 6 | } |
317 | | |
318 | 5 | if (l_offset % 8 == 0) |
319 | 1 | { |
320 | 1 | *offset = (l_offset / 8); |
321 | 1 | } else |
322 | 4 | { |
323 | 4 | *offset = (l_offset / 8) + 1; |
324 | 4 | } |
325 | | |
326 | 5 | } |
327 | | |
328 | | /*Method called when the dissection starts.....Starting point*/ |
329 | | static int |
330 | | dissect_gcsna(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) |
331 | 297 | { |
332 | | |
333 | | /* Initialization*/ |
334 | 297 | proto_tree *gcsna_msghdr_tree_start = NULL; |
335 | | |
336 | 297 | proto_item *item = NULL; |
337 | | |
338 | 297 | uint32_t offset = 0; |
339 | 297 | uint16_t noerror = 1; |
340 | | |
341 | | |
342 | | /*Add the protocol name to display*/ |
343 | 297 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "gcsna"); |
344 | 297 | col_set_str(pinfo->cinfo, COL_INFO, "[gcsna]"); |
345 | | |
346 | 297 | item = proto_tree_add_item(tree, hf_gcsna_msghdr, tvb, 0, -1, ENC_NA); |
347 | 297 | gcsna_msghdr_tree_start = proto_item_add_subtree(item, ett_gcsna_msghdr); |
348 | | |
349 | 297 | if (tree) |
350 | 296 | { |
351 | 296 | proto_tree_add_item(gcsna_msghdr_tree_start, hf_gcsna_msgid, tvb, offset, 1, ENC_BIG_ENDIAN); |
352 | | |
353 | 595 | while (tvb_captured_length_remaining(tvb, offset) != 0 && noerror == 1) |
354 | 299 | gcsna_message_decode(item, tvb, gcsna_msghdr_tree_start, &offset, tree, &noerror, pinfo); |
355 | | |
356 | 296 | if (noerror == 0) |
357 | 11 | { |
358 | 11 | expert_add_info(pinfo, item, &ei_gcsna_error); |
359 | 11 | } |
360 | 296 | } |
361 | 297 | return tvb_reported_length(tvb); |
362 | 297 | } |
363 | | |
364 | | /*Register gcsna to be accessed by other dissectors/plugins*/ |
365 | | void |
366 | | proto_register_gcsna(void) |
367 | 16 | { |
368 | 16 | static hf_register_info hf[] = { |
369 | 16 | { &hf_gcsna_servicereject, |
370 | 16 | { "GCSNA SERVICEREJECT", "gcsna.servicereject", FT_NONE, BASE_NONE,NULL, 0x0, NULL, HFILL } }, |
371 | | /*{ & hf_gcsna_msgid, |
372 | | { "GCSNA Message Type", "gcsna.MsgType", FT_UINT8, BASE_HEX_DEC, VALS(A21_Message_Types), 0x0, NULL, HFILL } },*/ |
373 | 16 | { &hf_gcsna_l2ack, |
374 | 16 | { "L2ACK", "gcsna.l2ack", FT_NONE, BASE_NONE,NULL, 0x0, NULL, HFILL } }, |
375 | 16 | { &hf_gcsna_msghdr, |
376 | 16 | { "General Circuit Services Notification Application Protocol", "gcsna.msghdr", FT_NONE, BASE_NONE,NULL, 0x0, NULL, HFILL } }, |
377 | 16 | { &hf_gcsna_NumTLACEncapsulated1xL3PDU, |
378 | 16 | { "NumTLACEncapsulated1xL3PDU", "gcsna.NumTLACEncapsulated1xL3PDU", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
379 | 16 | { &hf_gcsna_tlacReserved, |
380 | 16 | { "Reserved", "gcsna.tlacReserved", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
381 | 16 | { &hf_gcsna_tlacEncapsulated, |
382 | 16 | { "TLAC Encapsulated", "gcsna.tlacEncapsulated", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } }, |
383 | 16 | { &hf_gcsna_msgSequence, |
384 | 16 | { "Msg Sequence", "gcsna.msgSequence", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
385 | 16 | { &hf_gcsna_stopDupDetect, |
386 | 16 | { "Stop Dup Detect", "gcsna.stopDupDetect", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
387 | 16 | { &hf_gcsna_ackRequired, |
388 | 16 | { "Ack Required", "gcsna.ackRequired", FT_UINT8, BASE_DEC,VALS(gcsna_tru_false_values), 0x0, NULL, HFILL } }, |
389 | 16 | { &hf_gcsna_altGCSNAOptionIncluded, |
390 | 16 | { "AlternativeGCSNAOption_INCL", "gcsna.altGCSNAOptionIncluded", FT_UINT8, BASE_DEC,VALS(gcsna_tru_false_values), 0x0, NULL, HFILL } }, |
391 | 16 | { &hf_gcsna_altGCSNAOption, |
392 | 16 | { "Alternate GCSNA Option", "gcsna.altGCSNAOption", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, |
393 | 16 | { &hf_gcsna_gcsna_option, |
394 | 16 | { "GCSNA Option", "gcsna.Option", FT_UINT8, BASE_HEX, VALS(gcsna_option_values), 0x0, NULL, HFILL } }, |
395 | 16 | { &hf_gcsna_NumaltGCSNAOption, |
396 | 16 | { "NumAlternativeGCSNAOptions", "gcsna.NumaltGCSNAOption", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
397 | 16 | { &hf_gcsna_iwsidValue, |
398 | 16 | { "IWS_ID", "gcsna.iwsidValue", FT_UINT16, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
399 | 16 | { &hf_gcsna_iwsidIncluded, |
400 | 16 | { "IWSIDIncl", "gcsna.iwsidIncluded", FT_UINT8, BASE_DEC,VALS(gcsna_tru_false_values), 0x0, NULL, HFILL } }, |
401 | 16 | { &hf_gcsna_gcsnaClassRev, |
402 | 16 | { "GCSNA Class revision", "gcsna.ClassRev", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
403 | 16 | { &hf_gcsna_gcsnaClass, |
404 | 16 | { "GCSNA Class", "gcsna.Class", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
405 | 16 | { &hf_gcsna_invalidMessageId, |
406 | 16 | { "InvalidMessageId", "gcsna.invalidMessageId", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
407 | 16 | { &hf_gcsna_1xProtocolRevision, |
408 | 16 | { "1xProtocolRevision", "gcsna.1xProtocolRevision", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
409 | 16 | { &hf_gcsna_recordType, |
410 | 16 | { "Record Type", "gcsna.recordType", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
411 | 16 | { &hf_gcsna_ackSequence, |
412 | 16 | { "Ack Sequence", "gcsna.ackSequence", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
413 | 16 | { &hf_gcsna_cause, |
414 | 16 | { "Cause", "gcsna.cause", FT_UINT8, BASE_HEX_DEC,VALS(gcsna_cause_types), 0x0, NULL, HFILL } }, |
415 | 16 | { &hf_gcsna_rejSequence, |
416 | 16 | { "Reject Sequence", "gcsna.rejSequence", FT_UINT8, BASE_HEX_DEC,NULL, 0x0, NULL, HFILL } }, |
417 | 16 | { &hf_gcsna_msgid, |
418 | 16 | { "GCSNA Message Type", "gcsna.msgId", FT_UINT8, BASE_HEX_DEC,VALS(gcsna_message_types), 0x0, NULL, HFILL } }, |
419 | 16 | { &hf_gcsna_unsupported_reject_seq, |
420 | 16 | { "Invalid / Unsupported GCSNA Message Reject Sequence", "gcsna.unsupportedrejectseq", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } } |
421 | 16 | }; |
422 | | |
423 | | |
424 | 16 | static int *ett[] = { |
425 | 16 | &ett_gcsna_msghdr, |
426 | 16 | &ett_gcsna_subtree, |
427 | 16 | &ett_gcsna_option |
428 | 16 | }; |
429 | | |
430 | | |
431 | 16 | static ei_register_info ei[] = { |
432 | 16 | { &ei_gcsna_error, { "gcsna.error", PI_PROTOCOL, PI_ERROR, "Violation of protocol specs (e.g. invalid information element)", EXPFILL }}, |
433 | 16 | }; |
434 | | |
435 | 16 | expert_module_t* expert_gcsna; |
436 | | |
437 | 16 | proto_gcsna = proto_register_protocol("GCSNA", "GCSNA", "gcsna"); |
438 | | |
439 | 16 | gcsna_handle = register_dissector("gcsna", dissect_gcsna, proto_gcsna); |
440 | | |
441 | 16 | proto_register_field_array(proto_gcsna, hf, array_length(hf)); |
442 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
443 | | |
444 | 16 | expert_gcsna = expert_register_protocol(proto_gcsna); |
445 | 16 | expert_register_field_array(expert_gcsna, ei, array_length(ei)); |
446 | | |
447 | 16 | } |
448 | | |
449 | | void |
450 | | proto_reg_handoff_gcsna(void) |
451 | 16 | { |
452 | 16 | cdma2k_handle = find_dissector("cdma2k"); |
453 | 16 | } |