1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
4 /* asn2wrs.py -u -q -L -p atn-cm -c ./atn-cm.cnf -s ./packet-atn-cm-template -D . -O ../.. atn-cm.asn */
7 * By Mathias Guettler <guettler@web.de>
10 * Routines for ATN context management protocol packet disassembly.
11 * ATN context management allows an aircraft
12 * to log on to a ground facility.
15 * https://en.wikipedia.org/wiki/CPDLC
16 * https://members.optusnet.com.au/~cjr/introduction.htm
19 * We are dealing with ATN/CPDLC aka ICAO Doc 9705 Second Edition here
20 * (CPDLC may also be transmitted via ACARS/AOA aka "FANS-1/A ").
21 * https://www.icao.int/safety/acp/repository/_%20Doc9705_ed2_1999.pdf
23 * Wireshark - Network traffic analyzer
24 * By Gerald Combs <gerald@wireshark.org>
25 * Copyright 1998 Gerald Combs
27 * SPDX-License-Identifier: GPL-2.0-or-later
32 #include <epan/packet.h>
33 #include <epan/exceptions.h>
34 #include <epan/conversation.h>
35 #include <wsutil/array.h>
36 #include "packet-ber.h"
37 #include "packet-per.h"
38 #include "packet-atn-ulcs.h"
40 #define ATN_CM_PROTO "ICAO Doc9705 CM"
42 void proto_register_atn_cm(void);
43 void proto_reg_handoff_atn_cm(void);
45 static int hf_atn_cm_CMAircraftMessage_PDU
; /* CMAircraftMessage */
46 static int hf_atn_cm_CMGroundMessage_PDU
; /* CMGroundMessage */
47 static int hf_atn_cm_cmLogonRequest
; /* CMLogonRequest */
48 static int hf_atn_cm_cmContactResponse
; /* CMContactResponse */
49 static int hf_atn_cm_cmAbortReason
; /* CMAbortReason */
50 static int hf_atn_cm_cmLogonResponse
; /* CMLogonResponse */
51 static int hf_atn_cm_cmUpdate
; /* CMUpdate */
52 static int hf_atn_cm_cmContactRequest
; /* CMContactRequest */
53 static int hf_atn_cm_cmForwardRequest
; /* CMForwardRequest */
54 static int hf_atn_cm_cmForwardResponse
; /* CMForwardResponse */
55 static int hf_atn_cm_longTsap
; /* LongTsap */
56 static int hf_atn_cm_shortTsap
; /* ShortTsap */
57 static int hf_atn_cm_aeQualifier
; /* AEQualifier */
58 static int hf_atn_cm_apVersion
; /* VersionNumber */
59 static int hf_atn_cm_apAddress
; /* APAddress */
60 static int hf_atn_cm_facilityDesignation
; /* FacilityDesignation */
61 static int hf_atn_cm_address
; /* LongTsap */
62 static int hf_atn_cm_aircraftFlightIdentification
; /* AircraftFlightIdentification */
63 static int hf_atn_cm_cMLongTSAP
; /* LongTsap */
64 static int hf_atn_cm_groundInitiatedApplications
; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress */
65 static int hf_atn_cm_groundInitiatedApplications_item
; /* AEQualifierVersionAddress */
66 static int hf_atn_cm_airOnlyInitiatedApplications
; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersion */
67 static int hf_atn_cm_airOnlyInitiatedApplications_item
; /* AEQualifierVersion */
68 static int hf_atn_cm_airportDeparture
; /* Airport */
69 static int hf_atn_cm_airportDestination
; /* Airport */
70 static int hf_atn_cm_dateTimeDepartureETD
; /* DateTime */
71 static int hf_atn_cm_airInitiatedApplications
; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress */
72 static int hf_atn_cm_airInitiatedApplications_item
; /* AEQualifierVersionAddress */
73 static int hf_atn_cm_groundOnlyInitiatedApplications
; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersion */
74 static int hf_atn_cm_groundOnlyInitiatedApplications_item
; /* AEQualifierVersion */
75 static int hf_atn_cm_year
; /* Year */
76 static int hf_atn_cm_month
; /* Month */
77 static int hf_atn_cm_day
; /* Day */
78 static int hf_atn_cm_date
; /* Date */
79 static int hf_atn_cm_time
; /* Time */
80 static int hf_atn_cm_rDP
; /* OCTET_STRING_SIZE_5 */
81 static int hf_atn_cm_aRS
; /* OCTET_STRING_SIZE_3 */
82 static int hf_atn_cm_locSysNselTsel
; /* OCTET_STRING_SIZE_10_11 */
83 static int hf_atn_cm_hours
; /* Timehours */
84 static int hf_atn_cm_minutes
; /* Timeminutes */
86 static int ett_atn_cm_CMAircraftMessage
;
87 static int ett_atn_cm_CMGroundMessage
;
88 static int ett_atn_cm_APAddress
;
89 static int ett_atn_cm_AEQualifierVersion
;
90 static int ett_atn_cm_AEQualifierVersionAddress
;
91 static int ett_atn_cm_CMContactRequest
;
92 static int ett_atn_cm_CMLogonRequest
;
93 static int ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
;
94 static int ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
;
95 static int ett_atn_cm_CMLogonResponse
;
96 static int ett_atn_cm_Date
;
97 static int ett_atn_cm_DateTime
;
98 static int ett_atn_cm_LongTsap
;
99 static int ett_atn_cm_ShortTsap
;
100 static int ett_atn_cm_Time
;
101 static int ett_atn_cm
;
106 dissect_atn_cm_AircraftFlightIdentification(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
107 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
117 dissect_atn_cm_OCTET_STRING_SIZE_5(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
118 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
127 dissect_atn_cm_OCTET_STRING_SIZE_3(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
128 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
137 dissect_atn_cm_OCTET_STRING_SIZE_10_11(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
138 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
139 10, 11, false, NULL
);
145 static const per_sequence_t ShortTsap_sequence
[] = {
146 { &hf_atn_cm_aRS
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_3
},
147 { &hf_atn_cm_locSysNselTsel
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_10_11
},
152 dissect_atn_cm_ShortTsap(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
153 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
154 ett_atn_cm_ShortTsap
, ShortTsap_sequence
);
160 static const per_sequence_t LongTsap_sequence
[] = {
161 { &hf_atn_cm_rDP
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_5
},
162 { &hf_atn_cm_shortTsap
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_ShortTsap
},
167 dissect_atn_cm_LongTsap(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
168 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
169 ett_atn_cm_LongTsap
, LongTsap_sequence
);
177 dissect_atn_cm_AEQualifier(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
178 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
179 0U, 255U, NULL
, false);
187 dissect_atn_cm_VersionNumber(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
188 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
189 1U, 255U, NULL
, false);
195 static const value_string atn_cm_APAddress_vals
[] = {
201 static const per_choice_t APAddress_choice
[] = {
202 { 0, &hf_atn_cm_longTsap
, ASN1_NO_EXTENSIONS
, dissect_atn_cm_LongTsap
},
203 { 1, &hf_atn_cm_shortTsap
, ASN1_NO_EXTENSIONS
, dissect_atn_cm_ShortTsap
},
208 dissect_atn_cm_APAddress(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
209 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
210 ett_atn_cm_APAddress
, APAddress_choice
,
217 static const per_sequence_t AEQualifierVersionAddress_sequence
[] = {
218 { &hf_atn_cm_aeQualifier
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifier
},
219 { &hf_atn_cm_apVersion
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_VersionNumber
},
220 { &hf_atn_cm_apAddress
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_APAddress
},
225 dissect_atn_cm_AEQualifierVersionAddress(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
226 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
227 ett_atn_cm_AEQualifierVersionAddress
, AEQualifierVersionAddress_sequence
);
233 static const per_sequence_t SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress_sequence_of
[1] = {
234 { &hf_atn_cm_groundInitiatedApplications_item
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifierVersionAddress
},
238 dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
239 offset
= dissect_per_constrained_sequence_of(tvb
, offset
, actx
, tree
, hf_index
,
240 ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
, SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress_sequence_of
,
247 static const per_sequence_t AEQualifierVersion_sequence
[] = {
248 { &hf_atn_cm_aeQualifier
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifier
},
249 { &hf_atn_cm_apVersion
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_VersionNumber
},
254 dissect_atn_cm_AEQualifierVersion(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
255 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
256 ett_atn_cm_AEQualifierVersion
, AEQualifierVersion_sequence
);
262 static const per_sequence_t SEQUENCE_SIZE_1_256_OF_AEQualifierVersion_sequence_of
[1] = {
263 { &hf_atn_cm_airOnlyInitiatedApplications_item
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifierVersion
},
267 dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
268 offset
= dissect_per_constrained_sequence_of(tvb
, offset
, actx
, tree
, hf_index
,
269 ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
, SEQUENCE_SIZE_1_256_OF_AEQualifierVersion_sequence_of
,
278 dissect_atn_cm_FacilityDesignation(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
279 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
289 dissect_atn_cm_Airport(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
290 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
300 dissect_atn_cm_Year(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
301 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
302 1996U, 2095U, NULL
, false);
310 dissect_atn_cm_Month(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
311 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
312 1U, 12U, NULL
, false);
320 dissect_atn_cm_Day(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
321 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
322 1U, 31U, NULL
, false);
328 static const per_sequence_t Date_sequence
[] = {
329 { &hf_atn_cm_year
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Year
},
330 { &hf_atn_cm_month
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Month
},
331 { &hf_atn_cm_day
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Day
},
336 dissect_atn_cm_Date(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
337 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
338 ett_atn_cm_Date
, Date_sequence
);
346 dissect_atn_cm_Timehours(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
347 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
348 0U, 23U, NULL
, false);
356 dissect_atn_cm_Timeminutes(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
357 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
358 0U, 59U, NULL
, false);
364 static const per_sequence_t Time_sequence
[] = {
365 { &hf_atn_cm_hours
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Timehours
},
366 { &hf_atn_cm_minutes
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Timeminutes
},
371 dissect_atn_cm_Time(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
372 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
373 ett_atn_cm_Time
, Time_sequence
);
379 static const per_sequence_t DateTime_sequence
[] = {
380 { &hf_atn_cm_date
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Date
},
381 { &hf_atn_cm_time
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Time
},
386 dissect_atn_cm_DateTime(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
387 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
388 ett_atn_cm_DateTime
, DateTime_sequence
);
394 static const per_sequence_t CMLogonRequest_sequence
[] = {
395 { &hf_atn_cm_aircraftFlightIdentification
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AircraftFlightIdentification
},
396 { &hf_atn_cm_cMLongTSAP
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_LongTsap
},
397 { &hf_atn_cm_groundInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
},
398 { &hf_atn_cm_airOnlyInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
},
399 { &hf_atn_cm_facilityDesignation
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_FacilityDesignation
},
400 { &hf_atn_cm_airportDeparture
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_Airport
},
401 { &hf_atn_cm_airportDestination
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_Airport
},
402 { &hf_atn_cm_dateTimeDepartureETD
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_DateTime
},
407 dissect_atn_cm_CMLogonRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
408 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
409 ett_atn_cm_CMLogonRequest
, CMLogonRequest_sequence
);
415 static const value_string atn_cm_Response_vals
[] = {
416 { 0, "contactSuccess" },
417 { 1, "contactNotSuccessful" },
423 dissect_atn_cm_Response(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
424 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
425 2, NULL
, false, 0, NULL
);
433 dissect_atn_cm_CMContactResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
434 offset
= dissect_atn_cm_Response(tvb
, offset
, actx
, tree
, hf_index
);
440 static const value_string atn_cm_CMAbortReason_vals
[] = {
441 { 0, "timer-expired" },
442 { 1, "undefined-error" },
443 { 2, "invalid-PDU" },
444 { 3, "protocol-error" },
445 { 4, "dialogue-acceptance-not-permitted" },
446 { 5, "dialogue-end-not-accepted" },
447 { 6, "communication-service-error" },
448 { 7, "communication-service-failure" },
449 { 8, "invalid-QOS-parameter" },
450 { 9, "expected-PDU-missing" },
456 dissect_atn_cm_CMAbortReason(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
457 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
458 10, NULL
, true, 0, NULL
);
464 static const value_string atn_cm_CMAircraftMessage_vals
[] = {
465 { 0, "cmLogonRequest" },
466 { 1, "cmContactResponse" },
467 { 2, "cmAbortReason" },
471 static const per_choice_t CMAircraftMessage_choice
[] = {
472 { 0, &hf_atn_cm_cmLogonRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMLogonRequest
},
473 { 1, &hf_atn_cm_cmContactResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMContactResponse
},
474 { 2, &hf_atn_cm_cmAbortReason
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMAbortReason
},
479 dissect_atn_cm_CMAircraftMessage(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
480 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
481 ett_atn_cm_CMAircraftMessage
, CMAircraftMessage_choice
,
488 static const per_sequence_t CMLogonResponse_sequence
[] = {
489 { &hf_atn_cm_airInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
},
490 { &hf_atn_cm_groundOnlyInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
},
495 dissect_atn_cm_CMLogonResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
496 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
497 ett_atn_cm_CMLogonResponse
, CMLogonResponse_sequence
);
505 dissect_atn_cm_CMUpdate(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
506 offset
= dissect_atn_cm_CMLogonResponse(tvb
, offset
, actx
, tree
, hf_index
);
512 static const per_sequence_t CMContactRequest_sequence
[] = {
513 { &hf_atn_cm_facilityDesignation
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_FacilityDesignation
},
514 { &hf_atn_cm_address
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_LongTsap
},
519 dissect_atn_cm_CMContactRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
520 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
521 ett_atn_cm_CMContactRequest
, CMContactRequest_sequence
);
529 dissect_atn_cm_CMForwardRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
530 offset
= dissect_atn_cm_CMLogonRequest(tvb
, offset
, actx
, tree
, hf_index
);
536 static const value_string atn_cm_CMForwardResponse_vals
[] = {
538 { 1, "incompatible-version" },
539 { 2, "service-not-supported" },
545 dissect_atn_cm_CMForwardResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
546 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
547 3, NULL
, false, 0, NULL
);
553 static const value_string atn_cm_CMGroundMessage_vals
[] = {
554 { 0, "cmLogonResponse" },
556 { 2, "cmContactRequest" },
557 { 3, "cmForwardRequest" },
558 { 4, "cmAbortReason" },
559 { 5, "cmForwardResponse" },
563 static const per_choice_t CMGroundMessage_choice
[] = {
564 { 0, &hf_atn_cm_cmLogonResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMLogonResponse
},
565 { 1, &hf_atn_cm_cmUpdate
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMUpdate
},
566 { 2, &hf_atn_cm_cmContactRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMContactRequest
},
567 { 3, &hf_atn_cm_cmForwardRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMForwardRequest
},
568 { 4, &hf_atn_cm_cmAbortReason
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMAbortReason
},
569 { 5, &hf_atn_cm_cmForwardResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMForwardResponse
},
574 dissect_atn_cm_CMGroundMessage(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
575 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
576 ett_atn_cm_CMGroundMessage
, CMGroundMessage_choice
,
584 static int dissect_CMAircraftMessage_PDU(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
, void *data _U_
) {
587 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_PER
, false, pinfo
);
588 offset
= dissect_atn_cm_CMAircraftMessage(tvb
, offset
, &asn1_ctx
, tree
, hf_atn_cm_CMAircraftMessage_PDU
);
589 offset
+= 7; offset
>>= 3;
592 static int dissect_CMGroundMessage_PDU(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
, void *data _U_
) {
595 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_PER
, false, pinfo
);
596 offset
= dissect_atn_cm_CMGroundMessage(tvb
, offset
, &asn1_ctx
, tree
, hf_atn_cm_CMGroundMessage_PDU
);
597 offset
+= 7; offset
>>= 3;
601 static int proto_atn_cm
;
611 proto_tree
*sub_tree
;
613 sub_tree
= proto_tree_add_subtree(
614 tree
, tvb
, 0, -1, ett_atn_cm
, NULL
, ATN_CM_PROTO
);
616 /* ti = proto_tree_add_item(tree, proto_atn_cm, tvb, 0, 0 , ENC_NA); */
617 /* sub_tree = proto_item_add_subtree(ti, ett_atn_cm_pdu); */
619 /* determine whether it is uplink or downlink */
620 type
= check_heur_msg_type(pinfo
);
624 dissect_CMGroundMessage_PDU(
630 dissect_CMAircraftMessage_PDU(
638 return tvb_reported_length_remaining(tvb
, 0);
648 atn_conversation_t
*volatile atn_cv
= NULL
;
649 volatile bool is_atn_cm
= false;
652 /* determine whether it is uplink or downlink */
653 type
= check_heur_msg_type(pinfo
);
655 /* heuristically decode message */
659 dissect_CMGroundMessage_PDU(
663 /* no exception thrown: looks like it is a CM PDU */
671 dissect_CMAircraftMessage_PDU(
675 /* no exception thrown: looks like it is a CM PDU */
685 if (is_atn_cm
== true) {
687 /* all subsequent PDU's belonging to this conversation are considered CM */
688 /* if the first CM PDU has been decoded successfully */
689 /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */
691 /* DT: dstref present, srcref is always zero */
692 if((pinfo
->clnp_dstref
) &&
693 (!pinfo
->clnp_srcref
)){
695 atn_cv
= find_atn_conversation(
700 /* CR: srcref present, dstref is always zero */
701 if((!pinfo
->clnp_dstref
) &&
702 (pinfo
->clnp_srcref
)){
704 atn_cv
= find_atn_conversation(
710 /* CC: srcref and dstref present */
711 if((pinfo
->clnp_dstref
) &&
712 (pinfo
->clnp_srcref
)){
713 atn_cv
= find_atn_conversation(
719 atn_cv
->ae_qualifier
= cma
;
732 void proto_register_atn_cm (void)
734 static hf_register_info hf_atn_cm
[] = {
735 { &hf_atn_cm_CMAircraftMessage_PDU
,
736 { "CMAircraftMessage", "atn-cm.CMAircraftMessage",
737 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMAircraftMessage_vals
), 0,
739 { &hf_atn_cm_CMGroundMessage_PDU
,
740 { "CMGroundMessage", "atn-cm.CMGroundMessage",
741 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMGroundMessage_vals
), 0,
743 { &hf_atn_cm_cmLogonRequest
,
744 { "cmLogonRequest", "atn-cm.cmLogonRequest_element",
745 FT_NONE
, BASE_NONE
, NULL
, 0,
747 { &hf_atn_cm_cmContactResponse
,
748 { "cmContactResponse", "atn-cm.cmContactResponse",
749 FT_UINT32
, BASE_DEC
, VALS(atn_cm_Response_vals
), 0,
751 { &hf_atn_cm_cmAbortReason
,
752 { "cmAbortReason", "atn-cm.cmAbortReason",
753 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMAbortReason_vals
), 0,
755 { &hf_atn_cm_cmLogonResponse
,
756 { "cmLogonResponse", "atn-cm.cmLogonResponse_element",
757 FT_NONE
, BASE_NONE
, NULL
, 0,
759 { &hf_atn_cm_cmUpdate
,
760 { "cmUpdate", "atn-cm.cmUpdate_element",
761 FT_NONE
, BASE_NONE
, NULL
, 0,
763 { &hf_atn_cm_cmContactRequest
,
764 { "cmContactRequest", "atn-cm.cmContactRequest_element",
765 FT_NONE
, BASE_NONE
, NULL
, 0,
767 { &hf_atn_cm_cmForwardRequest
,
768 { "cmForwardRequest", "atn-cm.cmForwardRequest_element",
769 FT_NONE
, BASE_NONE
, NULL
, 0,
771 { &hf_atn_cm_cmForwardResponse
,
772 { "cmForwardResponse", "atn-cm.cmForwardResponse",
773 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMForwardResponse_vals
), 0,
775 { &hf_atn_cm_longTsap
,
776 { "longTsap", "atn-cm.longTsap_element",
777 FT_NONE
, BASE_NONE
, NULL
, 0,
779 { &hf_atn_cm_shortTsap
,
780 { "shortTsap", "atn-cm.shortTsap_element",
781 FT_NONE
, BASE_NONE
, NULL
, 0,
783 { &hf_atn_cm_aeQualifier
,
784 { "aeQualifier", "atn-cm.aeQualifier",
785 FT_UINT32
, BASE_DEC
, NULL
, 0,
787 { &hf_atn_cm_apVersion
,
788 { "apVersion", "atn-cm.apVersion",
789 FT_UINT32
, BASE_DEC
, NULL
, 0,
790 "VersionNumber", HFILL
}},
791 { &hf_atn_cm_apAddress
,
792 { "apAddress", "atn-cm.apAddress",
793 FT_UINT32
, BASE_DEC
, VALS(atn_cm_APAddress_vals
), 0,
795 { &hf_atn_cm_facilityDesignation
,
796 { "facilityDesignation", "atn-cm.facilityDesignation",
797 FT_STRING
, BASE_NONE
, NULL
, 0,
799 { &hf_atn_cm_address
,
800 { "address", "atn-cm.address_element",
801 FT_NONE
, BASE_NONE
, NULL
, 0,
802 "LongTsap", HFILL
}},
803 { &hf_atn_cm_aircraftFlightIdentification
,
804 { "aircraftFlightIdentification", "atn-cm.aircraftFlightIdentification",
805 FT_STRING
, BASE_NONE
, NULL
, 0,
807 { &hf_atn_cm_cMLongTSAP
,
808 { "cMLongTSAP", "atn-cm.cMLongTSAP_element",
809 FT_NONE
, BASE_NONE
, NULL
, 0,
810 "LongTsap", HFILL
}},
811 { &hf_atn_cm_groundInitiatedApplications
,
812 { "groundInitiatedApplications", "atn-cm.groundInitiatedApplications",
813 FT_UINT32
, BASE_DEC
, NULL
, 0,
814 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress", HFILL
}},
815 { &hf_atn_cm_groundInitiatedApplications_item
,
816 { "AEQualifierVersionAddress", "atn-cm.AEQualifierVersionAddress_element",
817 FT_NONE
, BASE_NONE
, NULL
, 0,
819 { &hf_atn_cm_airOnlyInitiatedApplications
,
820 { "airOnlyInitiatedApplications", "atn-cm.airOnlyInitiatedApplications",
821 FT_UINT32
, BASE_DEC
, NULL
, 0,
822 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersion", HFILL
}},
823 { &hf_atn_cm_airOnlyInitiatedApplications_item
,
824 { "AEQualifierVersion", "atn-cm.AEQualifierVersion_element",
825 FT_NONE
, BASE_NONE
, NULL
, 0,
827 { &hf_atn_cm_airportDeparture
,
828 { "airportDeparture", "atn-cm.airportDeparture",
829 FT_STRING
, BASE_NONE
, NULL
, 0,
831 { &hf_atn_cm_airportDestination
,
832 { "airportDestination", "atn-cm.airportDestination",
833 FT_STRING
, BASE_NONE
, NULL
, 0,
835 { &hf_atn_cm_dateTimeDepartureETD
,
836 { "dateTimeDepartureETD", "atn-cm.dateTimeDepartureETD_element",
837 FT_NONE
, BASE_NONE
, NULL
, 0,
838 "DateTime", HFILL
}},
839 { &hf_atn_cm_airInitiatedApplications
,
840 { "airInitiatedApplications", "atn-cm.airInitiatedApplications",
841 FT_UINT32
, BASE_DEC
, NULL
, 0,
842 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress", HFILL
}},
843 { &hf_atn_cm_airInitiatedApplications_item
,
844 { "AEQualifierVersionAddress", "atn-cm.AEQualifierVersionAddress_element",
845 FT_NONE
, BASE_NONE
, NULL
, 0,
847 { &hf_atn_cm_groundOnlyInitiatedApplications
,
848 { "groundOnlyInitiatedApplications", "atn-cm.groundOnlyInitiatedApplications",
849 FT_UINT32
, BASE_DEC
, NULL
, 0,
850 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersion", HFILL
}},
851 { &hf_atn_cm_groundOnlyInitiatedApplications_item
,
852 { "AEQualifierVersion", "atn-cm.AEQualifierVersion_element",
853 FT_NONE
, BASE_NONE
, NULL
, 0,
856 { "year", "atn-cm.year",
857 FT_UINT32
, BASE_DEC
, NULL
, 0,
860 { "month", "atn-cm.month",
861 FT_UINT32
, BASE_DEC
, NULL
, 0,
864 { "day", "atn-cm.day",
865 FT_UINT32
, BASE_DEC
, NULL
, 0,
868 { "date", "atn-cm.date_element",
869 FT_NONE
, BASE_NONE
, NULL
, 0,
872 { "time", "atn-cm.time_element",
873 FT_NONE
, BASE_NONE
, NULL
, 0,
876 { "rDP", "atn-cm.rDP",
877 FT_BYTES
, BASE_NONE
, NULL
, 0,
878 "OCTET_STRING_SIZE_5", HFILL
}},
880 { "aRS", "atn-cm.aRS",
881 FT_BYTES
, BASE_NONE
, NULL
, 0,
882 "OCTET_STRING_SIZE_3", HFILL
}},
883 { &hf_atn_cm_locSysNselTsel
,
884 { "locSysNselTsel", "atn-cm.locSysNselTsel",
885 FT_BYTES
, BASE_NONE
, NULL
, 0,
886 "OCTET_STRING_SIZE_10_11", HFILL
}},
888 { "hours", "atn-cm.hours",
889 FT_UINT32
, BASE_DEC
, NULL
, 0,
890 "Timehours", HFILL
}},
891 { &hf_atn_cm_minutes
,
892 { "minutes", "atn-cm.minutes",
893 FT_UINT32
, BASE_DEC
, NULL
, 0,
894 "Timeminutes", HFILL
}},
896 static int *ett
[] = {
897 &ett_atn_cm_CMAircraftMessage
,
898 &ett_atn_cm_CMGroundMessage
,
899 &ett_atn_cm_APAddress
,
900 &ett_atn_cm_AEQualifierVersion
,
901 &ett_atn_cm_AEQualifierVersionAddress
,
902 &ett_atn_cm_CMContactRequest
,
903 &ett_atn_cm_CMLogonRequest
,
904 &ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
,
905 &ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
,
906 &ett_atn_cm_CMLogonResponse
,
908 &ett_atn_cm_DateTime
,
909 &ett_atn_cm_LongTsap
,
910 &ett_atn_cm_ShortTsap
,
915 /* register CM application */
916 proto_atn_cm
= proto_register_protocol(ATN_CM_PROTO
, "ATN-CM", "atn-cm");
918 proto_register_field_array(
921 array_length(hf_atn_cm
));
923 proto_register_subtree_array(
933 void proto_reg_handoff_atn_cm(void)
935 /* add session dissector to subdissector list*/
939 "ATN-CM over ATN-ULCS",
941 proto_atn_cm
, HEURISTIC_ENABLE
);
945 * Editor modelines - https://www.wireshark.org/tools/modelines.html
950 * indent-tabs-mode: nil
953 * vi: set shiftwidth=4 tabstop=8 expandtab:
954 * :indentSize=4:tabSize=8:noTabs=true: