MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-atn-cm.c
blobc1aad136a713eec33bda87ecc3b74a7d4dc05727
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-atn-cm.c */
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:
15 /* packet-atn-cm.c
16 * By Mathias Guettler <guettler@web.de>
17 * Copyright 2013
19 * $Id$
21 * Routines for ATN context management protocol packet disassembly.
22 * ATN context management allows an aircraft
23 * to log on to a ground facility.
25 * details see:
26 * http://en.wikipedia.org/wiki/CPDLC
27 * http://members.optusnet.com.au/~cjr/introduction.htm
29 * standards:
30 * http://legacy.icao.int/anb/panels/acp/repository.cfm
32 * note:
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.
56 #include "config.h"
58 #include <glib.h>
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>
66 #include <stdio.h>
67 #include <string.h>
68 #include <stdint.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"
149 static int
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,
152 2, 8, FALSE);
154 return offset;
159 static int
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,
162 5, 5, FALSE, NULL);
164 return offset;
169 static int
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,
172 3, 3, FALSE, NULL);
174 return offset;
179 static int
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);
184 return offset;
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 },
191 { NULL, 0, 0, NULL }
194 static int
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);
199 return offset;
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 },
206 { NULL, 0, 0, NULL }
209 static int
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);
214 return offset;
219 static int
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);
224 return offset;
229 static int
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);
234 return offset;
238 static const value_string atn_cm_APAddress_vals[] = {
239 { 0, "longTsap" },
240 { 1, "shortTsap" },
241 { 0, NULL }
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 },
247 { 0, NULL, 0, NULL }
250 static int
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,
254 NULL);
256 return offset;
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 },
264 { NULL, 0, 0, NULL }
267 static int
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);
272 return offset;
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 },
280 static int
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,
284 1, 256, FALSE);
286 return offset;
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 },
293 { NULL, 0, 0, NULL }
296 static int
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);
301 return offset;
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 },
309 static int
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,
313 1, 256, FALSE);
315 return offset;
320 static int
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,
323 4, 8, FALSE);
325 return offset;
330 static int
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,
333 4, 4, FALSE);
335 return offset;
340 static int
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);
345 return offset;
350 static int
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);
355 return offset;
360 static int
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);
365 return offset;
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 },
373 { NULL, 0, 0, NULL }
376 static int
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);
381 return offset;
386 static int
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);
391 return offset;
396 static int
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);
401 return offset;
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 },
408 { NULL, 0, 0, NULL }
411 static int
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);
416 return offset;
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 },
423 { NULL, 0, 0, NULL }
426 static int
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);
431 return offset;
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 },
444 { NULL, 0, 0, NULL }
447 static int
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);
452 return offset;
456 static const value_string atn_cm_Response_vals[] = {
457 { 0, "contactSuccess" },
458 { 1, "contactNotSuccessful" },
459 { 0, NULL }
463 static int
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);
468 return offset;
473 static int
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);
477 return offset;
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" },
492 { 0, NULL }
496 static int
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);
501 return offset;
505 static const value_string atn_cm_CMAircraftMessage_vals[] = {
506 { 0, "cmLogonRequest" },
507 { 1, "cmContactResponse" },
508 { 2, "cmAbortReason" },
509 { 0, NULL }
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 },
516 { 0, NULL, 0, NULL }
519 static int
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,
523 NULL);
525 return offset;
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 },
532 { NULL, 0, 0, NULL }
535 static int
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);
540 return offset;
545 static int
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);
549 return offset;
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 },
556 { NULL, 0, 0, NULL }
559 static int
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);
564 return offset;
569 static int
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);
573 return offset;
577 static const value_string atn_cm_CMForwardResponse_vals[] = {
578 { 0, "success" },
579 { 1, "incompatible-version" },
580 { 2, "service-not-supported" },
581 { 0, NULL }
585 static int
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);
590 return offset;
594 static const value_string atn_cm_CMGroundMessage_vals[] = {
595 { 0, "cmLogonResponse" },
596 { 1, "cmUpdate" },
597 { 2, "cmContactRequest" },
598 { 3, "cmForwardRequest" },
599 { 4, "cmAbortReason" },
600 { 5, "cmForwardResponse" },
601 { 0, NULL }
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 },
611 { 0, NULL, 0, NULL }
614 static int
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,
618 NULL);
620 return offset;
623 /*--- PDUs ---*/
625 static void dissect_CMAircraftMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
626 asn1_ctx_t asn1_ctx;
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_) {
631 asn1_ctx_t asn1_ctx;
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;
641 static int
642 dissect_atn_cm(
643 tvbuff_t *tvb,
644 packet_info *pinfo,
645 proto_tree *tree,
646 void *data _U_)
648 int type = no_msg;
649 proto_item *ti = NULL;
650 proto_tree *sub_tree = NULL;
652 ti = proto_tree_add_text(
653 tree,
654 tvb,
656 tvb_reported_length_remaining(tvb, 0) ,
657 ATN_CM_PROTO);
659 sub_tree = proto_item_add_subtree(
661 ett_atn_cm);
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);
669 switch(type){
670 case um:
671 dissect_CMGroundMessage_PDU(
672 tvb,
673 pinfo,
674 sub_tree);
675 break;
676 case dm:
677 dissect_CMAircraftMessage_PDU(
678 tvb,
679 pinfo,
680 sub_tree);
681 break;
682 default:
683 break;
685 return tvb_reported_length_remaining(tvb, 0);
688 static gboolean
689 dissect_atn_cm_heur(
690 tvbuff_t *tvb,
691 packet_info *pinfo,
692 proto_tree *tree,
693 void *data _U_)
695 atn_conversation_t *atn_cv = NULL;
696 gboolean is_atn_cm = FALSE;
697 int type;
699 /* determine whether it is uplink or downlink */
700 type = check_heur_msg_type(pinfo);
702 /* heuristically decode message */
703 switch(type){
704 case um:
705 TRY {
706 dissect_CMGroundMessage_PDU(
707 tvb,
708 pinfo,
709 NULL);
710 /* no exception thrown: looks like it is a CM PDU */
711 is_atn_cm = TRUE; }
712 CATCH_ALL {
713 is_atn_cm = FALSE; }
714 ENDTRY;
715 break;
716 case dm:
717 TRY {
718 dissect_CMAircraftMessage_PDU(
719 tvb,
720 pinfo,
721 NULL);
722 /* no exception thrown: looks like it is a CM PDU */
723 is_atn_cm = TRUE;}
724 CATCH_ALL {
725 is_atn_cm = FALSE; }
726 ENDTRY;
727 break;
728 default:
729 break;
732 if (is_atn_cm == TRUE) {
733 /* note: */
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(
743 &pinfo->dst,
744 pinfo->clnp_dstref,
745 &pinfo->src );
747 /* CR: srcref present, dstref is always zero */
748 if((!pinfo->clnp_dstref) &&
749 (pinfo->clnp_srcref)){
751 atn_cv = find_atn_conversation(
752 &pinfo->src,
753 pinfo->clnp_srcref,
754 &pinfo->dst );
757 /* CC: srcref and dstref present */
758 if((pinfo->clnp_dstref) &&
759 (pinfo->clnp_srcref)){
760 atn_cv = find_atn_conversation(
761 &pinfo->src,
762 pinfo->clnp_srcref,
763 &pinfo->dst );
765 if(atn_cv){
766 atn_cv->ae_qualifier = cma;
768 dissect_atn_cm(
769 tvb,
770 pinfo,
771 tree,
772 NULL);
775 return is_atn_cm;
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,
788 NULL, HFILL }},
789 { &hf_atn_cm_CMGroundMessage_PDU,
790 { "CMGroundMessage", "atn-cm.CMGroundMessage",
791 FT_UINT32, BASE_DEC, VALS(atn_cm_CMGroundMessage_vals), 0,
792 NULL, HFILL }},
793 { &hf_atn_cm_cmLogonRequest,
794 { "cmLogonRequest", "atn-cm.cmLogonRequest_element",
795 FT_NONE, BASE_NONE, NULL, 0,
796 NULL, HFILL }},
797 { &hf_atn_cm_cmContactResponse,
798 { "cmContactResponse", "atn-cm.cmContactResponse",
799 FT_UINT32, BASE_DEC, VALS(atn_cm_Response_vals), 0,
800 NULL, HFILL }},
801 { &hf_atn_cm_cmAbortReason,
802 { "cmAbortReason", "atn-cm.cmAbortReason",
803 FT_UINT32, BASE_DEC, VALS(atn_cm_CMAbortReason_vals), 0,
804 NULL, HFILL }},
805 { &hf_atn_cm_cmLogonResponse,
806 { "cmLogonResponse", "atn-cm.cmLogonResponse_element",
807 FT_NONE, BASE_NONE, NULL, 0,
808 NULL, HFILL }},
809 { &hf_atn_cm_cmUpdate,
810 { "cmUpdate", "atn-cm.cmUpdate_element",
811 FT_NONE, BASE_NONE, NULL, 0,
812 NULL, HFILL }},
813 { &hf_atn_cm_cmContactRequest,
814 { "cmContactRequest", "atn-cm.cmContactRequest_element",
815 FT_NONE, BASE_NONE, NULL, 0,
816 NULL, HFILL }},
817 { &hf_atn_cm_cmForwardRequest,
818 { "cmForwardRequest", "atn-cm.cmForwardRequest_element",
819 FT_NONE, BASE_NONE, NULL, 0,
820 NULL, HFILL }},
821 { &hf_atn_cm_cmForwardResponse,
822 { "cmForwardResponse", "atn-cm.cmForwardResponse",
823 FT_UINT32, BASE_DEC, VALS(atn_cm_CMForwardResponse_vals), 0,
824 NULL, HFILL }},
825 { &hf_atn_cm_longTsap,
826 { "longTsap", "atn-cm.longTsap_element",
827 FT_NONE, BASE_NONE, NULL, 0,
828 NULL, HFILL }},
829 { &hf_atn_cm_shortTsap,
830 { "shortTsap", "atn-cm.shortTsap_element",
831 FT_NONE, BASE_NONE, NULL, 0,
832 NULL, HFILL }},
833 { &hf_atn_cm_aeQualifier,
834 { "aeQualifier", "atn-cm.aeQualifier",
835 FT_UINT32, BASE_DEC, NULL, 0,
836 NULL, HFILL }},
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,
844 NULL, HFILL }},
845 { &hf_atn_cm_facilityDesignation,
846 { "facilityDesignation", "atn-cm.facilityDesignation",
847 FT_STRING, BASE_NONE, NULL, 0,
848 NULL, HFILL }},
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,
856 NULL, HFILL }},
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,
868 NULL, HFILL }},
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,
876 NULL, HFILL }},
877 { &hf_atn_cm_airportDeparture,
878 { "airportDeparture", "atn-cm.airportDeparture",
879 FT_STRING, BASE_NONE, NULL, 0,
880 "Airport", HFILL }},
881 { &hf_atn_cm_airportDestination,
882 { "airportDestination", "atn-cm.airportDestination",
883 FT_STRING, BASE_NONE, NULL, 0,
884 "Airport", HFILL }},
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,
896 NULL, HFILL }},
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,
904 NULL, HFILL }},
905 { &hf_atn_cm_year,
906 { "year", "atn-cm.year",
907 FT_UINT32, BASE_DEC, NULL, 0,
908 NULL, HFILL }},
909 { &hf_atn_cm_month,
910 { "month", "atn-cm.month",
911 FT_UINT32, BASE_DEC, NULL, 0,
912 NULL, HFILL }},
913 { &hf_atn_cm_day,
914 { "day", "atn-cm.day",
915 FT_UINT32, BASE_DEC, NULL, 0,
916 NULL, HFILL }},
917 { &hf_atn_cm_date,
918 { "date", "atn-cm.date_element",
919 FT_NONE, BASE_NONE, NULL, 0,
920 NULL, HFILL }},
921 { &hf_atn_cm_time,
922 { "time", "atn-cm.time_element",
923 FT_NONE, BASE_NONE, NULL, 0,
924 NULL, HFILL }},
925 { &hf_atn_cm_rDP,
926 { "rDP", "atn-cm.rDP",
927 FT_BYTES, BASE_NONE, NULL, 0,
928 "OCTET_STRING_SIZE_5", HFILL }},
929 { &hf_atn_cm_aRS,
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 }},
937 { &hf_atn_cm_hours,
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,
963 &ett_atn_cm_Date,
964 &ett_atn_cm_DateTime,
965 &ett_atn_cm_LongTsap,
966 &ett_atn_cm_ShortTsap,
967 &ett_atn_cm_Time,
969 /*--- End of included file: packet-atn-cm-ettarr.c ---*/
970 #line 219 "../../asn1/atn-cm/packet-atn-cm-template.c"
971 &ett_atn_cm
974 /* register CM application */
975 proto_atn_cm = proto_register_protocol(
976 ATN_CM_PROTO ,
977 "ATN-CM",
978 "atn-cm");
980 proto_register_field_array(
981 proto_atn_cm,
982 hf_atn_cm,
983 array_length(hf_atn_cm));
985 proto_register_subtree_array(
986 ett,
987 array_length(ett));
989 new_register_dissector(
990 "atn-cm",
991 dissect_atn_cm,
992 proto_atn_cm);
995 void proto_reg_handoff_atn_cm(void)
997 /* add session dissector to subdissector list*/
998 heur_dissector_add(
999 "atn-ulcs",
1000 dissect_atn_cm_heur,
1001 proto_atn_cm);
1005 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1007 * Local variables:
1008 * c-basic-offset: 2
1009 * tab-width: 2
1010 * indent-tabs-mode: t
1011 * End:
1013 * vi: set shiftwidth=2 tabstop=2 noexpandtab:
1014 * :indentSize=2:tabSize=2:noTabs=false: