4 AARQ-apdu/protocol-version aarq-apdu_protocol-version
5 AARE-apdu/protocol-version aare-apdu_protocol-version
6 RLRE-apdu/reason rlre-apdu_response_reason
7 RLRQ-apdu/reason rlrq-apdu_request_reason
8 EXTERNALt/encoding/single-ASN1-type externalt_encoding_single-asn1-type
9 EXTERNALt/encoding/arbitrary externalt_encoding_arbitrary
10 EXTERNALt/encoding/octet-aligned externalt_encoding_octet-aligned
11 PDV-list/presentation-data-values/single-ASN1-type pdv-list_presentation-data-values_single-asn1-type
12 PDV-list/presentation-data-values/arbitrary pdv-list_presentation-data-values_arbitrary
21 #.FN_PARS Release-request-reason
26 #.FN_BODY Presentation-context-identifier
28 offset = dissect_per_constrained_integer(
41 #.FN_BODY PDV-list/presentation-data-values/arbitrary
43 packet_info * pinfo = actx->pinfo;
44 tvbuff_t *tvb_usr = NULL;
45 proto_tree *atn_ulcs_tree = NULL;
46 atn_conversation_t *atn_cv = NULL;
47 heur_dtbl_entry_t *hdtbl_entry;
49 /* extract bitstring into new tvb buffer */
50 offset = dissect_per_bit_string(
65 /* call appropriate dissector for bitstring data */
66 switch(ulcs_context_value){
68 atn_ulcs_tree = proto_tree_add_subtree(
69 root_tree, tvb, offset, 0,
70 ett_atn_acse, NULL, ATN_ACSE_PROTO );
72 dissect_ACSE_apdu_PDU(
73 tvb_new_subset_remaining(tvb_usr, 0),
77 case 3: /* USER data; call subdissector for CM, CPDLC ... */
79 /* using dstref for PDV-list only occurs in DT */
80 atn_cv = find_atn_conversation(
86 switch(atn_cv->ae_qualifier){
87 case cma: /* contact management */
88 call_dissector_with_data(
90 tvb_new_subset_remaining(tvb_usr, 0),
95 case cpdlc: /* plain old cpdlc */
96 case pmcpdlc: /* protected mode cpdlc */
97 call_dissector_with_data(
99 tvb_new_subset_remaining(tvb_usr, 0),
104 default: /* unknown or unhandled datalink application */
105 dissector_try_heuristic(
106 atn_ulcs_heur_subdissector_list,
107 tvb_new_subset_remaining(tvb_usr,0),
116 dissector_try_heuristic(
117 atn_ulcs_heur_subdissector_list,
118 tvb_new_subset_remaining(tvb_usr,0),
127 } /* switch(ulcs_context_value) */
133 #.FN_BODY Authentication-value/other/other-mechanism-value
135 offset=call_ber_oid_callback(
136 object_identifier_id,
144 #.FN_BODY Mechanism-name
146 offset = dissect_per_object_identifier(
157 #.FN_BODY Authentication-value/other/other-mechanism-value
159 offset=call_ber_oid_callback(
160 object_identifier_id,
168 #.FN_BODY AE-qualifier-form2
169 packet_info * pinfo = actx->pinfo;
170 atn_conversation_t *atn_cv = NULL;
171 uint32_t ae_qualifier = 0;
173 /* dissect ae-qualifier */
174 offset = dissect_per_integer(
184 /* the field "calling-AE-qualifier" is optional, */
185 /* which means that we can exploit it only if it is present. */
186 /* We still depend on heuristical decoding of CM, CPDLC PDU's otherwise. */
188 /* AARQ/DT: dstref present, srcref is always zero */
189 if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){
190 atn_cv = find_atn_conversation(&pinfo->dst,
195 /* AARQ/CR: srcref present, dstref is always zero */
196 if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){
197 atn_cv = find_atn_conversation(&pinfo->src,
203 atn_cv->ae_qualifier = ae_qualifier;
208 packet_info * pinfo = actx->pinfo;
209 aarq_data_t *aarq_data = NULL;
210 atn_conversation_t *atn_cv = NULL;
211 uint32_t aircraft_24_bit_address = 0;
213 /* AARQ/DT: dstref present, srcref is always zero */
214 if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){
216 atn_cv = find_atn_conversation(
221 atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t);
222 atn_cv->ae_qualifier = unknown;
223 create_atn_conversation(&pinfo->dst,
230 /* AARQ/CR: srcref present, dstref is always zero */
231 if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){
232 atn_cv = find_atn_conversation(&pinfo->src,
236 atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t);
237 atn_cv->ae_qualifier = unknown;
238 create_atn_conversation(&pinfo->src,
245 /* conversation is to be created prior to decoding */
246 /* of "AE-qualifier-form2" which takes place here: */
250 /* save AARQ packet data to create a conversation */
251 /* when decoding the following AARE PDU */
252 /* ATN applications CM and CPDLC are air/ground applications */
253 /* so there is always an aircraft (with its 24-bit address) */
254 /* and a ground facility. */
255 /* the assumption is that there is only one open AARQ/AARE */
256 /* dialog per aircraft at a time. */
257 /* the aircraft's 24-bit address is used as a key to each AARQ */
258 /* data. AARQ data is used to create a conversation with */
259 /* air and ground endpoints (based on NSAP's and transport references) */
260 /* when decoding AARE.*/
262 /* it may be more robust to create the conversation */
263 /* in the "ositp" dissector an to merely use the conversation here */
264 aircraft_24_bit_address =
265 get_aircraft_24_bit_address_from_nsap(pinfo);
267 /* search for aarq entry */
268 aarq_data = (aarq_data_t *) wmem_tree_lookup32(
270 aircraft_24_bit_address);
272 if(!aarq_data){ /* aarq data not found, create new record */
274 /* alloc aarq data */
275 aarq_data = wmem_new(wmem_file_scope(), aarq_data_t);
276 aarq_data-> aarq_pending = false;
278 /* insert aarq data */
279 wmem_tree_insert32(aarq_data_tree ,aircraft_24_bit_address,(void*)aarq_data);
282 /* check for pending AARQ/AARE sequences */
283 /* if "aarq_data-> aarq_pending" is set this means that there is already one */
284 /* AARQ/AARE sequence pending (is unwise to overwrite AARE/AARQ) */
285 if (aarq_data-> aarq_pending == false ) {
288 memset(aarq_data,0,sizeof(aarq_data_t));
290 aarq_data->cv = atn_cv;
291 aarq_data-> aarq_pending = true;
298 packet_info * pinfo = actx->pinfo;
299 uint32_t aircraft_24_bit_address = 0 ;
300 atn_conversation_t *atn_cv = NULL;
301 aarq_data_t *aarq_data = NULL;
303 /* get AARQ data and use it to create a new conversation, */
304 /* the conversation is used along with */
305 /* AARQ's "calling ae qualifier" to determine the */
306 /* type of air/ground application of each subsequent frame.*/
307 /* we use this information to invoke the correct application dissector. */
309 /* heuristical decoding of ASN1 will not work for all cases, */
310 /* for there may be CM PDU's which will exactly look like CPDLC PDU'S */
312 /* get 24-bit icao address */
313 aircraft_24_bit_address = get_aircraft_24_bit_address_from_nsap(pinfo);
315 /* search for aarq entry */
316 aarq_data = (aarq_data_t *) wmem_tree_lookup32(
318 aircraft_24_bit_address);
320 /* no aarq data present, do nothing */
321 /* without both ends of the conversation and without */
322 /* the "calling ae-qualifier there is no point in setting up "*/
329 /* AARE/DT: dstref present, srcref is always zero */
330 if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){
332 atn_cv = find_atn_conversation(&pinfo->dst,
336 if(!atn_cv){ /* conversation not fond */
338 /* DT has only dstref - create new conversation */
339 create_atn_conversation(&pinfo->dst,
346 /* AARE/CC: srcref and dstref present */
347 if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){
349 atn_cv = find_atn_conversation(
354 if(atn_cv){ /* conversation found. */
356 /* create new conversation for dstref */
357 create_atn_conversation(&pinfo->dst,
362 }else { /* no conversation found */
363 /* as CC contains srcref *and* dstref we use both to create new records */
364 create_atn_conversation(&pinfo->src,
368 create_atn_conversation(&pinfo->dst,
375 /* clear aarq data */
376 memset(aarq_data,0,sizeof(aarq_data_t));
377 aarq_data-> aarq_pending = false;
385 #.FN_BODY Associate-result
386 /* extension present: last param set to true. asn2wrs didn't take notice of that */
387 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
391 #.FN_BODY Release-request-reason
392 /* extension present: last param set to true. asn2wrs didn't take notice of that */
393 offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
394 0U, 30U, NULL, true);
397 #.FN_BODY Release-response-reason
399 /* extension present: last param set to true. asn2wrs didn't take notice of that */
400 offset = dissect_per_constrained_integer(
413 #.FN_BODY Mechanism-name
415 offset = dissect_per_object_identifier(
425 #.FN_BODY RDNSequence
428 * atn-ulcs.asn currently defines
430 * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
431 * RelativeDistinguishedName ::= SET SIZE (1 .. MAX) OF AttributeTypeAndValue
432 * AttributeTypeAndValue ::= SEQUENCE { null NULL}
434 * which makes it easy to spam the dissection tree with null items. Dissect
435 * the first item only.
437 offset = dissect_per_constrained_sequence_of(tvb, offset, actx, tree, hf_index,
438 ett_atn_ulcs_RDNSequence, RDNSequence_sequence_of,
443 #.FN_BODY RelativeDistinguishedName
446 * Dissect the first null item only, similar to RDNSequence.
448 offset = dissect_per_constrained_set_of(tvb, offset, actx, tree, hf_index,
449 ett_atn_ulcs_RelativeDistinguishedName, RelativeDistinguishedName_set_of,
454 #.FN_BODY EXTERNALt/data-value-descriptor
456 offset = dissect_per_octet_string(
465 &actx->external.data_value_descriptor);
466 actx->external.data_value_descr_present = true;
470 #.FN_BODY EXTERNALt/encoding/single-ASN1-type
476 #.FN_BODY EXTERNALt/encoding/octet-aligned
482 #.FN_BODY EXTERNALt/encoding/arbitrary
483 tvbuff_t *tvb_usr = NULL;
484 packet_info * pinfo = actx->pinfo;
485 atn_conversation_t *atn_cv = NULL;
486 heur_dtbl_entry_t *hdtbl_entry;
488 /* decode bit-string user data within ACSE */
489 offset = dissect_per_bit_string(
503 /* DT: dstref present, srcref is always zero */
504 if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){
506 atn_cv = find_atn_conversation(
511 /* CR: srcref present, dstref always zero */
512 if((pinfo->clnp_srcref) && (!pinfo->clnp_dstref)){
514 atn_cv = find_atn_conversation(
519 /* CC: srcref and dstref present */
520 if((pinfo->clnp_srcref) && (pinfo->clnp_dstref)){
522 atn_cv = find_atn_conversation(
529 switch(atn_cv->ae_qualifier){
530 case cma: /* contact management */
532 call_dissector_with_data(
534 tvb_new_subset_remaining(tvb_usr, 0),
539 case cpdlc: /* plain old cpdlc */
540 case pmcpdlc: /* protected mode cpdlc */
542 call_dissector_with_data(
544 tvb_new_subset_remaining(tvb_usr, 0),
549 default: /* unknown or unhandled datalink application */
551 dissector_try_heuristic(
552 atn_ulcs_heur_subdissector_list,
553 tvb_new_subset_remaining(tvb_usr,0),
562 dissector_try_heuristic(
563 atn_ulcs_heur_subdissector_list,
564 tvb_new_subset_remaining(tvb_usr,0),
572 offset += tvb_reported_length_remaining(tvb, offset);
577 # Editor modelines - https://www.wireshark.org/tools/modelines.html
582 # indent-tabs-mode: nil
585 # vi: set shiftwidth=4 tabstop=8 expandtab:
586 # :indentSize=4:tabSize=8:noTabs=true: