1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2wrs.py -u -L -p atn-cm -c ./atn-cm.cnf -s ./packet-atn-cm-template -D . -O ../../epan/dissectors atn-cm.asn */
6 /* Input file: packet-atn-cm-template.c */
8 #line 1 "../../asn1/atn-cm/packet-atn-cm-template.c"
9 /* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: t
10 * vi: set shiftwidth=2 tabstop=2 noexpandtab:
11 * :indentSize=2:tabSize=2:noTabs=false:
16 * By Mathias Guettler <guettler@web.de>
21 * Routines for ATN context management protocol packet disassembly.
22 * ATN context management allows an aircraft
23 * to log on to a ground facility.
26 * http://en.wikipedia.org/wiki/CPDLC
27 * http://members.optusnet.com.au/~cjr/introduction.htm
30 * http://legacy.icao.int/anb/panels/acp/repository.cfm
33 * We are dealing with ATN/CPDLC aka ICAO Doc 9705 Ed2 here
34 * (CPDLC may also be transmitted via ACARS/AOA aka "FANS-1/A ").
37 * Wireshark - Network traffic analyzer
38 * By Gerald Combs <gerald@wireshark.org>
39 * Copyright 1998 Gerald Combs
41 * This program is free software; you can redistribute it and/or
42 * modify it under the terms of the GNU General Public License
43 * as published by the Free Software Foundation; either version 2
44 * of the License, or (at your option) any later version.
46 * This program is distributed in the hope that it will be useful,
47 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49 * GNU General Public License for more details.
51 * You should have received a copy of the GNU General Public License
52 * along with this program; if not, write to the Free Software
53 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
59 #include <epan/packet.h>
60 #include <epan/exceptions.h>
61 #include <epan/conversation.h>
62 #include <epan/dissectors/packet-ber.h>
63 #include <epan/dissectors/packet-per.h>
64 #include <epan/conversation.h>
70 #include "packet-atn-ulcs.h"
72 #define ATN_CM_PROTO "ICAO Doc9705 CM"
75 /*--- Included file: packet-atn-cm-hf.c ---*/
76 #line 1 "../../asn1/atn-cm/packet-atn-cm-hf.c"
77 static int hf_atn_cm_CMAircraftMessage_PDU
= -1; /* CMAircraftMessage */
78 static int hf_atn_cm_CMGroundMessage_PDU
= -1; /* CMGroundMessage */
79 static int hf_atn_cm_cmLogonRequest
= -1; /* CMLogonRequest */
80 static int hf_atn_cm_cmContactResponse
= -1; /* CMContactResponse */
81 static int hf_atn_cm_cmAbortReason
= -1; /* CMAbortReason */
82 static int hf_atn_cm_cmLogonResponse
= -1; /* CMLogonResponse */
83 static int hf_atn_cm_cmUpdate
= -1; /* CMUpdate */
84 static int hf_atn_cm_cmContactRequest
= -1; /* CMContactRequest */
85 static int hf_atn_cm_cmForwardRequest
= -1; /* CMForwardRequest */
86 static int hf_atn_cm_cmForwardResponse
= -1; /* CMForwardResponse */
87 static int hf_atn_cm_longTsap
= -1; /* LongTsap */
88 static int hf_atn_cm_shortTsap
= -1; /* ShortTsap */
89 static int hf_atn_cm_aeQualifier
= -1; /* AEQualifier */
90 static int hf_atn_cm_apVersion
= -1; /* VersionNumber */
91 static int hf_atn_cm_apAddress
= -1; /* APAddress */
92 static int hf_atn_cm_facilityDesignation
= -1; /* FacilityDesignation */
93 static int hf_atn_cm_address
= -1; /* LongTsap */
94 static int hf_atn_cm_aircraftFlightIdentification
= -1; /* AircraftFlightIdentification */
95 static int hf_atn_cm_cMLongTSAP
= -1; /* LongTsap */
96 static int hf_atn_cm_groundInitiatedApplications
= -1; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress */
97 static int hf_atn_cm_groundInitiatedApplications_item
= -1; /* AEQualifierVersionAddress */
98 static int hf_atn_cm_airOnlyInitiatedApplications
= -1; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersion */
99 static int hf_atn_cm_airOnlyInitiatedApplications_item
= -1; /* AEQualifierVersion */
100 static int hf_atn_cm_airportDeparture
= -1; /* Airport */
101 static int hf_atn_cm_airportDestination
= -1; /* Airport */
102 static int hf_atn_cm_dateTimeDepartureETD
= -1; /* DateTime */
103 static int hf_atn_cm_airInitiatedApplications
= -1; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress */
104 static int hf_atn_cm_airInitiatedApplications_item
= -1; /* AEQualifierVersionAddress */
105 static int hf_atn_cm_groundOnlyInitiatedApplications
= -1; /* SEQUENCE_SIZE_1_256_OF_AEQualifierVersion */
106 static int hf_atn_cm_groundOnlyInitiatedApplications_item
= -1; /* AEQualifierVersion */
107 static int hf_atn_cm_year
= -1; /* Year */
108 static int hf_atn_cm_month
= -1; /* Month */
109 static int hf_atn_cm_day
= -1; /* Day */
110 static int hf_atn_cm_date
= -1; /* Date */
111 static int hf_atn_cm_time
= -1; /* Time */
112 static int hf_atn_cm_rDP
= -1; /* OCTET_STRING_SIZE_5 */
113 static int hf_atn_cm_aRS
= -1; /* OCTET_STRING_SIZE_3 */
114 static int hf_atn_cm_locSysNselTsel
= -1; /* OCTET_STRING_SIZE_10_11 */
115 static int hf_atn_cm_hours
= -1; /* Timehours */
116 static int hf_atn_cm_minutes
= -1; /* Timeminutes */
118 /*--- End of included file: packet-atn-cm-hf.c ---*/
119 #line 67 "../../asn1/atn-cm/packet-atn-cm-template.c"
122 /*--- Included file: packet-atn-cm-ett.c ---*/
123 #line 1 "../../asn1/atn-cm/packet-atn-cm-ett.c"
124 static gint ett_atn_cm_CMAircraftMessage
= -1;
125 static gint ett_atn_cm_CMGroundMessage
= -1;
126 static gint ett_atn_cm_APAddress
= -1;
127 static gint ett_atn_cm_AEQualifierVersion
= -1;
128 static gint ett_atn_cm_AEQualifierVersionAddress
= -1;
129 static gint ett_atn_cm_CMContactRequest
= -1;
130 static gint ett_atn_cm_CMLogonRequest
= -1;
131 static gint ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
= -1;
132 static gint ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
= -1;
133 static gint ett_atn_cm_CMLogonResponse
= -1;
134 static gint ett_atn_cm_Date
= -1;
135 static gint ett_atn_cm_DateTime
= -1;
136 static gint ett_atn_cm_LongTsap
= -1;
137 static gint ett_atn_cm_ShortTsap
= -1;
138 static gint ett_atn_cm_Time
= -1;
140 /*--- End of included file: packet-atn-cm-ett.c ---*/
141 #line 69 "../../asn1/atn-cm/packet-atn-cm-template.c"
142 static gint ett_atn_cm
= -1;
145 /*--- Included file: packet-atn-cm-fn.c ---*/
146 #line 1 "../../asn1/atn-cm/packet-atn-cm-fn.c"
150 dissect_atn_cm_AircraftFlightIdentification(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
151 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
160 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_
) {
161 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
170 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_
) {
171 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
180 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_
) {
181 offset
= dissect_per_octet_string(tvb
, offset
, actx
, tree
, hf_index
,
182 10, 11, FALSE
, NULL
);
188 static const per_sequence_t ShortTsap_sequence
[] = {
189 { &hf_atn_cm_aRS
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_3
},
190 { &hf_atn_cm_locSysNselTsel
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_10_11
},
195 dissect_atn_cm_ShortTsap(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
196 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
197 ett_atn_cm_ShortTsap
, ShortTsap_sequence
);
203 static const per_sequence_t LongTsap_sequence
[] = {
204 { &hf_atn_cm_rDP
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_OCTET_STRING_SIZE_5
},
205 { &hf_atn_cm_shortTsap
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_ShortTsap
},
210 dissect_atn_cm_LongTsap(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
211 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
212 ett_atn_cm_LongTsap
, LongTsap_sequence
);
220 dissect_atn_cm_AEQualifier(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
221 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
222 0U, 255U, NULL
, FALSE
);
230 dissect_atn_cm_VersionNumber(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
231 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
232 1U, 255U, NULL
, FALSE
);
238 static const value_string atn_cm_APAddress_vals
[] = {
244 static const per_choice_t APAddress_choice
[] = {
245 { 0, &hf_atn_cm_longTsap
, ASN1_NO_EXTENSIONS
, dissect_atn_cm_LongTsap
},
246 { 1, &hf_atn_cm_shortTsap
, ASN1_NO_EXTENSIONS
, dissect_atn_cm_ShortTsap
},
251 dissect_atn_cm_APAddress(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
252 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
253 ett_atn_cm_APAddress
, APAddress_choice
,
260 static const per_sequence_t AEQualifierVersionAddress_sequence
[] = {
261 { &hf_atn_cm_aeQualifier
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifier
},
262 { &hf_atn_cm_apVersion
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_VersionNumber
},
263 { &hf_atn_cm_apAddress
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_APAddress
},
268 dissect_atn_cm_AEQualifierVersionAddress(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
269 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
270 ett_atn_cm_AEQualifierVersionAddress
, AEQualifierVersionAddress_sequence
);
276 static const per_sequence_t SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress_sequence_of
[1] = {
277 { &hf_atn_cm_groundInitiatedApplications_item
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifierVersionAddress
},
281 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_
) {
282 offset
= dissect_per_constrained_sequence_of(tvb
, offset
, actx
, tree
, hf_index
,
283 ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
, SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress_sequence_of
,
290 static const per_sequence_t AEQualifierVersion_sequence
[] = {
291 { &hf_atn_cm_aeQualifier
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifier
},
292 { &hf_atn_cm_apVersion
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_VersionNumber
},
297 dissect_atn_cm_AEQualifierVersion(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
298 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
299 ett_atn_cm_AEQualifierVersion
, AEQualifierVersion_sequence
);
305 static const per_sequence_t SEQUENCE_SIZE_1_256_OF_AEQualifierVersion_sequence_of
[1] = {
306 { &hf_atn_cm_airOnlyInitiatedApplications_item
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AEQualifierVersion
},
310 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_
) {
311 offset
= dissect_per_constrained_sequence_of(tvb
, offset
, actx
, tree
, hf_index
,
312 ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
, SEQUENCE_SIZE_1_256_OF_AEQualifierVersion_sequence_of
,
321 dissect_atn_cm_FacilityDesignation(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
322 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
331 dissect_atn_cm_Airport(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
332 offset
= dissect_per_IA5String(tvb
, offset
, actx
, tree
, hf_index
,
341 dissect_atn_cm_Year(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
342 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
343 1996U, 2095U, NULL
, FALSE
);
351 dissect_atn_cm_Month(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
352 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
353 1U, 12U, NULL
, FALSE
);
361 dissect_atn_cm_Day(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
362 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
363 1U, 31U, NULL
, FALSE
);
369 static const per_sequence_t Date_sequence
[] = {
370 { &hf_atn_cm_year
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Year
},
371 { &hf_atn_cm_month
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Month
},
372 { &hf_atn_cm_day
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Day
},
377 dissect_atn_cm_Date(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
378 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
379 ett_atn_cm_Date
, Date_sequence
);
387 dissect_atn_cm_Timehours(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
388 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
389 0U, 23U, NULL
, FALSE
);
397 dissect_atn_cm_Timeminutes(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
398 offset
= dissect_per_constrained_integer(tvb
, offset
, actx
, tree
, hf_index
,
399 0U, 59U, NULL
, FALSE
);
405 static const per_sequence_t Time_sequence
[] = {
406 { &hf_atn_cm_hours
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Timehours
},
407 { &hf_atn_cm_minutes
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Timeminutes
},
412 dissect_atn_cm_Time(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
413 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
414 ett_atn_cm_Time
, Time_sequence
);
420 static const per_sequence_t DateTime_sequence
[] = {
421 { &hf_atn_cm_date
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Date
},
422 { &hf_atn_cm_time
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_Time
},
427 dissect_atn_cm_DateTime(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
428 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
429 ett_atn_cm_DateTime
, DateTime_sequence
);
435 static const per_sequence_t CMLogonRequest_sequence
[] = {
436 { &hf_atn_cm_aircraftFlightIdentification
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_AircraftFlightIdentification
},
437 { &hf_atn_cm_cMLongTSAP
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_LongTsap
},
438 { &hf_atn_cm_groundInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
},
439 { &hf_atn_cm_airOnlyInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
},
440 { &hf_atn_cm_facilityDesignation
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_FacilityDesignation
},
441 { &hf_atn_cm_airportDeparture
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_Airport
},
442 { &hf_atn_cm_airportDestination
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_Airport
},
443 { &hf_atn_cm_dateTimeDepartureETD
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_DateTime
},
448 dissect_atn_cm_CMLogonRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
449 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
450 ett_atn_cm_CMLogonRequest
, CMLogonRequest_sequence
);
456 static const value_string atn_cm_Response_vals
[] = {
457 { 0, "contactSuccess" },
458 { 1, "contactNotSuccessful" },
464 dissect_atn_cm_Response(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
465 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
466 2, NULL
, FALSE
, 0, NULL
);
474 dissect_atn_cm_CMContactResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
475 offset
= dissect_atn_cm_Response(tvb
, offset
, actx
, tree
, hf_index
);
481 static const value_string atn_cm_CMAbortReason_vals
[] = {
482 { 0, "timer-expired" },
483 { 1, "undefined-error" },
484 { 2, "invalid-PDU" },
485 { 3, "protocol-error" },
486 { 4, "dialogue-acceptance-not-permitted" },
487 { 5, "dialogue-end-not-accepted" },
488 { 6, "communication-service-error" },
489 { 7, "communication-service-failure" },
490 { 8, "invalid-QOS-parameter" },
491 { 9, "expected-PDU-missing" },
497 dissect_atn_cm_CMAbortReason(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
498 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
499 10, NULL
, TRUE
, 0, NULL
);
505 static const value_string atn_cm_CMAircraftMessage_vals
[] = {
506 { 0, "cmLogonRequest" },
507 { 1, "cmContactResponse" },
508 { 2, "cmAbortReason" },
512 static const per_choice_t CMAircraftMessage_choice
[] = {
513 { 0, &hf_atn_cm_cmLogonRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMLogonRequest
},
514 { 1, &hf_atn_cm_cmContactResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMContactResponse
},
515 { 2, &hf_atn_cm_cmAbortReason
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMAbortReason
},
520 dissect_atn_cm_CMAircraftMessage(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
521 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
522 ett_atn_cm_CMAircraftMessage
, CMAircraftMessage_choice
,
529 static const per_sequence_t CMLogonResponse_sequence
[] = {
530 { &hf_atn_cm_airInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
},
531 { &hf_atn_cm_groundOnlyInitiatedApplications
, ASN1_NO_EXTENSIONS
, ASN1_OPTIONAL
, dissect_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
},
536 dissect_atn_cm_CMLogonResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
537 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
538 ett_atn_cm_CMLogonResponse
, CMLogonResponse_sequence
);
546 dissect_atn_cm_CMUpdate(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
547 offset
= dissect_atn_cm_CMLogonResponse(tvb
, offset
, actx
, tree
, hf_index
);
553 static const per_sequence_t CMContactRequest_sequence
[] = {
554 { &hf_atn_cm_facilityDesignation
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_FacilityDesignation
},
555 { &hf_atn_cm_address
, ASN1_NO_EXTENSIONS
, ASN1_NOT_OPTIONAL
, dissect_atn_cm_LongTsap
},
560 dissect_atn_cm_CMContactRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
561 offset
= dissect_per_sequence(tvb
, offset
, actx
, tree
, hf_index
,
562 ett_atn_cm_CMContactRequest
, CMContactRequest_sequence
);
570 dissect_atn_cm_CMForwardRequest(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
571 offset
= dissect_atn_cm_CMLogonRequest(tvb
, offset
, actx
, tree
, hf_index
);
577 static const value_string atn_cm_CMForwardResponse_vals
[] = {
579 { 1, "incompatible-version" },
580 { 2, "service-not-supported" },
586 dissect_atn_cm_CMForwardResponse(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
587 offset
= dissect_per_enumerated(tvb
, offset
, actx
, tree
, hf_index
,
588 3, NULL
, FALSE
, 0, NULL
);
594 static const value_string atn_cm_CMGroundMessage_vals
[] = {
595 { 0, "cmLogonResponse" },
597 { 2, "cmContactRequest" },
598 { 3, "cmForwardRequest" },
599 { 4, "cmAbortReason" },
600 { 5, "cmForwardResponse" },
604 static const per_choice_t CMGroundMessage_choice
[] = {
605 { 0, &hf_atn_cm_cmLogonResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMLogonResponse
},
606 { 1, &hf_atn_cm_cmUpdate
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMUpdate
},
607 { 2, &hf_atn_cm_cmContactRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMContactRequest
},
608 { 3, &hf_atn_cm_cmForwardRequest
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMForwardRequest
},
609 { 4, &hf_atn_cm_cmAbortReason
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMAbortReason
},
610 { 5, &hf_atn_cm_cmForwardResponse
, ASN1_EXTENSION_ROOT
, dissect_atn_cm_CMForwardResponse
},
615 dissect_atn_cm_CMGroundMessage(tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
616 offset
= dissect_per_choice(tvb
, offset
, actx
, tree
, hf_index
,
617 ett_atn_cm_CMGroundMessage
, CMGroundMessage_choice
,
625 static void dissect_CMAircraftMessage_PDU(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
) {
627 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_PER
, FALSE
, pinfo
);
628 dissect_atn_cm_CMAircraftMessage(tvb
, 0, &asn1_ctx
, tree
, hf_atn_cm_CMAircraftMessage_PDU
);
630 static void dissect_CMGroundMessage_PDU(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
) {
632 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_PER
, FALSE
, pinfo
);
633 dissect_atn_cm_CMGroundMessage(tvb
, 0, &asn1_ctx
, tree
, hf_atn_cm_CMGroundMessage_PDU
);
637 /*--- End of included file: packet-atn-cm-fn.c ---*/
638 #line 72 "../../asn1/atn-cm/packet-atn-cm-template.c"
639 static int proto_atn_cm
= -1;
649 proto_item
*ti
= NULL
;
650 proto_tree
*sub_tree
= NULL
;
652 ti
= proto_tree_add_text(
656 tvb_reported_length_remaining(tvb
, 0) ,
659 sub_tree
= proto_item_add_subtree(
663 /* ti = proto_tree_add_item(tree, proto_atn_cm, tvb, 0, 0 , FALSE); */
664 /* sub_tree = proto_item_add_subtree(ti, ett_atn_cm_pdu); */
666 /* determine whether it is uplink or downlink */
667 type
= check_heur_msg_type(pinfo
);
671 dissect_CMGroundMessage_PDU(
677 dissect_CMAircraftMessage_PDU(
685 return tvb_reported_length_remaining(tvb
, 0);
695 atn_conversation_t
*atn_cv
= NULL
;
696 gboolean is_atn_cm
= FALSE
;
699 /* determine whether it is uplink or downlink */
700 type
= check_heur_msg_type(pinfo
);
702 /* heuristically decode message */
706 dissect_CMGroundMessage_PDU(
710 /* no exception thrown: looks like it is a CM PDU */
718 dissect_CMAircraftMessage_PDU(
722 /* no exception thrown: looks like it is a CM PDU */
732 if (is_atn_cm
== TRUE
) {
734 /* all subsequent PDU's belonging to this conversation are considered CM */
735 /* if the first CM PDU has been decoded succesfully */
736 /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */
738 /* DT: dstref present, srcref is always zero */
739 if((pinfo
->clnp_dstref
) &&
740 (!pinfo
->clnp_srcref
)){
742 atn_cv
= find_atn_conversation(
747 /* CR: srcref present, dstref is always zero */
748 if((!pinfo
->clnp_dstref
) &&
749 (pinfo
->clnp_srcref
)){
751 atn_cv
= find_atn_conversation(
757 /* CC: srcref and dstref present */
758 if((pinfo
->clnp_dstref
) &&
759 (pinfo
->clnp_srcref
)){
760 atn_cv
= find_atn_conversation(
766 atn_cv
->ae_qualifier
= cma
;
779 void proto_register_atn_cm (void)
781 static hf_register_info hf_atn_cm
[] = {
783 /*--- Included file: packet-atn-cm-hfarr.c ---*/
784 #line 1 "../../asn1/atn-cm/packet-atn-cm-hfarr.c"
785 { &hf_atn_cm_CMAircraftMessage_PDU
,
786 { "CMAircraftMessage", "atn-cm.CMAircraftMessage",
787 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMAircraftMessage_vals
), 0,
789 { &hf_atn_cm_CMGroundMessage_PDU
,
790 { "CMGroundMessage", "atn-cm.CMGroundMessage",
791 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMGroundMessage_vals
), 0,
793 { &hf_atn_cm_cmLogonRequest
,
794 { "cmLogonRequest", "atn-cm.cmLogonRequest_element",
795 FT_NONE
, BASE_NONE
, NULL
, 0,
797 { &hf_atn_cm_cmContactResponse
,
798 { "cmContactResponse", "atn-cm.cmContactResponse",
799 FT_UINT32
, BASE_DEC
, VALS(atn_cm_Response_vals
), 0,
801 { &hf_atn_cm_cmAbortReason
,
802 { "cmAbortReason", "atn-cm.cmAbortReason",
803 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMAbortReason_vals
), 0,
805 { &hf_atn_cm_cmLogonResponse
,
806 { "cmLogonResponse", "atn-cm.cmLogonResponse_element",
807 FT_NONE
, BASE_NONE
, NULL
, 0,
809 { &hf_atn_cm_cmUpdate
,
810 { "cmUpdate", "atn-cm.cmUpdate_element",
811 FT_NONE
, BASE_NONE
, NULL
, 0,
813 { &hf_atn_cm_cmContactRequest
,
814 { "cmContactRequest", "atn-cm.cmContactRequest_element",
815 FT_NONE
, BASE_NONE
, NULL
, 0,
817 { &hf_atn_cm_cmForwardRequest
,
818 { "cmForwardRequest", "atn-cm.cmForwardRequest_element",
819 FT_NONE
, BASE_NONE
, NULL
, 0,
821 { &hf_atn_cm_cmForwardResponse
,
822 { "cmForwardResponse", "atn-cm.cmForwardResponse",
823 FT_UINT32
, BASE_DEC
, VALS(atn_cm_CMForwardResponse_vals
), 0,
825 { &hf_atn_cm_longTsap
,
826 { "longTsap", "atn-cm.longTsap_element",
827 FT_NONE
, BASE_NONE
, NULL
, 0,
829 { &hf_atn_cm_shortTsap
,
830 { "shortTsap", "atn-cm.shortTsap_element",
831 FT_NONE
, BASE_NONE
, NULL
, 0,
833 { &hf_atn_cm_aeQualifier
,
834 { "aeQualifier", "atn-cm.aeQualifier",
835 FT_UINT32
, BASE_DEC
, NULL
, 0,
837 { &hf_atn_cm_apVersion
,
838 { "apVersion", "atn-cm.apVersion",
839 FT_UINT32
, BASE_DEC
, NULL
, 0,
840 "VersionNumber", HFILL
}},
841 { &hf_atn_cm_apAddress
,
842 { "apAddress", "atn-cm.apAddress",
843 FT_UINT32
, BASE_DEC
, VALS(atn_cm_APAddress_vals
), 0,
845 { &hf_atn_cm_facilityDesignation
,
846 { "facilityDesignation", "atn-cm.facilityDesignation",
847 FT_STRING
, BASE_NONE
, NULL
, 0,
849 { &hf_atn_cm_address
,
850 { "address", "atn-cm.address_element",
851 FT_NONE
, BASE_NONE
, NULL
, 0,
852 "LongTsap", HFILL
}},
853 { &hf_atn_cm_aircraftFlightIdentification
,
854 { "aircraftFlightIdentification", "atn-cm.aircraftFlightIdentification",
855 FT_STRING
, BASE_NONE
, NULL
, 0,
857 { &hf_atn_cm_cMLongTSAP
,
858 { "cMLongTSAP", "atn-cm.cMLongTSAP_element",
859 FT_NONE
, BASE_NONE
, NULL
, 0,
860 "LongTsap", HFILL
}},
861 { &hf_atn_cm_groundInitiatedApplications
,
862 { "groundInitiatedApplications", "atn-cm.groundInitiatedApplications",
863 FT_UINT32
, BASE_DEC
, NULL
, 0,
864 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress", HFILL
}},
865 { &hf_atn_cm_groundInitiatedApplications_item
,
866 { "AEQualifierVersionAddress", "atn-cm.AEQualifierVersionAddress_element",
867 FT_NONE
, BASE_NONE
, NULL
, 0,
869 { &hf_atn_cm_airOnlyInitiatedApplications
,
870 { "airOnlyInitiatedApplications", "atn-cm.airOnlyInitiatedApplications",
871 FT_UINT32
, BASE_DEC
, NULL
, 0,
872 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersion", HFILL
}},
873 { &hf_atn_cm_airOnlyInitiatedApplications_item
,
874 { "AEQualifierVersion", "atn-cm.AEQualifierVersion_element",
875 FT_NONE
, BASE_NONE
, NULL
, 0,
877 { &hf_atn_cm_airportDeparture
,
878 { "airportDeparture", "atn-cm.airportDeparture",
879 FT_STRING
, BASE_NONE
, NULL
, 0,
881 { &hf_atn_cm_airportDestination
,
882 { "airportDestination", "atn-cm.airportDestination",
883 FT_STRING
, BASE_NONE
, NULL
, 0,
885 { &hf_atn_cm_dateTimeDepartureETD
,
886 { "dateTimeDepartureETD", "atn-cm.dateTimeDepartureETD_element",
887 FT_NONE
, BASE_NONE
, NULL
, 0,
888 "DateTime", HFILL
}},
889 { &hf_atn_cm_airInitiatedApplications
,
890 { "airInitiatedApplications", "atn-cm.airInitiatedApplications",
891 FT_UINT32
, BASE_DEC
, NULL
, 0,
892 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress", HFILL
}},
893 { &hf_atn_cm_airInitiatedApplications_item
,
894 { "AEQualifierVersionAddress", "atn-cm.AEQualifierVersionAddress_element",
895 FT_NONE
, BASE_NONE
, NULL
, 0,
897 { &hf_atn_cm_groundOnlyInitiatedApplications
,
898 { "groundOnlyInitiatedApplications", "atn-cm.groundOnlyInitiatedApplications",
899 FT_UINT32
, BASE_DEC
, NULL
, 0,
900 "SEQUENCE_SIZE_1_256_OF_AEQualifierVersion", HFILL
}},
901 { &hf_atn_cm_groundOnlyInitiatedApplications_item
,
902 { "AEQualifierVersion", "atn-cm.AEQualifierVersion_element",
903 FT_NONE
, BASE_NONE
, NULL
, 0,
906 { "year", "atn-cm.year",
907 FT_UINT32
, BASE_DEC
, NULL
, 0,
910 { "month", "atn-cm.month",
911 FT_UINT32
, BASE_DEC
, NULL
, 0,
914 { "day", "atn-cm.day",
915 FT_UINT32
, BASE_DEC
, NULL
, 0,
918 { "date", "atn-cm.date_element",
919 FT_NONE
, BASE_NONE
, NULL
, 0,
922 { "time", "atn-cm.time_element",
923 FT_NONE
, BASE_NONE
, NULL
, 0,
926 { "rDP", "atn-cm.rDP",
927 FT_BYTES
, BASE_NONE
, NULL
, 0,
928 "OCTET_STRING_SIZE_5", HFILL
}},
930 { "aRS", "atn-cm.aRS",
931 FT_BYTES
, BASE_NONE
, NULL
, 0,
932 "OCTET_STRING_SIZE_3", HFILL
}},
933 { &hf_atn_cm_locSysNselTsel
,
934 { "locSysNselTsel", "atn-cm.locSysNselTsel",
935 FT_BYTES
, BASE_NONE
, NULL
, 0,
936 "OCTET_STRING_SIZE_10_11", HFILL
}},
938 { "hours", "atn-cm.hours",
939 FT_UINT32
, BASE_DEC
, NULL
, 0,
940 "Timehours", HFILL
}},
941 { &hf_atn_cm_minutes
,
942 { "minutes", "atn-cm.minutes",
943 FT_UINT32
, BASE_DEC
, NULL
, 0,
944 "Timeminutes", HFILL
}},
946 /*--- End of included file: packet-atn-cm-hfarr.c ---*/
947 #line 216 "../../asn1/atn-cm/packet-atn-cm-template.c"
949 static gint
*ett
[] = {
951 /*--- Included file: packet-atn-cm-ettarr.c ---*/
952 #line 1 "../../asn1/atn-cm/packet-atn-cm-ettarr.c"
953 &ett_atn_cm_CMAircraftMessage
,
954 &ett_atn_cm_CMGroundMessage
,
955 &ett_atn_cm_APAddress
,
956 &ett_atn_cm_AEQualifierVersion
,
957 &ett_atn_cm_AEQualifierVersionAddress
,
958 &ett_atn_cm_CMContactRequest
,
959 &ett_atn_cm_CMLogonRequest
,
960 &ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersionAddress
,
961 &ett_atn_cm_SEQUENCE_SIZE_1_256_OF_AEQualifierVersion
,
962 &ett_atn_cm_CMLogonResponse
,
964 &ett_atn_cm_DateTime
,
965 &ett_atn_cm_LongTsap
,
966 &ett_atn_cm_ShortTsap
,
969 /*--- End of included file: packet-atn-cm-ettarr.c ---*/
970 #line 219 "../../asn1/atn-cm/packet-atn-cm-template.c"
974 /* register CM application */
975 proto_atn_cm
= proto_register_protocol(
980 proto_register_field_array(
983 array_length(hf_atn_cm
));
985 proto_register_subtree_array(
989 new_register_dissector(
995 void proto_reg_handoff_atn_cm(void)
997 /* add session dissector to subdissector list*/
1000 dissect_atn_cm_heur
,
1005 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1010 * indent-tabs-mode: t
1013 * vi: set shiftwidth=2 tabstop=2 noexpandtab:
1014 * :indentSize=2:tabSize=2:noTabs=false: