diff options
Diffstat (limited to 'epan/dissectors/asn1/atn-cpdlc')
-rw-r--r-- | epan/dissectors/asn1/atn-cpdlc/atn-cpdlc.cnf | 24 | ||||
-rw-r--r-- | epan/dissectors/asn1/atn-cpdlc/packet-atn-cpdlc-template.c | 66 |
2 files changed, 44 insertions, 46 deletions
diff --git a/epan/dissectors/asn1/atn-cpdlc/atn-cpdlc.cnf b/epan/dissectors/asn1/atn-cpdlc/atn-cpdlc.cnf index ca700443..84878a68 100644 --- a/epan/dissectors/asn1/atn-cpdlc/atn-cpdlc.cnf +++ b/epan/dissectors/asn1/atn-cpdlc/atn-cpdlc.cnf @@ -52,7 +52,7 @@ ProtectedAircraftPDUs/startdown protectedstartDownmessage #.FN_BODY CPDLCMessage tvbuff_t *tvb_usr = NULL; - offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL, 0, &tvb_usr, NULL); + offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, false, NULL, 0, &tvb_usr, NULL); if (tvb_usr) { switch(check_heur_msg_type(actx->pinfo)){ @@ -77,47 +77,47 @@ ProtectedAircraftPDUs/startdown protectedstartDownmessage #.END #.FN_BODY AircraftFlightIdentification - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,2, 8, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,2, 8, false, ia5alpha , 127, NULL); #.END #.FN_BODY Airport - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,4, 4, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,4, 4, false, ia5alpha , 127, NULL); #.END #.FN_BODY FacilityDesignation - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,4, 8, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,4, 8, false, ia5alpha , 127, NULL); #.END #.FN_BODY FreeText - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 256, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 256, false, ia5alpha , 127, NULL); #.END #.FN_BODY NavaidName - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 4, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 4, false, ia5alpha , 127, NULL); #.END #.FN_BODY Procedure - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 20, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 20, false, ia5alpha , 127, NULL); #.END #.FN_BODY ProcedureTransition - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 5, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 5, false, ia5alpha , 127, NULL); #.END #.FN_BODY Fix - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 5, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 5, false, ia5alpha , 127, NULL); #.END #.FN_BODY ATISCode - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 1, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,1, 1, false, ia5alpha , 127, NULL); #.END #.FN_BODY ATSRouteDesignator - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,2, 7, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,2, 7, false, ia5alpha , 127, NULL); #.END #.FN_BODY FacilityName - offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,3, 18, FALSE, ia5alpha , 127, NULL); + offset = dissect_per_restricted_character_string(tvb, offset, actx, tree, hf_index,3, 18, false, ia5alpha , 127, NULL); #.END # diff --git a/epan/dissectors/asn1/atn-cpdlc/packet-atn-cpdlc-template.c b/epan/dissectors/asn1/atn-cpdlc/packet-atn-cpdlc-template.c index 0e8bca4d..4ebd4a25 100644 --- a/epan/dissectors/asn1/atn-cpdlc/packet-atn-cpdlc-template.c +++ b/epan/dissectors/asn1/atn-cpdlc/packet-atn-cpdlc-template.c @@ -3,18 +3,15 @@ * Copyright 2013 * * Routines for ATN Cpdlcc protocol packet disassembly - + * * details see: - * http://en.wikipedia.org/wiki/CPDLC - * http://members.optusnet.com.au/~cjr/introduction.htm - + * https://en.wikipedia.org/wiki/CPDLC + * https://members.optusnet.com.au/~cjr/introduction.htm + * * standards: - * http://legacy.icao.int/anb/panels/acp/repository.cfm - - * note: - * We are dealing with ATN/CPDLC aka ICAO Doc 9705 Ed2 here + * We are dealing with ATN/CPDLC aka ICAO Doc 9705 Second Edition here * (CPDLC may also be transmitted via ACARS/AOA aka "FANS-1/A "). - + * https://www.icao.int/safety/acp/repository/_%20Doc9705_ed2_1999.pdf * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -35,6 +32,7 @@ #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/conversation.h> +#include <wsutil/array.h> #include "packet-ber.h" #include "packet-per.h" #include "packet-atn-ulcs.h" @@ -47,7 +45,7 @@ void proto_reg_handoff_atn_cpdlc(void); static const char *object_identifier_id; /* IA5 charset (7-bit) for PER IA5 decoding */ -static const gchar ia5alpha[] = { +static const char ia5alpha[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, \ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, \ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, \ @@ -84,12 +82,12 @@ static int dissect_ProtectedAircraftPDUs_PDU( #include "packet-atn-cpdlc-hf.c" #include "packet-atn-cpdlc-ett.c" -static gint ett_atn_cpdlc = -1; +static int ett_atn_cpdlc; #include "packet-atn-cpdlc-fn.c" /* Wireshark ID of CPDLC protocol */ -static int proto_atn_cpdlc = -1; +static int proto_atn_cpdlc; static int @@ -195,7 +193,7 @@ dissect_atn_cpdlc( return tvb_reported_length_remaining(tvb, 0); } -static gboolean +static bool dissect_atn_cpdlc_heur( tvbuff_t *tvb, packet_info *pinfo, @@ -203,8 +201,8 @@ dissect_atn_cpdlc_heur( void *data _U_) { atn_conversation_t *volatile atn_cv = NULL; - volatile gboolean is_atn_cpdlc = FALSE; - volatile gboolean is_pm = FALSE; + volatile bool is_atn_cpdlc = false; + volatile bool is_pm = false; int type; type = check_heur_msg_type(pinfo); @@ -213,43 +211,43 @@ dissect_atn_cpdlc_heur( case um: TRY { dissect_ProtectedGroundPDUs_PDU(tvb, pinfo, NULL, NULL); - is_atn_cpdlc = TRUE; - is_pm = TRUE;} + is_atn_cpdlc = true; + is_pm = true;} CATCH_ALL{ - is_atn_cpdlc = FALSE; - is_pm = FALSE;} + is_atn_cpdlc = false; + is_pm = false;} ENDTRY; if (is_atn_cpdlc) { break; } TRY { dissect_GroundPDUs_PDU(tvb, pinfo, NULL, NULL); - is_pm = FALSE; - is_atn_cpdlc = TRUE;} + is_pm = false; + is_atn_cpdlc = true;} CATCH_ALL{ - is_atn_cpdlc = FALSE; - is_pm = FALSE;} + is_atn_cpdlc = false; + is_pm = false;} ENDTRY; break; case dm: TRY { dissect_ProtectedAircraftPDUs_PDU(tvb, pinfo, NULL, NULL); - is_atn_cpdlc = TRUE; - is_pm = TRUE;} + is_atn_cpdlc = true; + is_pm = true;} CATCH_ALL { - is_atn_cpdlc = FALSE; - is_pm = FALSE; } + is_atn_cpdlc = false; + is_pm = false; } ENDTRY; if (is_atn_cpdlc) { break; } TRY{ dissect_AircraftPDUs_PDU(tvb, pinfo, NULL, NULL); - is_atn_cpdlc = TRUE; - is_pm = FALSE;} + is_atn_cpdlc = true; + is_pm = false;} CATCH_ALL{ - is_atn_cpdlc = FALSE; - is_pm = FALSE;} + is_atn_cpdlc = false; + is_pm = false;} ENDTRY; break; default: @@ -283,14 +281,14 @@ dissect_atn_cpdlc_heur( } if(atn_cv){ /* atn conversation found */ - if(is_pm == TRUE) { + if(is_pm == true) { atn_cv->ae_qualifier = pmcpdlc; } else { atn_cv->ae_qualifier = cpdlc; } dissect_atn_cpdlc(tvb, pinfo, tree, NULL); } }else { /* there should *always* be an atn conversation */ - is_atn_cpdlc = FALSE; + is_atn_cpdlc = false; } return is_atn_cpdlc; @@ -304,7 +302,7 @@ void proto_register_atn_cpdlc (void) #include "packet-atn-cpdlc-hfarr.c" }; - static gint *ett[] = { + static int *ett[] = { #include "packet-atn-cpdlc-ettarr.c" &ett_atn_cpdlc }; |