diff options
author | Bill Meier <wmeier@newsguy.com> | 2015-08-09 12:20:54 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2015-08-09 16:30:05 +0000 |
commit | c5af152628f84cfddfa3d872d8be5b58d9a0ae03 (patch) | |
tree | bc0337c7da51eb15f30951497138e1bdebdad32d /epan/dissectors | |
parent | dbf314a4ab3e005bc9650d69f47fb44aa446fb58 (diff) |
Trivial: Convert 'tabs' indentation to '4 space' indentation
Change-Id: If71dd8a04050ce11e37ad88ee862419313c06639
Reviewed-on: https://code.wireshark.org/review/9946
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-atn-cm.c | 315 | ||||
-rw-r--r-- | epan/dissectors/packet-atn-cpdlc.c | 560 | ||||
-rw-r--r-- | epan/dissectors/packet-atn-ulcs.c | 2095 | ||||
-rw-r--r-- | epan/dissectors/packet-atn-ulcs.h | 83 |
4 files changed, 1515 insertions, 1538 deletions
diff --git a/epan/dissectors/packet-atn-cm.c b/epan/dissectors/packet-atn-cm.c index 9a6f714479..00924be4d5 100644 --- a/epan/dissectors/packet-atn-cm.c +++ b/epan/dissectors/packet-atn-cm.c @@ -6,12 +6,6 @@ /* Input file: packet-atn-cm-template.c */ #line 1 "../../asn1/atn-cm/packet-atn-cm-template.c" -/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: t - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: - */ - - /* packet-atn-cm.c * By Mathias Guettler <guettler@web.de> * Copyright 2013 @@ -110,7 +104,7 @@ static int hf_atn_cm_hours = -1; /* Timehours */ static int hf_atn_cm_minutes = -1; /* Timeminutes */ /*--- End of included file: packet-atn-cm-hf.c ---*/ -#line 61 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 55 "../../asn1/atn-cm/packet-atn-cm-template.c" /*--- Included file: packet-atn-cm-ett.c ---*/ @@ -132,7 +126,7 @@ static gint ett_atn_cm_ShortTsap = -1; static gint ett_atn_cm_Time = -1; /*--- End of included file: packet-atn-cm-ett.c ---*/ -#line 63 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 57 "../../asn1/atn-cm/packet-atn-cm-template.c" static gint ett_atn_cm = -1; @@ -635,135 +629,135 @@ static int dissect_CMGroundMessage_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_ /*--- End of included file: packet-atn-cm-fn.c ---*/ -#line 66 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 60 "../../asn1/atn-cm/packet-atn-cm-template.c" static int proto_atn_cm = -1; static int dissect_atn_cm( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - int type; - proto_tree *sub_tree; - - sub_tree = proto_tree_add_subtree( - tree, tvb, 0, -1, ett_atn_cm, NULL, ATN_CM_PROTO); - - /* ti = proto_tree_add_item(tree, proto_atn_cm, tvb, 0, 0 , ENC_NA); */ - /* sub_tree = proto_item_add_subtree(ti, ett_atn_cm_pdu); */ - - /* determine whether it is uplink or downlink */ - type = check_heur_msg_type(pinfo); - - switch(type){ - case um: - dissect_CMGroundMessage_PDU( - tvb, - pinfo, - sub_tree, NULL); - break; - case dm: - dissect_CMAircraftMessage_PDU( - tvb, - pinfo, - sub_tree, NULL); - break; - default: - break; - } - return tvb_reported_length_remaining(tvb, 0); + int type; + proto_tree *sub_tree; + + sub_tree = proto_tree_add_subtree( + tree, tvb, 0, -1, ett_atn_cm, NULL, ATN_CM_PROTO); + + /* ti = proto_tree_add_item(tree, proto_atn_cm, tvb, 0, 0 , ENC_NA); */ + /* sub_tree = proto_item_add_subtree(ti, ett_atn_cm_pdu); */ + + /* determine whether it is uplink or downlink */ + type = check_heur_msg_type(pinfo); + + switch(type){ + case um: + dissect_CMGroundMessage_PDU( + tvb, + pinfo, + sub_tree, NULL); + break; + case dm: + dissect_CMAircraftMessage_PDU( + tvb, + pinfo, + sub_tree, NULL); + break; + default: + break; + } + return tvb_reported_length_remaining(tvb, 0); } static gboolean dissect_atn_cm_heur( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - atn_conversation_t *atn_cv = NULL; - volatile gboolean is_atn_cm = FALSE; - int type; - - /* determine whether it is uplink or downlink */ - type = check_heur_msg_type(pinfo); - - /* heuristically decode message */ - switch(type){ - case um: - TRY { - dissect_CMGroundMessage_PDU( - tvb, - pinfo, - NULL, NULL); - /* no exception thrown: looks like it is a CM PDU */ - is_atn_cm = TRUE; } - CATCH_ALL { - is_atn_cm = FALSE; } - ENDTRY; - break; - case dm: - TRY { - dissect_CMAircraftMessage_PDU( - tvb, - pinfo, - NULL, NULL); - /* no exception thrown: looks like it is a CM PDU */ - is_atn_cm = TRUE;} - CATCH_ALL { - is_atn_cm = FALSE; } - ENDTRY; - break; - default: - break; - } - - if (is_atn_cm == TRUE) { - /* note: */ - /* all subsequent PDU's belonging to this conversation are considered CM */ - /* if the first CM PDU has been decoded succesfully */ - /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */ - - /* DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && - (!pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - } - /* CR: srcref present, dstref is always zero */ - if((!pinfo->clnp_dstref) && - (pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - - } - /* CC: srcref and dstref present */ - if((pinfo->clnp_dstref) && - (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - if(atn_cv){ - atn_cv->ae_qualifier = cma; - } - dissect_atn_cm( - tvb, - pinfo, - tree, - NULL); - } - - return is_atn_cm; + atn_conversation_t *atn_cv = NULL; + volatile gboolean is_atn_cm = FALSE; + int type; + + /* determine whether it is uplink or downlink */ + type = check_heur_msg_type(pinfo); + + /* heuristically decode message */ + switch(type){ + case um: + TRY { + dissect_CMGroundMessage_PDU( + tvb, + pinfo, + NULL, NULL); + /* no exception thrown: looks like it is a CM PDU */ + is_atn_cm = TRUE; } + CATCH_ALL { + is_atn_cm = FALSE; } + ENDTRY; + break; + case dm: + TRY { + dissect_CMAircraftMessage_PDU( + tvb, + pinfo, + NULL, NULL); + /* no exception thrown: looks like it is a CM PDU */ + is_atn_cm = TRUE;} + CATCH_ALL { + is_atn_cm = FALSE; } + ENDTRY; + break; + default: + break; + } + + if (is_atn_cm == TRUE) { + /* note: */ + /* all subsequent PDU's belonging to this conversation are considered CM */ + /* if the first CM PDU has been decoded succesfully */ + /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */ + + /* DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && + (!pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + } + /* CR: srcref present, dstref is always zero */ + if((!pinfo->clnp_dstref) && + (pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + + } + /* CC: srcref and dstref present */ + if((pinfo->clnp_dstref) && + (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + if(atn_cv){ + atn_cv->ae_qualifier = cma; + } + dissect_atn_cm( + tvb, + pinfo, + tree, + NULL); + } + + return is_atn_cm; } @@ -935,9 +929,9 @@ void proto_register_atn_cm (void) "Timeminutes", HFILL }}, /*--- End of included file: packet-atn-cm-hfarr.c ---*/ -#line 201 "../../asn1/atn-cm/packet-atn-cm-template.c" +#line 195 "../../asn1/atn-cm/packet-atn-cm-template.c" }; - static gint *ett[] = { + static gint *ett[] = { /*--- Included file: packet-atn-cm-ettarr.c ---*/ #line 1 "../../asn1/atn-cm/packet-atn-cm-ettarr.c" @@ -958,52 +952,51 @@ void proto_register_atn_cm (void) &ett_atn_cm_Time, /*--- End of included file: packet-atn-cm-ettarr.c ---*/ -#line 204 "../../asn1/atn-cm/packet-atn-cm-template.c" - &ett_atn_cm - }; +#line 198 "../../asn1/atn-cm/packet-atn-cm-template.c" + &ett_atn_cm + }; - /* register CM application */ - proto_atn_cm = proto_register_protocol( - ATN_CM_PROTO , - "ATN-CM", - "atn-cm"); + /* register CM application */ + proto_atn_cm = proto_register_protocol( + ATN_CM_PROTO , + "ATN-CM", + "atn-cm"); - proto_register_field_array( - proto_atn_cm, - hf_atn_cm, - array_length(hf_atn_cm)); + proto_register_field_array( + proto_atn_cm, + hf_atn_cm, + array_length(hf_atn_cm)); - proto_register_subtree_array( - ett, - array_length(ett)); + proto_register_subtree_array( + ett, + array_length(ett)); - new_register_dissector( - "atn-cm", - dissect_atn_cm, - proto_atn_cm); + new_register_dissector( + "atn-cm", + dissect_atn_cm, + proto_atn_cm); } void proto_reg_handoff_atn_cm(void) { - /* add session dissector to subdissector list*/ - heur_dissector_add( - "atn-ulcs", - dissect_atn_cm_heur, - "ATN-CM over ATN-ULCS", - "atn-cm-ulcs", - proto_atn_cm, HEURISTIC_ENABLE); + /* add session dissector to subdissector list*/ + heur_dissector_add( + "atn-ulcs", + dissect_atn_cm_heur, + "ATN-CM over ATN-ULCS", + "atn-cm-ulcs", + proto_atn_cm, HEURISTIC_ENABLE); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: - * c-basic-offset: 2 - * tab-width: 2 - * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ - diff --git a/epan/dissectors/packet-atn-cpdlc.c b/epan/dissectors/packet-atn-cpdlc.c index a66aa3c55c..9faf8e50af 100644 --- a/epan/dissectors/packet-atn-cpdlc.c +++ b/epan/dissectors/packet-atn-cpdlc.c @@ -6,11 +6,6 @@ /* Input file: packet-atn-cpdlc-template.c */ #line 1 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" -/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: t - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: - */ - /* packet-atn-cpdlc-template.c * By Mathias Guettler <guettler@web.de> * Copyright 2013 @@ -50,9 +45,9 @@ /* developper comments: - Which CPDLC messages are supported ? - Protected Mode CPDLC (AeQualifier 22) and Plain Old CPDLC (AeQualifier 2) - The dissector has been tested with ICAO doc9705 Edition2 compliant traffic. + Which CPDLC messages are supported ? + Protected Mode CPDLC (AeQualifier 22) and Plain Old CPDLC (AeQualifier 2) + The dissector has been tested with ICAO doc9705 Edition2 compliant traffic. */ #include "config.h" @@ -73,25 +68,25 @@ static const char *object_identifier_id; /* forward declarations */ static int dissect_GroundPDUs_PDU( - tvbuff_t *tvb _U_, - packet_info *pinfo _U_, - proto_tree *tree _U_, - void *data _U_); + tvbuff_t *tvb _U_, + packet_info *pinfo _U_, + proto_tree *tree _U_, + void *data _U_); static int dissect_AircraftPDUs_PDU( - tvbuff_t *tvb _U_, - packet_info *pinfo _U_, - proto_tree *tree _U_, - void *data _U_); + tvbuff_t *tvb _U_, + packet_info *pinfo _U_, + proto_tree *tree _U_, + void *data _U_); static int dissect_ProtectedGroundPDUs_PDU( - tvbuff_t *tvb _U_, - packet_info *pinfo _U_, - proto_tree *tree _U_, - void *data _U_); + tvbuff_t *tvb _U_, + packet_info *pinfo _U_, + proto_tree *tree _U_, + void *data _U_); static int dissect_ProtectedAircraftPDUs_PDU( - tvbuff_t *tvb _U_, - packet_info *pinfo _U_, - proto_tree *tree _U_, - void *data _U_); + tvbuff_t *tvb _U_, + packet_info *pinfo _U_, + proto_tree *tree _U_, + void *data _U_); /*--- Included file: packet-atn-cpdlc-hf.c ---*/ @@ -699,7 +694,7 @@ static int hf_atn_cpdlc_windSpeedEnglish = -1; /* WindSpeedEnglish */ static int hf_atn_cpdlc_windSpeedMetric = -1; /* WindSpeedMetric */ /*--- End of included file: packet-atn-cpdlc-hf.c ---*/ -#line 89 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" +#line 84 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" /*--- Included file: packet-atn-cpdlc-ett.c ---*/ @@ -848,7 +843,7 @@ static gint ett_atn_cpdlc_Winds = -1; static gint ett_atn_cpdlc_WindSpeed = -1; /*--- End of included file: packet-atn-cpdlc-ett.c ---*/ -#line 91 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" +#line 86 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" static gint ett_atn_cpdlc = -1; @@ -1186,7 +1181,7 @@ dissect_atn_cpdlc_Level(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_atn_cpdlc_Fix(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -1467,7 +1462,7 @@ dissect_atn_cpdlc_FixName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U static int dissect_atn_cpdlc_NavaidName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -1491,7 +1486,7 @@ dissect_atn_cpdlc_Navaid(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_ static int dissect_atn_cpdlc_Airport(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2116,7 +2111,7 @@ dissect_atn_cpdlc_TimeDistanceSpecifiedDirection(tvbuff_t *tvb _U_, int offset _ static int dissect_atn_cpdlc_AircraftFlightIdentification(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2154,7 +2149,7 @@ dissect_atn_cpdlc_PlaceBearingPlaceBearing(tvbuff_t *tvb _U_, int offset _U_, as static int dissect_atn_cpdlc_ATSRouteDesignator(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2208,7 +2203,7 @@ dissect_atn_cpdlc_ProcedureType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a static int dissect_atn_cpdlc_Procedure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2217,7 +2212,7 @@ dissect_atn_cpdlc_Procedure(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_atn_cpdlc_ProcedureTransition(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2344,7 +2339,7 @@ dissect_atn_cpdlc_Code(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_atn_cpdlc_FacilityDesignation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2353,7 +2348,7 @@ dissect_atn_cpdlc_FacilityDesignation(tvbuff_t *tvb _U_, int offset _U_, asn1_ct static int dissect_atn_cpdlc_FacilityName(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -2594,7 +2589,7 @@ dissect_atn_cpdlc_RevisionNumber(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t * static int dissect_atn_cpdlc_ATISCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -3050,7 +3045,7 @@ dissect_atn_cpdlc_TrafficType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act static int dissect_atn_cpdlc_FreeText(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - 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); return offset; } @@ -5110,9 +5105,9 @@ dissect_atn_cpdlc_PMCPDLCProviderAbortReason(tvbuff_t *tvb _U_, int offset _U_, static int dissect_atn_cpdlc_AlgorithmIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - proto_tree *top_tree=NULL; + proto_tree *top_tree=NULL; - offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, top_tree, NULL); return offset; @@ -5122,22 +5117,22 @@ dissect_atn_cpdlc_AlgorithmIdentifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ct static int dissect_atn_cpdlc_CPDLCMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - tvbuff_t *tvb_usr = NULL; + tvbuff_t *tvb_usr = NULL; - offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &tvb_usr, NULL); + offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &tvb_usr, NULL); - if (tvb_usr) { - switch(check_heur_msg_type(actx->pinfo)){ - case dm: - dissect_atn_cpdlc_ATCDownlinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx, tree, hf_index); - break; - case um: - dissect_atn_cpdlc_ATCUplinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx , tree, hf_index); - break; - default: - break; - } - } + if (tvb_usr) { + switch(check_heur_msg_type(actx->pinfo)){ + case dm: + dissect_atn_cpdlc_ATCDownlinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx, tree, hf_index); + break; + case um: + dissect_atn_cpdlc_ATCUplinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx , tree, hf_index); + break; + default: + break; + } + } return offset; @@ -5299,7 +5294,7 @@ static int dissect_ProtectedAircraftPDUs_PDU(tvbuff_t *tvb _U_, packet_info *pin /*--- End of included file: packet-atn-cpdlc-fn.c ---*/ -#line 94 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" +#line 89 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" /* Wireshark ID of CPDLC protocol */ static int proto_atn_cpdlc = -1; @@ -5307,206 +5302,206 @@ static int proto_atn_cpdlc = -1; static int dissect_atn_cpdlc( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - /* note: */ - /* there are two co-existing applications of CPDLC: */ - /* "plain old" (ae-qualifier 2) and */ - /* "protected mode" (ae-qualifier 22) CPDLC. */ - /* "protected mode" was introduced to cope with a */ - /* safety issue in which a message would sent to the wrong aircraft. */ - - /* note:*/ - /* The protection is an additional checksum and covers the message content, */ - /* the 24-bit address of the aircraft, the current flight id and */ - /* the current ground facility so that an aircraft would be able to reject */ - /* messages which are unexpected (i.e. messages to another flight or */ - /* messages from the wrong center). */ - - /*note:*/ - /* although "plain old" CPDLC is more or less deprecated */ - /* many aircraft cannot perform */ - /* "protected mode" for this largely depends on */ - /* upgraded avionics packages */ - - /*note:*/ - /* The use of CPDLC is *optional* as the pilot */ - /* may always use a voice radio channel to talk to the controller.*/ - - proto_tree *atn_cpdlc_tree = NULL; - atn_conversation_t *atn_cv = NULL; - - /* note: */ - /* we need the ae qualifier stored within the conversation */ - /* to decode "plain old cpdlc" or */ - /* "protected mode cpdlc correctly " */ - - /* DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - } - /* CR: srcref present, dstref is always zero */ - if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - /* CC: srcref and dstref present, always use src/srcref & dst */ - if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - - if(!atn_cv){ /* atn conversation not found */ - return 0; } - - atn_cpdlc_tree = proto_tree_add_subtree( - tree, tvb, 0, -1, ett_atn_cpdlc, NULL, - ATN_CPDLC_PROTO ); - - switch(atn_cv->ae_qualifier){ - case pmcpdlc: - if( check_heur_msg_type(pinfo) == um ) { - /* uplink PDU's = Ground PDU's */ - dissect_ProtectedGroundPDUs_PDU( - tvb, - pinfo, - atn_cpdlc_tree, NULL); - }else { /* downlink PDU's = Aircraft PDU's */ - dissect_ProtectedAircraftPDUs_PDU( - tvb, - pinfo, - atn_cpdlc_tree, NULL); - } - break; - case cpdlc: - if( check_heur_msg_type(pinfo) == um ) { - /* uplink PDU's = Ground PDU's */ - dissect_GroundPDUs_PDU( - tvb, - pinfo, - atn_cpdlc_tree, NULL); - }else { /* downlink PDU's = Aircraft PDU's */ - dissect_AircraftPDUs_PDU( - tvb, - pinfo, - atn_cpdlc_tree, NULL); - } - break; - default: - break; - } - return tvb_reported_length_remaining(tvb, 0); + /* note: */ + /* there are two co-existing applications of CPDLC: */ + /* "plain old" (ae-qualifier 2) and */ + /* "protected mode" (ae-qualifier 22) CPDLC. */ + /* "protected mode" was introduced to cope with a */ + /* safety issue in which a message would sent to the wrong aircraft. */ + + /* note:*/ + /* The protection is an additional checksum and covers the message content, */ + /* the 24-bit address of the aircraft, the current flight id and */ + /* the current ground facility so that an aircraft would be able to reject */ + /* messages which are unexpected (i.e. messages to another flight or */ + /* messages from the wrong center). */ + + /*note:*/ + /* although "plain old" CPDLC is more or less deprecated */ + /* many aircraft cannot perform */ + /* "protected mode" for this largely depends on */ + /* upgraded avionics packages */ + + /*note:*/ + /* The use of CPDLC is *optional* as the pilot */ + /* may always use a voice radio channel to talk to the controller.*/ + + proto_tree *atn_cpdlc_tree = NULL; + atn_conversation_t *atn_cv = NULL; + + /* note: */ + /* we need the ae qualifier stored within the conversation */ + /* to decode "plain old cpdlc" or */ + /* "protected mode cpdlc correctly " */ + + /* DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + } + /* CR: srcref present, dstref is always zero */ + if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + /* CC: srcref and dstref present, always use src/srcref & dst */ + if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + + if(!atn_cv){ /* atn conversation not found */ + return 0; } + + atn_cpdlc_tree = proto_tree_add_subtree( + tree, tvb, 0, -1, ett_atn_cpdlc, NULL, + ATN_CPDLC_PROTO ); + + switch(atn_cv->ae_qualifier){ + case pmcpdlc: + if( check_heur_msg_type(pinfo) == um ) { + /* uplink PDU's = Ground PDU's */ + dissect_ProtectedGroundPDUs_PDU( + tvb, + pinfo, + atn_cpdlc_tree, NULL); + }else { /* downlink PDU's = Aircraft PDU's */ + dissect_ProtectedAircraftPDUs_PDU( + tvb, + pinfo, + atn_cpdlc_tree, NULL); + } + break; + case cpdlc: + if( check_heur_msg_type(pinfo) == um ) { + /* uplink PDU's = Ground PDU's */ + dissect_GroundPDUs_PDU( + tvb, + pinfo, + atn_cpdlc_tree, NULL); + }else { /* downlink PDU's = Aircraft PDU's */ + dissect_AircraftPDUs_PDU( + tvb, + pinfo, + atn_cpdlc_tree, NULL); + } + break; + default: + break; + } + return tvb_reported_length_remaining(tvb, 0); } static gboolean dissect_atn_cpdlc_heur( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - atn_conversation_t *atn_cv = NULL; - volatile gboolean is_atn_cpdlc = FALSE; - volatile gboolean is_pm = FALSE; - int type; - - type = check_heur_msg_type(pinfo); - - switch(type){ - case um: - TRY { - dissect_ProtectedGroundPDUs_PDU(tvb, pinfo, NULL, NULL); - is_atn_cpdlc = TRUE; - is_pm = TRUE;} - CATCH_ALL{ - 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;} - CATCH_ALL{ - 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;} - CATCH_ALL { - 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;} - CATCH_ALL{ - is_atn_cpdlc = FALSE; - is_pm = FALSE;} - ENDTRY; - break; - default: - break; - } - - if(is_atn_cpdlc){ - /* note: */ - /* all subsequent PDU's belonging to this conversation */ - /* are considered CPDLC */ - /* if the first CPDLC PDU has been decoded succesfully */ - /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */ - - /* DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - } - /* CR: srcref present, dstref is always zero */ - if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - /* CC: srcref and dstref present, always use src/srcref & dst */ - if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - - if(atn_cv){ /* atn conversation found */ - 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; - } - - return is_atn_cpdlc; + atn_conversation_t *atn_cv = NULL; + volatile gboolean is_atn_cpdlc = FALSE; + volatile gboolean is_pm = FALSE; + int type; + + type = check_heur_msg_type(pinfo); + + switch(type){ + case um: + TRY { + dissect_ProtectedGroundPDUs_PDU(tvb, pinfo, NULL, NULL); + is_atn_cpdlc = TRUE; + is_pm = TRUE;} + CATCH_ALL{ + 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;} + CATCH_ALL{ + 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;} + CATCH_ALL { + 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;} + CATCH_ALL{ + is_atn_cpdlc = FALSE; + is_pm = FALSE;} + ENDTRY; + break; + default: + break; + } + + if(is_atn_cpdlc){ + /* note: */ + /* all subsequent PDU's belonging to this conversation */ + /* are considered CPDLC */ + /* if the first CPDLC PDU has been decoded succesfully */ + /* (This is done in "atn-ulcs" by using "call_dissector_with_data()") */ + + /* DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + } + /* CR: srcref present, dstref is always zero */ + if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + /* CC: srcref and dstref present, always use src/srcref & dst */ + if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + + if(atn_cv){ /* atn conversation found */ + 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; + } + + return is_atn_cpdlc; } @@ -7923,10 +7918,10 @@ void proto_register_atn_cpdlc (void) NULL, HFILL }}, /*--- End of included file: packet-atn-cpdlc-hfarr.c ---*/ -#line 309 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" - }; +#line 304 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" + }; - static gint *ett[] = { + static gint *ett[] = { /*--- Included file: packet-atn-cpdlc-ettarr.c ---*/ #line 1 "../../asn1/atn-cpdlc/packet-atn-cpdlc-ettarr.c" @@ -8074,52 +8069,51 @@ void proto_register_atn_cpdlc (void) &ett_atn_cpdlc_WindSpeed, /*--- End of included file: packet-atn-cpdlc-ettarr.c ---*/ -#line 313 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" - &ett_atn_cpdlc - }; +#line 308 "../../asn1/atn-cpdlc/packet-atn-cpdlc-template.c" + &ett_atn_cpdlc + }; - /* register CPDLC */ - proto_atn_cpdlc = proto_register_protocol( - ATN_CPDLC_PROTO , - "ATN-CPDLC", - "atn-cpdlc"); + /* register CPDLC */ + proto_atn_cpdlc = proto_register_protocol( + ATN_CPDLC_PROTO , + "ATN-CPDLC", + "atn-cpdlc"); - proto_register_field_array( - proto_atn_cpdlc, - hf_atn_cpdlc, - array_length(hf_atn_cpdlc)); + proto_register_field_array( + proto_atn_cpdlc, + hf_atn_cpdlc, + array_length(hf_atn_cpdlc)); - proto_register_subtree_array( - ett, - array_length(ett)); + proto_register_subtree_array( + ett, + array_length(ett)); - new_register_dissector( - "atn-cpdlc", - dissect_atn_cpdlc, - proto_atn_cpdlc); + new_register_dissector( + "atn-cpdlc", + dissect_atn_cpdlc, + proto_atn_cpdlc); } void proto_reg_handoff_atn_cpdlc(void) { - /* add session dissector to atn dissector list dissector list*/ - heur_dissector_add( - "atn-ulcs", - dissect_atn_cpdlc_heur, - "ATN-CPDLC over ATN-ULCS", - "atn-cpdlc-ulcs", - proto_atn_cpdlc, HEURISTIC_ENABLE); + /* add session dissector to atn dissector list dissector list*/ + heur_dissector_add( + "atn-ulcs", + dissect_atn_cpdlc_heur, + "ATN-CPDLC over ATN-ULCS", + "atn-cpdlc-ulcs", + proto_atn_cpdlc, HEURISTIC_ENABLE); } - /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: - * c-basic-offset: 2 - * tab-width: 2 - * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-atn-ulcs.c b/epan/dissectors/packet-atn-ulcs.c index 201cebb585..c67c18c0e0 100644 --- a/epan/dissectors/packet-atn-ulcs.c +++ b/epan/dissectors/packet-atn-ulcs.c @@ -6,11 +6,6 @@ /* Input file: packet-atn-ulcs-template.c */ #line 1 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" -/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: t - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: - */ - /* packet-atn-ulcs.c * By Mathias Guettler <guettler@web.de> * Copyright 2013 @@ -59,63 +54,63 @@ */ /* - developper comments: + developer comments: why not using existing ses, pres and acse dissectors ? - ATN upper layers are derived from OSI standards for session, - presentation and application but the encoding differs - (it's PER instead of BER encoding to save bandwith). - Session and presentation use the "null" encoding option, - meaning that they are only present at connection establishment - and ommitted otherwise. - Instead of adapting existing dissectors it seemed simpler and cleaner - to implement everything the new atn-ulcs dissector. + ATN upper layers are derived from OSI standards for session, + presentation and application but the encoding differs + (it's PER instead of BER encoding to save bandwith). + Session and presentation use the "null" encoding option, + meaning that they are only present at connection establishment + and ommitted otherwise. + Instead of adapting existing dissectors it seemed simpler and cleaner + to implement everything the new atn-ulcs dissector. why using conversations ? - PER encoded user data is ambigous; the same encoding may apply to a CM or - CPDLC PDU. The workaround is to decode on a transport connection basis. - I use my own version of conversations to identify - the transport connection the PDU belongs to for the standard functions - from "conversation.h" didn't work out. + PER encoded user data is ambigous; the same encoding may apply to a CM or + CPDLC PDU. The workaround is to decode on a transport connection basis. + I use my own version of conversations to identify + the transport connection the PDU belongs to for the standard functions + from "conversation.h" didn't work out. what is the use of AARQ/AARE data ? - Converstions should be maintained on the COTP layer in a standard way - for there are usually more packets available than in the layers above. - In the worst case my dissector is called from a DT packet which - has destination references but no source reference. - I have to guess the reference used the other way round - (curently I am using ACSE PDU'S used during OSI connection establishment for that). - The idea is that each ACSE AARQ is answered by ACSE AARE and having this sequence - I have all the source/destination references for this transport connection. - I use AARQ/AARE data to store the source/destination reference of AARQ as well - as the optional ae-qualifier which tells me the application and - the dissector I have to use. - This approach donesn't work well when there are interleaving AARQ/AARE sequences for - the same aircraft. + Converstions should be maintained on the COTP layer in a standard way + for there are usually more packets available than in the layers above. + In the worst case my dissector is called from a DT packet which + has destination references but no source reference. + I have to guess the reference used the other way round + (curently I am using ACSE PDU'S used during OSI connection establishment for that). + The idea is that each ACSE AARQ is answered by ACSE AARE and having this sequence + I have all the source/destination references for this transport connection. + I use AARQ/AARE data to store the source/destination reference of AARQ as well + as the optional ae-qualifier which tells me the application and + the dissector I have to use. + This approach donesn't work well when there are interleaving AARQ/AARE sequences for + the same aircraft. which ATN standard is supported ? - The dissector has been tested with ICAO doc9705 Edition2 compliant traffic. - No ATN Secutity is supported. - note: - The ATN upper layers are derived from OSI standards (ICAO DOC 9705) - while ATN/IPS (ICAO DOC 9896) which is entirely based on IPV6. + The dissector has been tested with ICAO doc9705 Edition2 compliant traffic. + No ATN Secutity is supported. + note: + The ATN upper layers are derived from OSI standards (ICAO DOC 9705) + while ATN/IPS (ICAO DOC 9896) which is entirely based on IPV6. */ /* known defects/deficiencies: -- user-information within AARE is sometines not decoded due to an unset flag - (the field is optional). As far as I can tell asn2wrs is right here, - but on the other hand I know that in all of this cases user-information - is present and is processed by the ATN end system. - Maybe a true ATN expert may help me out here. +- user-information within AARE is sometines not decoded due to an unset flag + (the field is optional). As far as I can tell asn2wrs is right here, + but on the other hand I know that in all of this cases user-information + is present and is processed by the ATN end system. + Maybe a true ATN expert may help me out here. - - The conversation handling is based on src/dst addresses as well as - source or destination references depending on the TP4 packet type. - This means that after some time these references get reused for - new conversations. This almost certain happens for traces longer - than one day rendering this dissector unsuitable for captures exceeding - this one day. + - The conversation handling is based on src/dst addresses as well as + source or destination references depending on the TP4 packet type. + This means that after some time these references get reused for + new conversations. This almost certain happens for traces longer + than one day rendering this dissector unsuitable for captures exceeding + this one day. */ @@ -158,46 +153,46 @@ static proto_tree *root_tree = NULL; /* forward declarations for functions generated from asn1 */ static int dissect_atn_ulcs_T_externalt_encoding_single_asn1_type( - tvbuff_t *tvb _U_, - int offset _U_, - asn1_ctx_t *actx _U_, - proto_tree *tree _U_, - int hf_index - _U_); + tvbuff_t *tvb _U_, + int offset _U_, + asn1_ctx_t *actx _U_, + proto_tree *tree _U_, + int hf_index + _U_); static int dissect_atn_ulcs_T_externalt_encoding_octet_aligned( - tvbuff_t *tvb _U_, - int offset _U_, - asn1_ctx_t *actx _U_, - proto_tree *tree _U_, - int hf_index _U_); + tvbuff_t *tvb _U_, + int offset _U_, + asn1_ctx_t *actx _U_, + proto_tree *tree _U_, + int hf_index _U_); static int dissect_atn_ulcs_T_externalt_encoding_arbitrary( - tvbuff_t *tvb _U_, - int offset _U_, - asn1_ctx_t *actx _U_, - proto_tree *tree _U_, - int hf_index _U_); + tvbuff_t *tvb _U_, + int offset _U_, + asn1_ctx_t *actx _U_, + proto_tree *tree _U_, + int hf_index _U_); static int dissect_ACSE_apdu_PDU( - tvbuff_t *tvb _U_, - packet_info *pinfo _U_, - proto_tree *tree _U_, - void *data _U_); + tvbuff_t *tvb _U_, + packet_info *pinfo _U_, + proto_tree *tree _U_, + void *data _U_); guint32 dissect_per_object_descriptor_t( - tvbuff_t *tvb, - guint32 offset, - asn1_ctx_t *actx, - proto_tree *tree, - int hf_index, - tvbuff_t **value_tvb); + tvbuff_t *tvb, + guint32 offset, + asn1_ctx_t *actx, + proto_tree *tree, + int hf_index, + tvbuff_t **value_tvb); -static gint dissect_atn_ulcs( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_); +static gint dissect_atn_ulcs( + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_); /*--- Included file: packet-atn-ulcs-hf.c ---*/ @@ -277,7 +272,7 @@ static int hf_atn_ulcs_ACSE_requirements_authentication = -1; static int hf_atn_ulcs_ACSE_requirements_application_context_negotiation = -1; /*--- End of included file: packet-atn-ulcs-hf.c ---*/ -#line 195 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" +#line 190 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" /*--- Included file: packet-atn-ulcs-ett.c ---*/ @@ -309,7 +304,7 @@ static gint ett_atn_ulcs_RelativeDistinguishedName = -1; static gint ett_atn_ulcs_AttributeTypeAndValue = -1; /*--- End of included file: packet-atn-ulcs-ett.c ---*/ -#line 197 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" +#line 192 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" static gint ett_atn_ulcs = -1; static gint ett_atn_acse = -1; @@ -337,16 +332,16 @@ static const value_string atn_ulcs_Presentation_context_identifier_vals[] = { static int dissect_atn_ulcs_Presentation_context_identifier(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_per_constrained_integer( - tvb, - offset, - actx, - tree, - hf_index, - 1U, - 127U, - &ulcs_context_value, - TRUE); + offset = dissect_per_constrained_integer( + tvb, + offset, + actx, + tree, + hf_index, + 1U, + 127U, + &ulcs_context_value, + TRUE); return offset; @@ -376,90 +371,90 @@ dissect_atn_ulcs_OCTET_STRING(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act static int dissect_atn_ulcs_T_pdv_list_presentation_data_values_arbitrary(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - packet_info * pinfo = actx->pinfo; - tvbuff_t *tvb_usr = NULL; - proto_tree *atn_ulcs_tree = NULL; - atn_conversation_t *atn_cv = NULL; - heur_dtbl_entry_t *hdtbl_entry; - - /* extract bitstring into new tvb buffer */ - offset = dissect_per_bit_string( - tvb, - offset, - actx, - tree, - hf_index, - NO_BOUND, - NO_BOUND, - FALSE, - &tvb_usr, - NULL); - - if (tvb_usr) { - /* call appropiate dissector for bitstring data */ - switch(ulcs_context_value){ - case 1: /* ACSE PDU*/ - atn_ulcs_tree = proto_tree_add_subtree( - root_tree, tvb, offset, 0, - ett_atn_acse, NULL, ATN_ACSE_PROTO ); - - dissect_ACSE_apdu_PDU( - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - atn_ulcs_tree, NULL); - break; - case 3: /* USER data; call subdissector for CM, CPDLC ... */ - - /* using dstref for PDV-list only occurrs in DT */ - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src); - - if(atn_cv) { - switch(atn_cv->ae_qualifier){ - case cma: /* contact management */ - call_dissector_with_data( - atn_cm_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - case cpdlc: /* plain old cpdlc */ - case pmcpdlc: /* protected mode cpdlc */ - call_dissector_with_data( - atn_cpdlc_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - default: /* unknown or unhandled datalink application */ - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - &hdtbl_entry, - NULL); - break; - } - } - else{ - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - &hdtbl_entry, - NULL); - } - break; - default: - break; - } /* switch(ulcs_context_value) */ - } + packet_info * pinfo = actx->pinfo; + tvbuff_t *tvb_usr = NULL; + proto_tree *atn_ulcs_tree = NULL; + atn_conversation_t *atn_cv = NULL; + heur_dtbl_entry_t *hdtbl_entry; + + /* extract bitstring into new tvb buffer */ + offset = dissect_per_bit_string( + tvb, + offset, + actx, + tree, + hf_index, + NO_BOUND, + NO_BOUND, + FALSE, + &tvb_usr, + NULL); + + if (tvb_usr) { + /* call appropiate dissector for bitstring data */ + switch(ulcs_context_value){ + case 1: /* ACSE PDU*/ + atn_ulcs_tree = proto_tree_add_subtree( + root_tree, tvb, offset, 0, + ett_atn_acse, NULL, ATN_ACSE_PROTO ); + + dissect_ACSE_apdu_PDU( + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + atn_ulcs_tree, NULL); + break; + case 3: /* USER data; call subdissector for CM, CPDLC ... */ + + /* using dstref for PDV-list only occurrs in DT */ + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src); + + if(atn_cv) { + switch(atn_cv->ae_qualifier){ + case cma: /* contact management */ + call_dissector_with_data( + atn_cm_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + case cpdlc: /* plain old cpdlc */ + case pmcpdlc: /* protected mode cpdlc */ + call_dissector_with_data( + atn_cpdlc_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + default: /* unknown or unhandled datalink application */ + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + &hdtbl_entry, + NULL); + break; + } + } + else{ + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + &hdtbl_entry, + NULL); + } + break; + default: + break; + } /* switch(ulcs_context_value) */ + } return offset; @@ -542,16 +537,16 @@ dissect_atn_ulcs_INTEGER(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_ static int dissect_atn_ulcs_T_data_value_descriptor(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_per_octet_string( - tvb, - offset, - actx, - tree, - hf_index, - -1, - -1, - FALSE, - &actx->external.data_value_descriptor); + offset = dissect_per_octet_string( + tvb, + offset, + actx, + tree, + hf_index, + -1, + -1, + FALSE, + &actx->external.data_value_descriptor); actx->external.data_value_descr_present = TRUE; @@ -563,7 +558,7 @@ dissect_atn_ulcs_T_data_value_descriptor(tvbuff_t *tvb _U_, int offset _U_, asn1 static int dissect_atn_ulcs_T_externalt_encoding_single_asn1_type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_per_open_type(tvb, offset, actx, tree, hf_index, NULL); + offset = dissect_per_open_type(tvb, offset, actx, tree, hf_index, NULL); @@ -575,7 +570,7 @@ dissect_atn_ulcs_T_externalt_encoding_single_asn1_type(tvbuff_t *tvb _U_, int of static int dissect_atn_ulcs_T_externalt_encoding_octet_aligned(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, NULL); @@ -587,94 +582,94 @@ dissect_atn_ulcs_T_externalt_encoding_octet_aligned(tvbuff_t *tvb _U_, int offse static int dissect_atn_ulcs_T_externalt_encoding_arbitrary(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - tvbuff_t *tvb_usr = NULL; - packet_info * pinfo = actx->pinfo; - atn_conversation_t *atn_cv = NULL; - heur_dtbl_entry_t *hdtbl_entry; - - /* decode bit-string user data within ACSE */ - offset = dissect_per_bit_string( - tvb, - offset, - actx, - tree, hf_index, - NO_BOUND, - NO_BOUND, - FALSE, - &tvb_usr, - NULL); - - if (tvb_usr) { - /* DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src); - } - /* CR: srcref present, dstref always zero */ - if((pinfo->clnp_srcref) && (!pinfo->clnp_dstref)){ - - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst); - } - /* CC: srcref and dstref present */ - if((pinfo->clnp_srcref) && (pinfo->clnp_dstref)){ - - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst); - } - - if(atn_cv) { - switch(atn_cv->ae_qualifier){ - case cma: /* contact management */ - - call_dissector_with_data( - atn_cm_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - case cpdlc: /* plain old cpdlc */ - case pmcpdlc: /* protected mode cpdlc */ - - call_dissector_with_data( - atn_cpdlc_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - default: /* unknown or unhandled datalink application */ - - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - &hdtbl_entry, - NULL); - break; - } - }else { - - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - &hdtbl_entry, - NULL); - } - } - - offset += tvb_reported_length_remaining(tvb, offset); + tvbuff_t *tvb_usr = NULL; + packet_info * pinfo = actx->pinfo; + atn_conversation_t *atn_cv = NULL; + heur_dtbl_entry_t *hdtbl_entry; + + /* decode bit-string user data within ACSE */ + offset = dissect_per_bit_string( + tvb, + offset, + actx, + tree, hf_index, + NO_BOUND, + NO_BOUND, + FALSE, + &tvb_usr, + NULL); + + if (tvb_usr) { + /* DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src); + } + /* CR: srcref present, dstref always zero */ + if((pinfo->clnp_srcref) && (!pinfo->clnp_dstref)){ + + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst); + } + /* CC: srcref and dstref present */ + if((pinfo->clnp_srcref) && (pinfo->clnp_dstref)){ + + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst); + } + + if(atn_cv) { + switch(atn_cv->ae_qualifier){ + case cma: /* contact management */ + + call_dissector_with_data( + atn_cm_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + case cpdlc: /* plain old cpdlc */ + case pmcpdlc: /* protected mode cpdlc */ + + call_dissector_with_data( + atn_cpdlc_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + default: /* unknown or unhandled datalink application */ + + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + &hdtbl_entry, + NULL); + break; + } + }else { + + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + &hdtbl_entry, + NULL); + } + } + + offset += tvb_reported_length_remaining(tvb, offset); return offset; @@ -854,42 +849,42 @@ dissect_atn_ulcs_AP_title(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U static int dissect_atn_ulcs_AE_qualifier_form2(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - packet_info * pinfo = actx->pinfo; - atn_conversation_t *atn_cv = NULL; - guint32 ae_qualifier = 0; - - /* dissect ae-qualifier */ - offset = dissect_per_integer( - tvb, - offset, - actx, - tree, - hf_index, - &ae_qualifier); - - - /*note: */ - /* the field "calling-AE-qualifier" is optional, */ - /* which means that we can exploit it only if it is present. */ - /* We still depend on heuristical decoding of CM, CPDLC PDU's otherwise. */ - - /* AARQ/DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - } - - /* AARQ/CR: srcref present, dstref is always zero */ - if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - } - - if(atn_cv){ - atn_cv->ae_qualifier = ae_qualifier; - } + packet_info * pinfo = actx->pinfo; + atn_conversation_t *atn_cv = NULL; + guint32 ae_qualifier = 0; + + /* dissect ae-qualifier */ + offset = dissect_per_integer( + tvb, + offset, + actx, + tree, + hf_index, + &ae_qualifier); + + + /*note: */ + /* the field "calling-AE-qualifier" is optional, */ + /* which means that we can exploit it only if it is present. */ + /* We still depend on heuristical decoding of CM, CPDLC PDU's otherwise. */ + + /* AARQ/DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + } + + /* AARQ/CR: srcref present, dstref is always zero */ + if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + } + + if(atn_cv){ + atn_cv->ae_qualifier = ae_qualifier; + } return offset; } @@ -958,22 +953,22 @@ dissect_atn_ulcs_ACSE_requirements(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t static int dissect_atn_ulcs_Mechanism_name(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_per_object_identifier( - tvb, - offset, - actx, - tree, - hf_index, - NULL); + offset = dissect_per_object_identifier( + tvb, + offset, + actx, + tree, + hf_index, + NULL); offset = dissect_per_object_identifier( - tvb, - offset, - actx, - tree, - hf_index, - NULL); + tvb, + offset, + actx, + tree, + hf_index, + NULL); return offset; @@ -1003,20 +998,20 @@ dissect_atn_ulcs_EXTERNAL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U static int dissect_atn_ulcs_T_other_mechanism_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset=call_ber_oid_callback( - object_identifier_id, - tvb, - offset, - actx->pinfo, - tree, NULL); + offset=call_ber_oid_callback( + object_identifier_id, + tvb, + offset, + actx->pinfo, + tree, NULL); - offset=call_ber_oid_callback( - object_identifier_id, - tvb, - offset, - actx->pinfo, - tree, NULL); + offset=call_ber_oid_callback( + object_identifier_id, + tvb, + offset, + actx->pinfo, + tree, NULL); return offset; @@ -1123,93 +1118,93 @@ static const per_sequence_t AARQ_apdu_sequence[] = { static int dissect_atn_ulcs_AARQ_apdu(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - packet_info * pinfo = actx->pinfo; - aarq_data_t *aarq_data = NULL; - atn_conversation_t *atn_cv = NULL; - guint32 aircraft_24_bit_address = 0; - - /* AARQ/DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - if(!atn_cv){ - atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t); - atn_cv->ae_qualifier = unknown; - create_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src , - atn_cv); - } - } - - /* AARQ/CR: srcref present, dstref is always zero */ - if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - atn_cv = find_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst ); - if(!atn_cv){ - atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t); - atn_cv->ae_qualifier = unknown; - create_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst , - atn_cv); - } - } - - /* conversation is to be created prior to decoding */ - /* of "AE-qualifier-form2" which takes place here: */ - offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, + packet_info * pinfo = actx->pinfo; + aarq_data_t *aarq_data = NULL; + atn_conversation_t *atn_cv = NULL; + guint32 aircraft_24_bit_address = 0; + + /* AARQ/DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + if(!atn_cv){ + atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t); + atn_cv->ae_qualifier = unknown; + create_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src , + atn_cv); + } + } + + /* AARQ/CR: srcref present, dstref is always zero */ + if((!pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + atn_cv = find_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst ); + if(!atn_cv){ + atn_cv = wmem_new(wmem_file_scope(), atn_conversation_t); + atn_cv->ae_qualifier = unknown; + create_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst , + atn_cv); + } + } + + /* conversation is to be created prior to decoding */ + /* of "AE-qualifier-form2" which takes place here: */ + offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_atn_ulcs_AARQ_apdu, AARQ_apdu_sequence); - /* save AARQ packet data to create a conversation */ - /* when decoding the following AARE PDU */ - /* ATN applications CM and CPDLC are air/ground applications */ - /* so there is always an aircraft (with its 24-bit address) */ - /* and a ground facility. */ - /* the assumption is that there is only one open AARQ/AARE */ - /* dialog per aircraft at a time. */ - /* the aircraft's 24-bit address is used as a key to each AARQ */ - /* data. AARQ data is used to create a conversation with */ - /* air and ground endpoints (based on NSAP's and transport references) */ - /* when decoding AARE.*/ - /* note: */ - /* it may be more robust to create the conversation */ - /* in the "ositp" dissector an to merely use the conversation here */ - aircraft_24_bit_address = - get_aircraft_24_bit_address_from_nsap(pinfo); + /* save AARQ packet data to create a conversation */ + /* when decoding the following AARE PDU */ + /* ATN applications CM and CPDLC are air/ground applications */ + /* so there is always an aircraft (with its 24-bit address) */ + /* and a ground facility. */ + /* the assumption is that there is only one open AARQ/AARE */ + /* dialog per aircraft at a time. */ + /* the aircraft's 24-bit address is used as a key to each AARQ */ + /* data. AARQ data is used to create a conversation with */ + /* air and ground endpoints (based on NSAP's and transport references) */ + /* when decoding AARE.*/ + /* note: */ + /* it may be more robust to create the conversation */ + /* in the "ositp" dissector an to merely use the conversation here */ + aircraft_24_bit_address = + get_aircraft_24_bit_address_from_nsap(pinfo); - /* search for aarq entry */ - aarq_data = (aarq_data_t *) wmem_tree_lookup32( - aarq_data_tree, - aircraft_24_bit_address); + /* search for aarq entry */ + aarq_data = (aarq_data_t *) wmem_tree_lookup32( + aarq_data_tree, + aircraft_24_bit_address); - if(!aarq_data){ /* aarq data not found, create new record */ + if(!aarq_data){ /* aarq data not found, create new record */ - /* alloc aarq data */ - aarq_data = wmem_new(wmem_file_scope(), aarq_data_t); - aarq_data-> aarq_pending = FALSE; + /* alloc aarq data */ + aarq_data = wmem_new(wmem_file_scope(), aarq_data_t); + aarq_data-> aarq_pending = FALSE; - /* insert aarq data */ - wmem_tree_insert32(aarq_data_tree ,aircraft_24_bit_address,(void*)aarq_data); - } + /* insert aarq data */ + wmem_tree_insert32(aarq_data_tree ,aircraft_24_bit_address,(void*)aarq_data); + } - /* check for pending AARQ/AARE sequences */ - /* if "aarq_data-> aarq_pending" is set this means that there is already one */ - /* AARQ/AARE sequence pending (is unwise to overwrite AARE/AARQ) */ - if (aarq_data-> aarq_pending == FALSE ) { + /* check for pending AARQ/AARE sequences */ + /* if "aarq_data-> aarq_pending" is set this means that there is already one */ + /* AARQ/AARE sequence pending (is unwise to overwrite AARE/AARQ) */ + if (aarq_data-> aarq_pending == FALSE ) { - /* init aarq data */ - memset(aarq_data,0,sizeof(aarq_data_t)); + /* init aarq data */ + memset(aarq_data,0,sizeof(aarq_data_t)); - aarq_data->cv = atn_cv; - aarq_data-> aarq_pending = TRUE; - } + aarq_data->cv = atn_cv; + aarq_data-> aarq_pending = TRUE; + } return offset; @@ -1332,88 +1327,88 @@ static const per_sequence_t AARE_apdu_sequence[] = { static int dissect_atn_ulcs_AARE_apdu(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - packet_info * pinfo = actx->pinfo; - guint32 aircraft_24_bit_address = 0 ; - atn_conversation_t *atn_cv = NULL; - aarq_data_t *aarq_data = NULL; - - /* get AARQ data and use it to create a new conversation, */ - /* the conversation is used along with */ - /* AARQ's "calling ae qualifier" to determine the */ - /* type of air/ground application of each subsequent frame.*/ - /* we use this information to invoke the correct application dissector. */ - /* note: */ - /* heuristical decoding of ASN1 will not work for all cases, */ - /* for there may be CM PDU's which will exactly look like CPDLC PDU'S */ - - /* get 24-bit icao address */ - aircraft_24_bit_address = get_aircraft_24_bit_address_from_nsap(pinfo); - - /* search for aarq entry */ - aarq_data = (aarq_data_t *) wmem_tree_lookup32( - aarq_data_tree, - aircraft_24_bit_address); - - /* no aarq data present, do nothing */ - /* without both ends of the conversation and without */ - /* the "calling ae-qualifier there is no point in setting up "*/ - /* a conversation */ - if(!aarq_data) { - - return offset; - } - - /* AARE/DT: dstref present, srcref is always zero */ - if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src ); - - if(!atn_cv){ /* conversation not fond */ - - /* DT has only dstref - create new conversation */ - create_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src , - aarq_data->cv); - } - } - - /* AARE/CC: srcref and dstref present */ - if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ - - atn_cv = find_atn_conversation( - &pinfo->src, - pinfo->clnp_srcref, + packet_info * pinfo = actx->pinfo; + guint32 aircraft_24_bit_address = 0 ; + atn_conversation_t *atn_cv = NULL; + aarq_data_t *aarq_data = NULL; + + /* get AARQ data and use it to create a new conversation, */ + /* the conversation is used along with */ + /* AARQ's "calling ae qualifier" to determine the */ + /* type of air/ground application of each subsequent frame.*/ + /* we use this information to invoke the correct application dissector. */ + /* note: */ + /* heuristical decoding of ASN1 will not work for all cases, */ + /* for there may be CM PDU's which will exactly look like CPDLC PDU'S */ + + /* get 24-bit icao address */ + aircraft_24_bit_address = get_aircraft_24_bit_address_from_nsap(pinfo); + + /* search for aarq entry */ + aarq_data = (aarq_data_t *) wmem_tree_lookup32( + aarq_data_tree, + aircraft_24_bit_address); + + /* no aarq data present, do nothing */ + /* without both ends of the conversation and without */ + /* the "calling ae-qualifier there is no point in setting up "*/ + /* a conversation */ + if(!aarq_data) { + + return offset; + } + + /* AARE/DT: dstref present, srcref is always zero */ + if((pinfo->clnp_dstref) && (!pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src ); + + if(!atn_cv){ /* conversation not fond */ + + /* DT has only dstref - create new conversation */ + create_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src , + aarq_data->cv); + } + } + + /* AARE/CC: srcref and dstref present */ + if((pinfo->clnp_dstref) && (pinfo->clnp_srcref)){ + + atn_cv = find_atn_conversation( + &pinfo->src, + pinfo->clnp_srcref, &pinfo->dst); - if(atn_cv){ /* conversation found. */ - - /* create new conversation for dstref */ - create_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src , - aarq_data->cv); - - }else { /* no conversation found */ - /* as CC contains srcref *and* dstref we use both to create new records */ - create_atn_conversation(&pinfo->src, - pinfo->clnp_srcref, - &pinfo->dst , - aarq_data->cv); - create_atn_conversation(&pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src , - aarq_data->cv); - } - } - - /* clear aarq data */ - memset(aarq_data,0,sizeof(aarq_data_t)); - aarq_data-> aarq_pending = FALSE; - - offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, + if(atn_cv){ /* conversation found. */ + + /* create new conversation for dstref */ + create_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src , + aarq_data->cv); + + }else { /* no conversation found */ + /* as CC contains srcref *and* dstref we use both to create new records */ + create_atn_conversation(&pinfo->src, + pinfo->clnp_srcref, + &pinfo->dst , + aarq_data->cv); + create_atn_conversation(&pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src , + aarq_data->cv); + } + } + + /* clear aarq data */ + memset(aarq_data,0,sizeof(aarq_data_t)); + aarq_data-> aarq_pending = FALSE; + + offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_atn_ulcs_AARE_apdu, AARE_apdu_sequence); @@ -1469,15 +1464,15 @@ dissect_atn_ulcs_Release_response_reason(tvbuff_t *tvb _U_, int offset _U_, asn1 /* extension present: last param set to true. asn2wrs didn't take notice of that */ offset = dissect_per_constrained_integer( - tvb, - offset, - actx, - tree, - hf_index, - 0U, - 30U, - NULL, - TRUE); + tvb, + offset, + actx, + tree, + hf_index, + 0U, + 30U, + NULL, + TRUE); return offset; @@ -1600,7 +1595,7 @@ static int dissect_ACSE_apdu_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot /*--- End of included file: packet-atn-ulcs-fn.c ---*/ -#line 201 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" +#line 196 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" #if 0 /* re-implementing external data: packet-per.c */ @@ -1614,34 +1609,34 @@ static const value_string per_External_encoding_vals[] = { /* re-implementing external data: packet-per.c */ static const per_choice_t External_encoding_choice[] = { - { 0, - &hf_atn_ulcs_externalt_encoding_single_asn1_type, - ASN1_NO_EXTENSIONS, - dissect_atn_ulcs_T_externalt_encoding_single_asn1_type - }, - { 1, - &hf_atn_ulcs_externalt_encoding_octet_aligned, - ASN1_NO_EXTENSIONS, - dissect_atn_ulcs_T_externalt_encoding_octet_aligned - }, - { 2, - &hf_atn_ulcs_externalt_encoding_arbitrary, - ASN1_NO_EXTENSIONS, - dissect_atn_ulcs_T_externalt_encoding_arbitrary - }, - { 0, - NULL, - 0, - NULL - } + { 0, + &hf_atn_ulcs_externalt_encoding_single_asn1_type, + ASN1_NO_EXTENSIONS, + dissect_atn_ulcs_T_externalt_encoding_single_asn1_type + }, + { 1, + &hf_atn_ulcs_externalt_encoding_octet_aligned, + ASN1_NO_EXTENSIONS, + dissect_atn_ulcs_T_externalt_encoding_octet_aligned + }, + { 2, + &hf_atn_ulcs_externalt_encoding_arbitrary, + ASN1_NO_EXTENSIONS, + dissect_atn_ulcs_T_externalt_encoding_arbitrary + }, + { 0, + NULL, + 0, + NULL + } }; #endif /* ATN Session layer */ -#define SES_PDU_TYPE_MASK 0xf8 -#define SES_PARAM_IND_MASK 0x04 -#define SES_PARAM_B2_MASK 0x02 -#define SES_PARAM_B1_MASK 0x01 +#define SES_PDU_TYPE_MASK 0xf8 +#define SES_PARAM_IND_MASK 0x04 +#define SES_PARAM_B2_MASK 0x02 +#define SES_PARAM_B1_MASK 0x01 static int hf_atn_ses_type = -1; static int hf_atn_ses_param_ind = -1; @@ -1654,254 +1649,254 @@ static gint ett_atn_ses = -1; const value_string atn_ses_param_ind[] = { - {0, "No Parameter Indication "}, - {1, "Parameter Indication "}, - {0, NULL } + {0, "No Parameter Indication "}, + {1, "Parameter Indication "}, + {0, NULL } }; const value_string srf_b2[] = { - {0, "Transport Connection is kept"}, - {1, "Transport Connection is released" }, - {0, NULL } + {0, "Transport Connection is kept"}, + {1, "Transport Connection is released" }, + {0, NULL } }; const value_string srf_b1[] = { - {0, "Transport Connection is transient"}, - {1, "Transport Connection is persistent"}, - {0, NULL } + {0, "Transport Connection is transient"}, + {1, "Transport Connection is persistent"}, + {0, NULL } }; -#define SES_ATN_SCN 0xe8 -#define SES_ATN_SCNC 0xf8 -#define SES_ATN_SAC 0xf0 -#define SES_ATN_SACC 0xd8 -#define SES_ATN_SRF 0xe0 -#define SES_ATN_SRFC 0xa0 +#define SES_ATN_SCN 0xe8 +#define SES_ATN_SCNC 0xf8 +#define SES_ATN_SAC 0xf0 +#define SES_ATN_SACC 0xd8 +#define SES_ATN_SRF 0xe0 +#define SES_ATN_SRFC 0xa0 const value_string atn_ses_type[] = { - { 0x1d, "Short Connect (SCN) SPDU" }, - { 0x1f, "Short Connect Accept (SAC) SPDU" }, - { 0x1e, "Short Connect Accept Continue (SACC) SPDU" }, - { 0x1c, "Short Refuse (SRF) SPDU" }, - { 0x14, "Short Refuse Continue (SRFC) SPDU" }, - {0, NULL } + { 0x1d, "Short Connect (SCN) SPDU" }, + { 0x1f, "Short Connect Accept (SAC) SPDU" }, + { 0x1e, "Short Connect Accept Continue (SACC) SPDU" }, + { 0x1c, "Short Refuse (SRF) SPDU" }, + { 0x14, "Short Refuse Continue (SRFC) SPDU" }, + {0, NULL } }; /* ATN Presentation layer */ #define ATN_PRES_PROTO "ICAO Doc9705 ULCS Presentation (ISO 8822/8823-1:1994)" -static int hf_atn_pres_err = -1; +static int hf_atn_pres_err = -1; static int hf_atn_pres_pdu_type = -1; -static gint ett_atn_pres = -1; +static gint ett_atn_pres = -1; #define ATN_SES_PRES_MASK 0xf803 -#define PRES_CPR_ER_MASK 0x70 +#define PRES_CPR_ER_MASK 0x70 /* type determined by SPDU and PPDU */ const value_string atn_pres_vals[] = { - { 0xe802, "Short Presentation Connect PPDU (CP) " }, - { 0xf802, "Short Presentation Connect PPDU (CP) " }, - { 0xf002, "Short Presentation Connect Accept PPDU (CPA)" }, - { 0xd802, "Short Presentation Connect Accept PPDU (CPA)" }, - { 0xe002, "Short Presentation Connect Reject PPDU (CPR)" }, - { 0xa002, "Short Presentation Connect Reject PPDU (CPR)" }, - {0, NULL } + { 0xe802, "Short Presentation Connect PPDU (CP) " }, + { 0xf802, "Short Presentation Connect PPDU (CP) " }, + { 0xf002, "Short Presentation Connect Accept PPDU (CPA)" }, + { 0xd802, "Short Presentation Connect Accept PPDU (CPA)" }, + { 0xe002, "Short Presentation Connect Reject PPDU (CPR)" }, + { 0xa002, "Short Presentation Connect Reject PPDU (CPR)" }, + {0, NULL } }; /* Short Presentation Connect Reject PPDU's 0yyy 00zz */ const value_string atn_pres_err[] = { - { 0x00, "Presentation-user" }, - { 0x01, "Reason not specified (transient)"}, - { 0x02, "Temporary congestion (transient)"}, - { 0x03, "Local limit exceeded (transient)"}, - { 0x04, "Called presentation-address unknown (permanent)"}, - { 0x05, "Protocol version not supported (permanent)"}, - { 0x06, "Default context not supported (permanent)"}, - { 0x07, "User data not readable (permanent)"}, - { 0, NULL } + { 0x00, "Presentation-user" }, + { 0x01, "Reason not specified (transient)"}, + { 0x02, "Temporary congestion (transient)"}, + { 0x03, "Local limit exceeded (transient)"}, + { 0x04, "Called presentation-address unknown (permanent)"}, + { 0x05, "Protocol version not supported (permanent)"}, + { 0x06, "Default context not supported (permanent)"}, + { 0x07, "User data not readable (permanent)"}, + { 0, NULL } }; #if 0 /* re-implementing external data: packet-per.c */ -static int atn_ulcs_Externalt_encoding( - tvbuff_t *tvb _U_, - int offset _U_, - asn1_ctx_t *actx _U_, - proto_tree *tree _U_, - int hf_index _U_) +static int atn_ulcs_Externalt_encoding( + tvbuff_t *tvb _U_, + int offset _U_, + asn1_ctx_t *actx _U_, + proto_tree *tree _U_, + int hf_index _U_) { - offset = dissect_per_choice( - tvb, - offset, - actx, - tree, - hf_index, - ett_atn_ulcs_EXTERNALt, - External_encoding_choice, - &actx->external.encoding); + offset = dissect_per_choice( + tvb, + offset, + actx, + tree, + hf_index, + ett_atn_ulcs_EXTERNALt, + External_encoding_choice, + &actx->external.encoding); - return offset; + return offset; } /* re-implementing external data: packet-per.c */ -static guint32 atn_per_external_type( - tvbuff_t *tvb _U_, - guint32 offset, - asn1_ctx_t *actx, - proto_tree *tree _U_, - int hf_index _U_, - per_type_fn type_cb) +static guint32 atn_per_external_type( + tvbuff_t *tvb _U_, + guint32 offset, + asn1_ctx_t *actx, + proto_tree *tree _U_, + int hf_index _U_, + per_type_fn type_cb) { - memset(&actx->external, '\0', sizeof(actx->external)); - actx->external.hf_index = -1; - actx->external.encoding = -1; + memset(&actx->external, '\0', sizeof(actx->external)); + actx->external.hf_index = -1; + actx->external.encoding = -1; - actx->external.u.per.type_cb = type_cb; - offset = atn_ulcs_Externalt_encoding( - tvb, - offset, - actx, - tree, - hf_index); + actx->external.u.per.type_cb = type_cb; + offset = atn_ulcs_Externalt_encoding( + tvb, + offset, + actx, + tree, + hf_index); - memset( - &actx->external, - '\0', - sizeof(actx->external)); + memset( + &actx->external, + '\0', + sizeof(actx->external)); - actx->external.hf_index = -1; - actx->external.encoding = -1; + actx->external.hf_index = -1; + actx->external.encoding = -1; - return offset; + return offset; } #endif /* determine 24-bit aircraft address(ARS) */ /* from 20-byte ATN NSAP. */ guint32 get_aircraft_24_bit_address_from_nsap( - packet_info *pinfo) + packet_info *pinfo) { - const guint8* addr = NULL; - guint32 ars =0; - guint32 adr_prefix =0; - - /* check NSAP address type*/ - if( (pinfo->src.type != get_osi_address_type()) || - (pinfo->dst.type != get_osi_address_type())) { - return ars; } - - /* 20 octets address length required */ - /* for ATN */ - if( (pinfo->src.len != 20) || - (pinfo->dst.len != 20)) { - return ars; } - - /* first try source address */ - /* if the src address originates */ - /* from an aircraft it's downlink */ - - /* convert addr into 32-bit integer */ - addr = (const guint8 *)pinfo->src.data; - adr_prefix = - ((addr[0]<<24) | - (addr[1]<<16) | - (addr[2]<<8) | - addr[3] ); - - /* according to ICAO doc9507 Ed2 SV5 */ - /* clause 5.4.3.8.1.5 and 5.4.3.8.1.3 */ - /* mobile addresses contain "c1" of "41" */ - /* in the VER subfield of the NSAP */ - if((adr_prefix == 0x470027c1) || - (adr_prefix == 0x47002741)) { - /* ICAO doc9507 Ed2 SV5 5.4.3.8.4.4 */ - /* states that the ARS subfield containes */ - /* the 24-bitaddress of the aircraft */ - ars = ((addr[8])<<16) | - ((addr[9])<<8) | - (addr[10]); - } - - /* try destination address */ - /* if the src address originates */ - /* from an aircraft it's downlink */ - - /* convert addr into 32-bit integer */ - addr = (const guint8 *)pinfo->dst.data; - adr_prefix = ((addr[0]<<24) | - (addr[1]<<16) | - (addr[2]<<8) | - addr[3] ); - - /* according to ICAO doc9507 Ed2 SV5 */ - /* clause 5.4.3.8.1.5 and 5.4.3.8.1.3 */ - /* mobile addresses contain "c1" of "41" */ - /* in the VER subfield of the NSAP */ - if((adr_prefix == 0x470027c1) || - (adr_prefix == 0x47002741)) { - /* ICAO doc9507 Ed2 SV5 5.4.3.8.4.4 */ - /* states that the ARS subfield containes */ - /* the 24-bitaddress of the aircraft */ - ars = ((addr[8])<<16) | - ((addr[9])<<8) | - (addr[10]); - } - return ars; + const guint8* addr = NULL; + guint32 ars =0; + guint32 adr_prefix =0; + + /* check NSAP address type*/ + if( (pinfo->src.type != get_osi_address_type()) || + (pinfo->dst.type != get_osi_address_type())) { + return ars; } + + /* 20 octets address length required */ + /* for ATN */ + if( (pinfo->src.len != 20) || + (pinfo->dst.len != 20)) { + return ars; } + + /* first try source address */ + /* if the src address originates */ + /* from an aircraft it's downlink */ + + /* convert addr into 32-bit integer */ + addr = (const guint8 *)pinfo->src.data; + adr_prefix = + ((addr[0]<<24) | + (addr[1]<<16) | + (addr[2]<<8) | + addr[3] ); + + /* according to ICAO doc9507 Ed2 SV5 */ + /* clause 5.4.3.8.1.5 and 5.4.3.8.1.3 */ + /* mobile addresses contain "c1" of "41" */ + /* in the VER subfield of the NSAP */ + if((adr_prefix == 0x470027c1) || + (adr_prefix == 0x47002741)) { + /* ICAO doc9507 Ed2 SV5 5.4.3.8.4.4 */ + /* states that the ARS subfield containes */ + /* the 24-bitaddress of the aircraft */ + ars = ((addr[8])<<16) | + ((addr[9])<<8) | + (addr[10]); + } + + /* try destination address */ + /* if the src address originates */ + /* from an aircraft it's downlink */ + + /* convert addr into 32-bit integer */ + addr = (const guint8 *)pinfo->dst.data; + adr_prefix = ((addr[0]<<24) | + (addr[1]<<16) | + (addr[2]<<8) | + addr[3] ); + + /* according to ICAO doc9507 Ed2 SV5 */ + /* clause 5.4.3.8.1.5 and 5.4.3.8.1.3 */ + /* mobile addresses contain "c1" of "41" */ + /* in the VER subfield of the NSAP */ + if((adr_prefix == 0x470027c1) || + (adr_prefix == 0x47002741)) { + /* ICAO doc9507 Ed2 SV5 5.4.3.8.4.4 */ + /* states that the ARS subfield containes */ + /* the 24-bitaddress of the aircraft */ + ars = ((addr[8])<<16) | + ((addr[9])<<8) | + (addr[10]); + } + return ars; } /* determine whether a PDU is uplink or downlink */ /* by checking for known aircraft address prefices*/ int check_heur_msg_type(packet_info *pinfo _U_) { - int t = no_msg; - const guint8* addr = NULL; - guint32 adr_prefix =0; + int t = no_msg; + const guint8* addr = NULL; + guint32 adr_prefix =0; - /* check NSAP address type*/ - if( (pinfo->src.type != get_osi_address_type()) || (pinfo->dst.type != get_osi_address_type())) { - return t; } + /* check NSAP address type*/ + if( (pinfo->src.type != get_osi_address_type()) || (pinfo->dst.type != get_osi_address_type())) { + return t; } - /* check NSAP address length; 20 octets address length required */ - if( (pinfo->src.len != 20) || (pinfo->dst.len != 20)) { - return t; } + /* check NSAP address length; 20 octets address length required */ + if( (pinfo->src.len != 20) || (pinfo->dst.len != 20)) { + return t; } - addr = (const guint8 *)pinfo->src.data; + addr = (const guint8 *)pinfo->src.data; - /* convert address to 32-bit integer */ - adr_prefix = ((addr[0]<<24) | (addr[1]<<16) | (addr[2]<<8) | addr[3] ); + /* convert address to 32-bit integer */ + adr_prefix = ((addr[0]<<24) | (addr[1]<<16) | (addr[2]<<8) | addr[3] ); - /* According to the published ATN NSAP adddressing scheme */ - /* in ICAO doc9705 Ed2 SV5 5.4.3.8.1.3 and 5.4.3.8.1.5 */ - /* the "VER" field shall be 0x41 ("all Mobile AINSC") or */ - /* 0xc1 ("all Mobile ATSC") for mobile stations (aka aircraft).*/ - if((adr_prefix == 0x470027c1) || (adr_prefix == 0x47002741)) { - t = dm; /* source is an aircraft: it's a downlink PDU */ - } + /* According to the published ATN NSAP adddressing scheme */ + /* in ICAO doc9705 Ed2 SV5 5.4.3.8.1.3 and 5.4.3.8.1.5 */ + /* the "VER" field shall be 0x41 ("all Mobile AINSC") or */ + /* 0xc1 ("all Mobile ATSC") for mobile stations (aka aircraft).*/ + if((adr_prefix == 0x470027c1) || (adr_prefix == 0x47002741)) { + t = dm; /* source is an aircraft: it's a downlink PDU */ + } - addr = (const guint8 *)pinfo->dst.data; + addr = (const guint8 *)pinfo->dst.data; - /* convert address to 32-bit integer */ - adr_prefix = ((addr[0]<<24) | (addr[1]<<16) | (addr[2]<<8) | addr[3] ); + /* convert address to 32-bit integer */ + adr_prefix = ((addr[0]<<24) | (addr[1]<<16) | (addr[2]<<8) | addr[3] ); - /* According to the published ATN NSAP adddressing scheme */ - /* in ICAO doc9705 Ed2 SV5 5.4.3.8.1.3 and 5.4.3.8.1.5 */ - /* the "VER" field shall be 0x41 ("all Mobile AINSC") or */ - /* 0xc1 ("all Mobile ATSC") for mobile stations (aka aircraft).*/ - if((adr_prefix == 0x470027c1) || (adr_prefix == 0x47002741)) { - t = um; /* destination is aircraft: uplink PDU */ - } + /* According to the published ATN NSAP adddressing scheme */ + /* in ICAO doc9705 Ed2 SV5 5.4.3.8.1.3 and 5.4.3.8.1.5 */ + /* the "VER" field shall be 0x41 ("all Mobile AINSC") or */ + /* 0xc1 ("all Mobile ATSC") for mobile stations (aka aircraft).*/ + if((adr_prefix == 0x470027c1) || (adr_prefix == 0x47002741)) { + t = um; /* destination is aircraft: uplink PDU */ + } - return t; + return t; } /* conversation may be used by other dissectors */ wmem_tree_t *get_atn_conversation_tree(void){ - return atn_conversation_tree; + return atn_conversation_tree; } @@ -1911,287 +1906,287 @@ wmem_tree_t *get_atn_conversation_tree(void){ /* IMHO it's a hack - conversations should be maintained */ /* at transport layer (cotp) but this isn't working yet. */ atn_conversation_t * find_atn_conversation( - address *address1, - guint16 clnp_ref1, - address *address2 ) + address *address1, + guint16 clnp_ref1, + address *address2 ) { - atn_conversation_t *cv = NULL; - guint32 key = 0; - guint32 tmp = 0; + atn_conversation_t *cv = NULL; + guint32 key = 0; + guint32 tmp = 0; - ADD_ADDRESS_TO_HASH( tmp, address1); - key = (tmp << 16) | clnp_ref1 ; + ADD_ADDRESS_TO_HASH( tmp, address1); + key = (tmp << 16) | clnp_ref1 ; - ADD_ADDRESS_TO_HASH( tmp, address2); - key = (tmp << 24) | key ; + ADD_ADDRESS_TO_HASH( tmp, address2); + key = (tmp << 24) | key ; - /* search for atn conversation */ - cv = (atn_conversation_t *) - wmem_tree_lookup32(get_atn_conversation_tree(),key); + /* search for atn conversation */ + cv = (atn_conversation_t *) + wmem_tree_lookup32(get_atn_conversation_tree(),key); - return cv; + return cv; } /* create a atn conversation tree node */ /* conversation data is to be allocated externally */ /* a conversation may be referenced from both endpoints */ atn_conversation_t * create_atn_conversation( - address *address1, - guint16 clnp_ref1, - address *address2, - atn_conversation_t *conversation) + address *address1, + guint16 clnp_ref1, + address *address2, + atn_conversation_t *conversation) { - atn_conversation_t *cv = NULL; - guint32 key = 0; - guint32 tmp = 0; + atn_conversation_t *cv = NULL; + guint32 key = 0; + guint32 tmp = 0; - ADD_ADDRESS_TO_HASH( tmp, address1); - key = (tmp << 16) | clnp_ref1 ; + ADD_ADDRESS_TO_HASH( tmp, address1); + key = (tmp << 16) | clnp_ref1 ; - ADD_ADDRESS_TO_HASH( tmp, address2); - key = (tmp << 24) | key ; + ADD_ADDRESS_TO_HASH( tmp, address2); + key = (tmp << 24) | key ; - /* search for aircraft entry */ - cv = (atn_conversation_t *) - wmem_tree_lookup32( - get_atn_conversation_tree(), - key); + /* search for aircraft entry */ + cv = (atn_conversation_t *) + wmem_tree_lookup32( + get_atn_conversation_tree(), + key); - /* tree node already present */ - if(cv) { - return NULL; } + /* tree node already present */ + if(cv) { + return NULL; } - /* insert conversation data in tree*/ - wmem_tree_insert32( - get_atn_conversation_tree(), - key, - (void*)conversation); + /* insert conversation data in tree*/ + wmem_tree_insert32( + get_atn_conversation_tree(), + key, + (void*)conversation); - return conversation; + return conversation; } static int dissect_atn_ulcs( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - int offset = 0; - proto_item *ti = NULL; - proto_tree *atn_ulcs_tree = NULL; - guint8 value_pres = 0; - guint8 value_ses = 0; - guint16 value_ses_pres = 0; - - root_tree = tree; - - /* data pointer */ - /* decode as PDV-list */ - if ( (int)(intptr_t) data == FALSE ) - { - ti = proto_tree_add_item( - tree, - proto_atn_ulcs, - tvb, - 0, - 0 , - ENC_NA); - - atn_ulcs_tree = proto_item_add_subtree( - ti, - ett_atn_ulcs); - - dissect_Fully_encoded_data_PDU( - tvb, - pinfo, - atn_ulcs_tree, NULL); - - return offset + - tvb_reported_length_remaining(tvb, offset ) ; - } - - /* decode as SPDU, PPDU and ACSE PDU */ - if ( (int)(intptr_t) data == TRUE ) - { - /* get session and presentation PDU's */ - value_ses_pres = tvb_get_ntohs(tvb, offset); - - /* SPDU: dissect session layer */ - atn_ulcs_tree = proto_tree_add_subtree( - tree, tvb, offset, 0, - ett_atn_ses, NULL, ATN_SES_PROTO ); - - /* get SPDU (1 octet) */ - value_ses = tvb_get_guint8(tvb, offset); - - /* SPDU type/identifier */ - proto_tree_add_item(atn_ulcs_tree, - hf_atn_ses_type, - tvb, - offset, - 1, - ENC_BIG_ENDIAN ); - - /* SPDU parameters may be present in Short Refuse */ - /* or Short Refuse Continue SPDU's */ - switch(value_ses & SES_PDU_TYPE_MASK){ - case SES_ATN_SRF: - case SES_ATN_SRFC: - - /* SPDU parameter presence */ - proto_tree_add_item(atn_ulcs_tree, - hf_atn_ses_param_ind, - tvb, - offset, - 1, - ENC_BIG_ENDIAN ); - - /* parameter B2 */ - proto_tree_add_item(atn_ulcs_tree, - hf_atn_ses_param_b2, - tvb, - offset, - 1, - ENC_BIG_ENDIAN ); - - /* parameter B1 */ - proto_tree_add_item(atn_ulcs_tree, - hf_atn_ses_param_b1, - tvb, - offset, - 1, - ENC_BIG_ENDIAN ); - - break; - default: - break; - } - offset++; - - /* PPDU: dissect presentation layer */ - atn_ulcs_tree = proto_tree_add_subtree( - tree, tvb, offset, 0, - ett_atn_pres, NULL, ATN_PRES_PROTO ); - - value_pres = tvb_get_guint8(tvb, offset); - - /* need session context to identify PPDU type */ - /* note: */ - proto_tree_add_uint_format(atn_ulcs_tree, hf_atn_pres_pdu_type, - tvb, - offset, - 1, - value_ses_pres, - "%s (0x%02x)", - val_to_str( value_ses_pres & ATN_SES_PRES_MASK , atn_pres_vals, "?"), - value_pres); - - /* PPDU errorcode in case of SRF/CPR */ - switch(value_ses & SES_PDU_TYPE_MASK){ - case SES_ATN_SRF: - case SES_ATN_SRFC: - proto_tree_add_item( - atn_ulcs_tree, - hf_atn_pres_err, - tvb, - offset, - 1, - ENC_BIG_ENDIAN ); - break; - default: - break; - } - - offset++; - - /* ACSE PDU: dissect application layer */ - atn_ulcs_tree = proto_tree_add_subtree( - tree, tvb, offset, 0, - ett_atn_acse, NULL, ATN_ACSE_PROTO ); - - dissect_ACSE_apdu_PDU( - tvb_new_subset_remaining(tvb, offset), - pinfo, - atn_ulcs_tree, NULL); - - return offset + - tvb_reported_length_remaining(tvb, offset ); - } - return offset; + int offset = 0; + proto_item *ti = NULL; + proto_tree *atn_ulcs_tree = NULL; + guint8 value_pres = 0; + guint8 value_ses = 0; + guint16 value_ses_pres = 0; + + root_tree = tree; + + /* data pointer */ + /* decode as PDV-list */ + if ( (int)(intptr_t) data == FALSE ) + { + ti = proto_tree_add_item( + tree, + proto_atn_ulcs, + tvb, + 0, + 0 , + ENC_NA); + + atn_ulcs_tree = proto_item_add_subtree( + ti, + ett_atn_ulcs); + + dissect_Fully_encoded_data_PDU( + tvb, + pinfo, + atn_ulcs_tree, NULL); + + return offset + + tvb_reported_length_remaining(tvb, offset ) ; + } + + /* decode as SPDU, PPDU and ACSE PDU */ + if ( (int)(intptr_t) data == TRUE ) + { + /* get session and presentation PDU's */ + value_ses_pres = tvb_get_ntohs(tvb, offset); + + /* SPDU: dissect session layer */ + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_ses, NULL, ATN_SES_PROTO ); + + /* get SPDU (1 octet) */ + value_ses = tvb_get_guint8(tvb, offset); + + /* SPDU type/identifier */ + proto_tree_add_item(atn_ulcs_tree, + hf_atn_ses_type, + tvb, + offset, + 1, + ENC_BIG_ENDIAN ); + + /* SPDU parameters may be present in Short Refuse */ + /* or Short Refuse Continue SPDU's */ + switch(value_ses & SES_PDU_TYPE_MASK){ + case SES_ATN_SRF: + case SES_ATN_SRFC: + + /* SPDU parameter presence */ + proto_tree_add_item(atn_ulcs_tree, + hf_atn_ses_param_ind, + tvb, + offset, + 1, + ENC_BIG_ENDIAN ); + + /* parameter B2 */ + proto_tree_add_item(atn_ulcs_tree, + hf_atn_ses_param_b2, + tvb, + offset, + 1, + ENC_BIG_ENDIAN ); + + /* parameter B1 */ + proto_tree_add_item(atn_ulcs_tree, + hf_atn_ses_param_b1, + tvb, + offset, + 1, + ENC_BIG_ENDIAN ); + + break; + default: + break; + } + offset++; + + /* PPDU: dissect presentation layer */ + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_pres, NULL, ATN_PRES_PROTO ); + + value_pres = tvb_get_guint8(tvb, offset); + + /* need session context to identify PPDU type */ + /* note: */ + proto_tree_add_uint_format(atn_ulcs_tree, hf_atn_pres_pdu_type, + tvb, + offset, + 1, + value_ses_pres, + "%s (0x%02x)", + val_to_str( value_ses_pres & ATN_SES_PRES_MASK , atn_pres_vals, "?"), + value_pres); + + /* PPDU errorcode in case of SRF/CPR */ + switch(value_ses & SES_PDU_TYPE_MASK){ + case SES_ATN_SRF: + case SES_ATN_SRFC: + proto_tree_add_item( + atn_ulcs_tree, + hf_atn_pres_err, + tvb, + offset, + 1, + ENC_BIG_ENDIAN ); + break; + default: + break; + } + + offset++; + + /* ACSE PDU: dissect application layer */ + atn_ulcs_tree = proto_tree_add_subtree( + tree, tvb, offset, 0, + ett_atn_acse, NULL, ATN_ACSE_PROTO ); + + dissect_ACSE_apdu_PDU( + tvb_new_subset_remaining(tvb, offset), + pinfo, + atn_ulcs_tree, NULL); + + return offset + + tvb_reported_length_remaining(tvb, offset ); + } + return offset; } static gboolean dissect_atn_ulcs_heur( - tvbuff_t *tvb, - packet_info *pinfo, - proto_tree *tree, - void *data _U_) + tvbuff_t *tvb, + packet_info *pinfo, + proto_tree *tree, + void *data _U_) { - /* do we have enough data*/ - /* at least session + presentation data or pdv-list */ - if (tvb_captured_length(tvb) < 2){ - return FALSE; } - - /* check for session/presentation/ACSE PDU's */ - /* SPDU and PPDU are one octet each */ - switch( tvb_get_ntohs(tvb, 0) & 0xf8ff ){ - case 0xe802: /* SCN + CP*/ - case 0xf802: /* SCNC + CP */ - case 0xf002: /* SAC + CPA */ - case 0xd802: /* SACC + CPA */ - case 0xe002: /* SRF + CPR + R0 */ - case 0xe012: /* SRF + CPR + R1 */ - case 0xe022: /* SRF + CPR + R2 */ - case 0xe032: /* SRF + CPR + R3 */ - case 0xe042: /* SRF + CPR + R4 */ - case 0xe052: /* SRF + CPR + R5 */ - case 0xe062: /* SRF + CPR + R6 */ - case 0xe072: /* SRF + CPR + R7 */ - case 0xa002: /* SRFC + CPR + R0*/ - case 0xa012: /* SRFC + CPR + R1*/ - case 0xa022: /* SRFC + CPR + R2*/ - case 0xa032: /* SRFC + CPR + R3*/ - case 0xa042: /* SRFC + CPR + R4*/ - case 0xa052: /* SRFC + CPR + R5*/ - case 0xa062: /* SRFC + CPR + R6*/ - case 0xa072: /* SRFC + CPR + R7*/ - /* indicate to dissector routine */ - /* that a least SPDU, PPDU and */ - /* ACSE PDU is present */ - dissect_atn_ulcs( - tvb, - pinfo, - tree, - (void*) TRUE); - return TRUE; - default: /* no SPDU */ - break; - } - - /* try to detect "Fully-encoded-data" heuristically */ - /* the constants listed match the ASN.1 PER encoding */ - /* of PDV-List */ - switch( tvb_get_ntohs(tvb, 0) & 0xfff0 ){ - case 0x0020: /* acse-apdu */ - case 0x00a0: /* user-ase-apdu */ - /* indicate to dissector routine */ - /* that a PDV-list PDU is present */ - /* */ - /* PDV-list PDU may contain */ - /* application protocol data (CM, CPDLC) */ - /* or an ACSE PDU */ - dissect_atn_ulcs(tvb, pinfo, tree, (void*) FALSE); - return TRUE; - break; - default: /* no or unsupported PDU */ - break; - } - return FALSE; + /* do we have enough data*/ + /* at least session + presentation data or pdv-list */ + if (tvb_captured_length(tvb) < 2){ + return FALSE; } + + /* check for session/presentation/ACSE PDU's */ + /* SPDU and PPDU are one octet each */ + switch( tvb_get_ntohs(tvb, 0) & 0xf8ff ){ + case 0xe802: /* SCN + CP*/ + case 0xf802: /* SCNC + CP */ + case 0xf002: /* SAC + CPA */ + case 0xd802: /* SACC + CPA */ + case 0xe002: /* SRF + CPR + R0 */ + case 0xe012: /* SRF + CPR + R1 */ + case 0xe022: /* SRF + CPR + R2 */ + case 0xe032: /* SRF + CPR + R3 */ + case 0xe042: /* SRF + CPR + R4 */ + case 0xe052: /* SRF + CPR + R5 */ + case 0xe062: /* SRF + CPR + R6 */ + case 0xe072: /* SRF + CPR + R7 */ + case 0xa002: /* SRFC + CPR + R0*/ + case 0xa012: /* SRFC + CPR + R1*/ + case 0xa022: /* SRFC + CPR + R2*/ + case 0xa032: /* SRFC + CPR + R3*/ + case 0xa042: /* SRFC + CPR + R4*/ + case 0xa052: /* SRFC + CPR + R5*/ + case 0xa062: /* SRFC + CPR + R6*/ + case 0xa072: /* SRFC + CPR + R7*/ + /* indicate to dissector routine */ + /* that a least SPDU, PPDU and */ + /* ACSE PDU is present */ + dissect_atn_ulcs( + tvb, + pinfo, + tree, + (void*) TRUE); + return TRUE; + default: /* no SPDU */ + break; + } + + /* try to detect "Fully-encoded-data" heuristically */ + /* the constants listed match the ASN.1 PER encoding */ + /* of PDV-List */ + switch( tvb_get_ntohs(tvb, 0) & 0xfff0 ){ + case 0x0020: /* acse-apdu */ + case 0x00a0: /* user-ase-apdu */ + /* indicate to dissector routine */ + /* that a PDV-list PDU is present */ + /* */ + /* PDV-list PDU may contain */ + /* application protocol data (CM, CPDLC) */ + /* or an ACSE PDU */ + dissect_atn_ulcs(tvb, pinfo, tree, (void*) FALSE); + return TRUE; + break; + default: /* no or unsupported PDU */ + break; + } + return FALSE; } void proto_register_atn_ulcs (void) { - static hf_register_info hf_atn_ulcs[] = { + static hf_register_info hf_atn_ulcs[] = { /*--- Included file: packet-atn-ulcs-hfarr.c ---*/ #line 1 "../../asn1/atn-ulcs/packet-atn-ulcs-hfarr.c" @@ -2485,62 +2480,62 @@ void proto_register_atn_ulcs (void) NULL, HFILL }}, /*--- End of included file: packet-atn-ulcs-hfarr.c ---*/ -#line 793 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" - {&hf_atn_ses_type, - { "SPDU Type", - "atn-ulcs.ses.type", - FT_UINT8, - BASE_HEX, - VALS(atn_ses_type), - 0xf8, - "Indicates presence of session parameters", - HFILL}}, - {&hf_atn_ses_param_ind, - { "SPDU Parameter Indication", - "atn-ulcs.ses.parameter-indication", - FT_UINT8, - BASE_HEX, - VALS(atn_ses_param_ind), - SES_PARAM_IND_MASK, - "Indicates presence of session parameters", - HFILL}}, - {&hf_atn_ses_param_b1, - { "SRF Parameter B1", - "atn-ulcs.ses.srf-b1", - FT_UINT8, - BASE_HEX, - VALS(srf_b1), - 0x01, - "Determines if transport connection reject is transient or persistent", - HFILL}}, - {&hf_atn_ses_param_b2, - { "SRF Parameter B2", - "atn-ulcs.ses.srf-b2", - FT_UINT8, - BASE_HEX, - VALS(srf_b2), - 0x02, - "Determines if transport connection is retained or released", - HFILL}}, - { &hf_atn_pres_err, - { "Error Code", "atn-ulcs.pres.cpr-error", - FT_UINT8, - BASE_HEX, - VALS(atn_pres_err), - PRES_CPR_ER_MASK, - NULL, - HFILL}}, - { &hf_atn_pres_pdu_type, - { "PDU type", "atn-ulcs.pres.pdu_type", - FT_UINT8, - BASE_HEX, - NULL, - ATN_SES_PRES_MASK, - NULL, - HFILL}}, - }; - - static gint *ett[] = { +#line 788 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" + {&hf_atn_ses_type, + { "SPDU Type", + "atn-ulcs.ses.type", + FT_UINT8, + BASE_HEX, + VALS(atn_ses_type), + 0xf8, + "Indicates presence of session parameters", + HFILL}}, + {&hf_atn_ses_param_ind, + { "SPDU Parameter Indication", + "atn-ulcs.ses.parameter-indication", + FT_UINT8, + BASE_HEX, + VALS(atn_ses_param_ind), + SES_PARAM_IND_MASK, + "Indicates presence of session parameters", + HFILL}}, + {&hf_atn_ses_param_b1, + { "SRF Parameter B1", + "atn-ulcs.ses.srf-b1", + FT_UINT8, + BASE_HEX, + VALS(srf_b1), + 0x01, + "Determines if transport connection reject is transient or persistent", + HFILL}}, + {&hf_atn_ses_param_b2, + { "SRF Parameter B2", + "atn-ulcs.ses.srf-b2", + FT_UINT8, + BASE_HEX, + VALS(srf_b2), + 0x02, + "Determines if transport connection is retained or released", + HFILL}}, + { &hf_atn_pres_err, + { "Error Code", "atn-ulcs.pres.cpr-error", + FT_UINT8, + BASE_HEX, + VALS(atn_pres_err), + PRES_CPR_ER_MASK, + NULL, + HFILL}}, + { &hf_atn_pres_pdu_type, + { "PDU type", "atn-ulcs.pres.pdu_type", + FT_UINT8, + BASE_HEX, + NULL, + ATN_SES_PRES_MASK, + NULL, + HFILL}}, + }; + + static gint *ett[] = { /*--- Included file: packet-atn-ulcs-ettarr.c ---*/ #line 1 "../../asn1/atn-ulcs/packet-atn-ulcs-ettarr.c" @@ -2571,64 +2566,64 @@ void proto_register_atn_ulcs (void) &ett_atn_ulcs_AttributeTypeAndValue, /*--- End of included file: packet-atn-ulcs-ettarr.c ---*/ -#line 849 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" - &ett_atn_ses, - &ett_atn_pres, - &ett_atn_acse, - &ett_atn_ulcs - }; +#line 844 "../../asn1/atn-ulcs/packet-atn-ulcs-template.c" + &ett_atn_ses, + &ett_atn_pres, + &ett_atn_acse, + &ett_atn_ulcs + }; - proto_atn_ulcs = proto_register_protocol ( - ATN_ULCS_PROTO , - "ATN-ULCS", - "atn-ulcs"); + proto_atn_ulcs = proto_register_protocol ( + ATN_ULCS_PROTO , + "ATN-ULCS", + "atn-ulcs"); - proto_register_field_array ( - proto_atn_ulcs, - hf_atn_ulcs, - array_length(hf_atn_ulcs)); + proto_register_field_array ( + proto_atn_ulcs, + hf_atn_ulcs, + array_length(hf_atn_ulcs)); - proto_register_subtree_array ( - ett, - array_length (ett)); + proto_register_subtree_array ( + ett, + array_length (ett)); - new_register_dissector( - "atn-ulcs", - dissect_atn_ulcs, - proto_atn_ulcs); + new_register_dissector( + "atn-ulcs", + dissect_atn_ulcs, + proto_atn_ulcs); - atn_cm_handle = find_dissector("atn-cm"); - atn_cpdlc_handle = find_dissector("atn-cpdlc"); + atn_cm_handle = find_dissector("atn-cm"); + atn_cpdlc_handle = find_dissector("atn-cpdlc"); - /* initiate sub dissector list */ - atn_ulcs_heur_subdissector_list = register_heur_dissector_list("atn-ulcs"); + /* initiate sub dissector list */ + atn_ulcs_heur_subdissector_list = register_heur_dissector_list("atn-ulcs"); - /* init aare/aare data */ - aarq_data_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); + /* init aare/aare data */ + aarq_data_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); - atn_conversation_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); + atn_conversation_tree = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); } void proto_reg_handoff_atn_ulcs(void) { - /* add session dissector to cotp dissector list dissector list*/ - heur_dissector_add( - "cotp", - dissect_atn_ulcs_heur, - "ATN-ULCS over COTP", - "atn-ucls_cotp", - proto_atn_ulcs, HEURISTIC_ENABLE); + /* add session dissector to cotp dissector list dissector list*/ + heur_dissector_add( + "cotp", + dissect_atn_ulcs_heur, + "ATN-ULCS over COTP", + "atn-ucls_cotp", + proto_atn_ulcs, HEURISTIC_ENABLE); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: - * c-basic-offset: 2 - * tab-width: 2 - * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ diff --git a/epan/dissectors/packet-atn-ulcs.h b/epan/dissectors/packet-atn-ulcs.h index f20975f545..6a4c3103e0 100644 --- a/epan/dissectors/packet-atn-ulcs.h +++ b/epan/dissectors/packet-atn-ulcs.h @@ -6,11 +6,6 @@ /* Input file: packet-atn-ulcs-template.h */ #line 1 "../../asn1/atn-ulcs/packet-atn-ulcs-template.h" -/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: t - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: - */ - /* packet-atn-ulcs.h * Definitions for atn packet disassembly structures and routines * @@ -43,49 +38,49 @@ /* IA5 charset (7-bit) for PER IA5 decoding */ static const gchar 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, \ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, \ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, \ - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, \ - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, \ - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, \ - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, '\0' + 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, \ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, \ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, \ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, \ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, \ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, \ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, '\0' }; enum msg_type { - um, - dm, - no_msg + um, + dm, + no_msg }; enum ae_qualifier { - ads = 0, - cma =1, /* contact management (CM) */ - cpdlc = 2, /* "plain old" CPDLC */ - ati = 3 , - arf =10 , - met =11, - gac =12, - pmcpdlc =22, /* "protected mode" CPDLC */ - unknown = -1 + ads = 0, + cma =1, /* contact management (CM) */ + cpdlc = 2, /* "plain old" CPDLC */ + ati = 3 , + arf =10 , + met =11, + gac =12, + pmcpdlc =22, /* "protected mode" CPDLC */ + unknown = -1 }; typedef struct atn_conversation_t { - gint ae_qualifier; /* A/G application type */ + gint ae_qualifier; /* A/G application type */ } atn_conversation_t; atn_conversation_t * create_atn_conversation( - address*, - guint16, - address*, - atn_conversation_t*); + address*, + guint16, + address*, + atn_conversation_t*); atn_conversation_t * find_atn_conversation( - address*, - guint16, - address*); + address*, + guint16, + address*); /* struct for conversation data reconstruction used in AARQ and AARE */ /* if transport data is larger than 32 octets AARQ/AARE is contained */ @@ -93,11 +88,11 @@ atn_conversation_t * find_atn_conversation( /* if AARQ/AARQ is contained within CR/CC only src_ref is present in CR */ /* while CC provides src_ref and dstref */ typedef struct aarq_data_t { - gboolean aarq_pending; /* flag tells whether AARQ/sequence is pending (true) */ - /* required not to mix up different AARQ/AARE sequences */ - /* during simoultanous establishment of transport connections */ - /* i.e. GND facility initialises cpcstart and cmcontact at the same time */ - atn_conversation_t* cv; /* pointer to AARQ conversation */ + gboolean aarq_pending; /* flag tells whether AARQ/sequence is pending (true) */ + /* required not to mix up different AARQ/AARE sequences */ + /* during simoultanous establishment of transport connections */ + /* i.e. GND facility initialises cpcstart and cmcontact at the same time */ + atn_conversation_t* cv; /* pointer to AARQ conversation */ } aarq_data_t; wmem_tree_t *get_atn_conversation_tree(void); @@ -111,11 +106,11 @@ int check_heur_msg_type(packet_info *); * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: - * c-basic-offset: 2 - * tab-width: 2 - * indent-tabs-mode: t + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil * End: * - * vi: set shiftwidth=2 tabstop=2 noexpandtab: - * :indentSize=2:tabSize=2:noTabs=false: + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: */ |