diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-01-29 19:58:37 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-01-31 01:21:07 +0000 |
commit | 60a752eed672087338eb4718cf2dcc4daba58324 (patch) | |
tree | c36997eb7c7989d52ac2fa26de9a44478396361a /epan/dissectors/packet-lcsap.c | |
parent | 1b481f31b1ec16028f72d5c7cab4a877343d27b3 (diff) |
LCSAP: fix indent (use 2 spaces and add modelines)
Change-Id: I2aa1a2d0e20cca6c979d51135e7fe9ea7a084847
Reviewed-on: https://code.wireshark.org/review/13609
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-lcsap.c')
-rw-r--r-- | epan/dissectors/packet-lcsap.c | 286 |
1 files changed, 147 insertions, 139 deletions
diff --git a/epan/dissectors/packet-lcsap.c b/epan/dissectors/packet-lcsap.c index f30cc14f7b..6431dcffa5 100644 --- a/epan/dissectors/packet-lcsap.c +++ b/epan/dissectors/packet-lcsap.c @@ -317,87 +317,87 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p * Coding of positioning method (bits 8-4) */ static const value_string lcsap_pos_method_vals[] = { - { 0x00, "Cell ID" }, - { 0x01, "Reserved" }, - { 0x02, "E-CID" }, - { 0x03, "Reserved" }, - { 0x04, "OTDOA" }, - { 0x05, "Reserved" }, - { 0x06, "Reserved" }, - { 0x07, "Reserved" }, - { 0x08, "U-TDOA" }, - { 0x09, "Reserved" }, - { 0x0a, "Reserved" }, - { 0x0b, "Reserved" }, - { 0x0c, "Reserved for other location technologies" }, - { 0x0d, "Reserved for other location technologies" }, - { 0x0e, "Reserved for other location technologies" }, - { 0x0f, "Reserved for other location technologies" }, - { 0x10, "Reserved for network specific positioning methods" }, - { 0x11, "Reserved for network specific positioning methods" }, - { 0x12, "Reserved for network specific positioning methods" }, - { 0x13, "Reserved for network specific positioning methods" }, - { 0x14, "Reserved for network specific positioning methods" }, - { 0x15, "Reserved for network specific positioning methods" }, - { 0x16, "Reserved for network specific positioning methods" }, - { 0x17, "Reserved for network specific positioning methods" }, - { 0x18, "Reserved for network specific positioning methods" }, - { 0x19, "Reserved for network specific positioning methods" }, - { 0x1a, "Reserved for network specific positioning methods" }, - { 0x1b, "Reserved for network specific positioning methods" }, - { 0x1c, "RReserved for network specific positioning methods" }, - { 0x1d, "Reserved for network specific positioning methods" }, - { 0x1e, "Reserved for network specific positioning methods" }, - { 0x0f, "Reserved for network specific positioning methods" }, - { 0, NULL } + { 0x00, "Cell ID" }, + { 0x01, "Reserved" }, + { 0x02, "E-CID" }, + { 0x03, "Reserved" }, + { 0x04, "OTDOA" }, + { 0x05, "Reserved" }, + { 0x06, "Reserved" }, + { 0x07, "Reserved" }, + { 0x08, "U-TDOA" }, + { 0x09, "Reserved" }, + { 0x0a, "Reserved" }, + { 0x0b, "Reserved" }, + { 0x0c, "Reserved for other location technologies" }, + { 0x0d, "Reserved for other location technologies" }, + { 0x0e, "Reserved for other location technologies" }, + { 0x0f, "Reserved for other location technologies" }, + { 0x10, "Reserved for network specific positioning methods" }, + { 0x11, "Reserved for network specific positioning methods" }, + { 0x12, "Reserved for network specific positioning methods" }, + { 0x13, "Reserved for network specific positioning methods" }, + { 0x14, "Reserved for network specific positioning methods" }, + { 0x15, "Reserved for network specific positioning methods" }, + { 0x16, "Reserved for network specific positioning methods" }, + { 0x17, "Reserved for network specific positioning methods" }, + { 0x18, "Reserved for network specific positioning methods" }, + { 0x19, "Reserved for network specific positioning methods" }, + { 0x1a, "Reserved for network specific positioning methods" }, + { 0x1b, "Reserved for network specific positioning methods" }, + { 0x1c, "RReserved for network specific positioning methods" }, + { 0x1d, "Reserved for network specific positioning methods" }, + { 0x1e, "Reserved for network specific positioning methods" }, + { 0x0f, "Reserved for network specific positioning methods" }, + { 0, NULL } }; /* Coding of usage (bits 3-1)*/ static const value_string lcsap_pos_usage_vals[] = { - { 0x00, "Attempted unsuccessfully due to failure or interruption - not used" }, - { 0x01, "Attempted successfully: results not used to generate location - not used." }, - { 0x02, "Attempted successfully: results used to verify but not generate location - not used." }, - { 0x03, "Attempted successfully: results used to generate location" }, - { 0x04, "Attempted successfully: case where UE supports multiple mobile based positioning methods and the actual method or methods used by the UE cannot be determined." }, - { 0x05, "Reserved" }, - { 0x06, "Reserved" }, - { 0x07, "Reserved" }, - { 0, NULL } + { 0x00, "Attempted unsuccessfully due to failure or interruption - not used" }, + { 0x01, "Attempted successfully: results not used to generate location - not used." }, + { 0x02, "Attempted successfully: results used to verify but not generate location - not used." }, + { 0x03, "Attempted successfully: results used to generate location" }, + { 0x04, "Attempted successfully: case where UE supports multiple mobile based positioning methods and the actual method or methods used by the UE cannot be determined." }, + { 0x05, "Reserved" }, + { 0x06, "Reserved" }, + { 0x07, "Reserved" }, + { 0, NULL } }; /* Coding of Method (Bits 8-7) */ static const value_string lcsap_gnss_pos_method_vals[] = { - { 0x00, "UE-Based" }, - { 0x01, "UE-Assisted" }, - { 0x02, "Conventional" }, - { 0x03, "Reserved" }, - { 0, NULL } + { 0x00, "UE-Based" }, + { 0x01, "UE-Assisted" }, + { 0x02, "Conventional" }, + { 0x03, "Reserved" }, + { 0, NULL } }; /* Coding of GNSS ID (Bits 6-4) */ static const value_string lcsap_gnss_id_vals[] = { - { 0x00, "GPS" }, - { 0x01, "Galileo" }, - { 0x02, "SBAS" }, - { 0x03, "Modernized GPS" }, - { 0x04, "QZSS" }, - { 0x05, "GLONASS" }, - { 0x06, "Reserved" }, - { 0x07, "Reserved" }, - { 0, NULL } + { 0x00, "GPS" }, + { 0x01, "Galileo" }, + { 0x02, "SBAS" }, + { 0x03, "Modernized GPS" }, + { 0x04, "QZSS" }, + { 0x05, "GLONASS" }, + { 0x06, "Reserved" }, + { 0x07, "Reserved" }, + { 0, NULL } }; /* Coding of usage (bits 3- 1) */ static const value_string lcsap_gnss_pos_usage_vals[] = { - { 0x00, "Attempted unsuccessfully due to failure or interruption" }, - { 0x01, "Attempted successfully: results not used to generate location" }, - { 0x02, "Attempted successfully: results used to verify but not generate location" }, - { 0x03, "Attempted successfully: results used to generate location" }, - { 0x04, "Attempted successfully: case where UE supports multiple mobile based positioning methods and the actual method or methods used by the UE cannot be determined." }, - { 0x05, "Reserved" }, - { 0x06, "Reserved" }, - { 0x07, "Reserved" }, - { 0, NULL } + { 0x00, "Attempted unsuccessfully due to failure or interruption" }, + { 0x01, "Attempted successfully: results not used to generate location" }, + { 0x02, "Attempted successfully: results used to verify but not generate location" }, + { 0x03, "Attempted successfully: results used to generate location" }, + { 0x04, "Attempted successfully: case where UE supports multiple mobile based positioning methods and the actual method or methods used by the UE cannot be determined." }, + { 0x05, "Reserved" }, + { 0x06, "Reserved" }, + { 0x07, "Reserved" }, + { 0, NULL } }; @@ -439,25 +439,22 @@ dissect_lcsap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx #line 98 "../../asn1/lcsap/lcsap.cnf" - { - guint8 tmp = tvb_get_guint8(tvb, 0); + { + guint8 tmp = tvb_get_guint8(tvb, 0); - if(tmp == 0) + if(tmp == 0) - col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq", - val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, - "unknown message")); + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); - else if(tmp == 32) - col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sResp", - val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, - "unknown message")); - else - col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s", - val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, - "unknown message")); + else if(tmp == 32) + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sResp", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); + else + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); - } + } return offset; @@ -731,7 +728,7 @@ dissect_lcsap_Correlation_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_lcsap_DegreesLatitude(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 204 "../../asn1/lcsap/lcsap.cnf" +#line 201 "../../asn1/lcsap/lcsap.cnf" gint32 degrees; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, @@ -748,13 +745,13 @@ dissect_lcsap_DegreesLatitude(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act static int dissect_lcsap_DegreesLongitude(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 212 "../../asn1/lcsap/lcsap.cnf" +#line 209 "../../asn1/lcsap/lcsap.cnf" gint32 degrees; - offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, + offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, -8388608, 8388607U, °rees, FALSE); - proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360)); + proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360)); @@ -766,7 +763,7 @@ dissect_lcsap_DegreesLongitude(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac static int dissect_lcsap_PLMN_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 156 "../../asn1/lcsap/lcsap.cnf" +#line 153 "../../asn1/lcsap/lcsap.cnf" tvbuff_t *parameter_tvb=NULL; proto_tree *subtree; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, @@ -836,13 +833,13 @@ dissect_lcsap_Geographical_Coordinates(tvbuff_t *tvb _U_, int offset _U_, asn1_c static int dissect_lcsap_Uncertainty_Code(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 196 "../../asn1/lcsap/lcsap.cnf" +#line 193 "../../asn1/lcsap/lcsap.cnf" guint32 uncertainty_code; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, &uncertainty_code, FALSE); - proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1)); + proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1)); @@ -1130,19 +1127,19 @@ dissect_lcsap_Global_eNB_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static int dissect_lcsap_GNSS_Positioning_Method_And_Usage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 182 "../../asn1/lcsap/lcsap.cnf" +#line 179 "../../asn1/lcsap/lcsap.cnf" tvbuff_t *parameter_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 1, FALSE, ¶meter_tvb); - if (!parameter_tvb) - return offset; + if (!parameter_tvb) + return offset; - proto_tree_add_item(tree, hf_lcsap_gnss_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_lcsap_gnss_id, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_lcsap_gnss_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_gnss_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_gnss_id, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_gnss_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); @@ -1167,7 +1164,7 @@ dissect_lcsap_GNSS_Positioning_Data_Set(tvbuff_t *tvb _U_, int offset _U_, asn1_ static int dissect_lcsap_Horizontal_Accuracy(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 230 "../../asn1/lcsap/lcsap.cnf" +#line 227 "../../asn1/lcsap/lcsap.cnf" guint32 uncertainty_code; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, &uncertainty_code, FALSE); @@ -1175,7 +1172,7 @@ dissect_lcsap_Horizontal_Accuracy(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t -#line 234 "../../asn1/lcsap/lcsap.cnf" +#line 231 "../../asn1/lcsap/lcsap.cnf" proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1)); @@ -1327,7 +1324,7 @@ dissect_lcsap_Horizontal_With_Vertical_Velocity_And_Uncertainty(tvbuff_t *tvb _U static int dissect_lcsap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 220 "../../asn1/lcsap/lcsap.cnf" +#line 217 "../../asn1/lcsap/lcsap.cnf" tvbuff_t *imsi_tvb; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 3, 8, FALSE, &imsi_tvb); @@ -1534,7 +1531,7 @@ dissect_lcsap_Vertical_Requested(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t * static int dissect_lcsap_Vertical_Accuracy(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 237 "../../asn1/lcsap/lcsap.cnf" +#line 234 "../../asn1/lcsap/lcsap.cnf" guint32 vertical_uncertainty; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 127U, &vertical_uncertainty, FALSE); @@ -1542,7 +1539,7 @@ dissect_lcsap_Vertical_Accuracy(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a -#line 241 "../../asn1/lcsap/lcsap.cnf" +#line 238 "../../asn1/lcsap/lcsap.cnf" proto_item_append_text(actx->created_item, " (%.1f m)", 45 * (pow(1.025, (double)vertical_uncertainty) - 1)); @@ -1648,18 +1645,18 @@ dissect_lcsap_Payload_Type(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ static int dissect_lcsap_Positioning_Method_And_Usage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 170 "../../asn1/lcsap/lcsap.cnf" +#line 167 "../../asn1/lcsap/lcsap.cnf" tvbuff_t *parameter_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, 1, 1, FALSE, ¶meter_tvb); - if (!parameter_tvb) - return offset; + if (!parameter_tvb) + return offset; - proto_tree_add_item(tree, hf_lcsap_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_lcsap_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); @@ -2267,35 +2264,35 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p static int dissect_lcsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - proto_item *lcsap_item = NULL; - proto_tree *lcsap_tree = NULL; + proto_item *lcsap_item = NULL; + proto_tree *lcsap_tree = NULL; - /* make entry in the Protocol column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, "LCSAP"); + /* make entry in the Protocol column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, "LCSAP"); - /* create the lcsap protocol tree */ - lcsap_item = proto_tree_add_item(tree, proto_lcsap, tvb, 0, -1, ENC_NA); - lcsap_tree = proto_item_add_subtree(lcsap_item, ett_lcsap); + /* create the lcsap protocol tree */ + lcsap_item = proto_tree_add_item(tree, proto_lcsap, tvb, 0, -1, ENC_NA); + lcsap_tree = proto_item_add_subtree(lcsap_item, ett_lcsap); - dissect_LCS_AP_PDU_PDU(tvb, pinfo, lcsap_tree, NULL); - return tvb_captured_length(tvb); + dissect_LCS_AP_PDU_PDU(tvb, pinfo, lcsap_tree, NULL); + return tvb_captured_length(tvb); } /*--- proto_reg_handoff_lcsap ---------------------------------------*/ void proto_reg_handoff_lcsap(void) { - static gboolean Initialized=FALSE; - static dissector_handle_t lcsap_handle; - static guint SctpPort; - - if (!Initialized) { - lcsap_handle = find_dissector("lcsap"); - lpp_handle = find_dissector("lpp"); - lppa_handle = find_dissector("lppa"); - dissector_add_for_decode_as("sctp.port", lcsap_handle); /* for "decode-as" */ - dissector_add_uint("sctp.ppi", LCS_AP_PAYLOAD_PROTOCOL_ID, lcsap_handle); - Initialized=TRUE; + static gboolean Initialized=FALSE; + static dissector_handle_t lcsap_handle; + static guint SctpPort; + + if (!Initialized) { + lcsap_handle = find_dissector("lcsap"); + lpp_handle = find_dissector("lpp"); + lppa_handle = find_dissector("lppa"); + dissector_add_for_decode_as("sctp.port", lcsap_handle); /* for "decode-as" */ + dissector_add_uint("sctp.ppi", LCS_AP_PAYLOAD_PROTOCOL_ID, lcsap_handle); + Initialized=TRUE; /*--- Included file: packet-lcsap-dis-tab.c ---*/ #line 1 "../../asn1/lcsap/packet-lcsap-dis-tab.c" @@ -2336,16 +2333,16 @@ proto_reg_handoff_lcsap(void) /*--- End of included file: packet-lcsap-dis-tab.c ---*/ #line 251 "../../asn1/lcsap/packet-lcsap-template.c" - } else { - if (SctpPort != 0) { - dissector_delete_uint("sctp.port", SctpPort, lcsap_handle); - } - } + } else { + if (SctpPort != 0) { + dissector_delete_uint("sctp.port", SctpPort, lcsap_handle); + } + } - SctpPort=gbl_lcsapSctpPort; - if (SctpPort != 0) { - dissector_add_uint("sctp.port", SctpPort, lcsap_handle); - } + SctpPort=gbl_lcsapSctpPort; + if (SctpPort != 0) { + dissector_add_uint("sctp.port", SctpPort, lcsap_handle); + } } /*--- proto_register_lcsap -------------------------------------------*/ @@ -2353,32 +2350,32 @@ void proto_register_lcsap(void) { /* List of fields */ static hf_register_info hf[] = { - /* 7.4.13 Positioning Data */ + /* 7.4.13 Positioning Data */ { &hf_lcsap_pos_method, { "Positioning Method", "lcsap.pos_method", FT_UINT8, BASE_DEC, VALS(lcsap_pos_method_vals), 0xf8, NULL, HFILL } - }, + }, { &hf_lcsap_pos_usage, { "Positioning usage", "lcsap.pos_usage", FT_UINT8, BASE_DEC, VALS(lcsap_pos_usage_vals), 0x07, NULL, HFILL } - }, + }, { &hf_lcsap_gnss_pos_method, { "GNSS Positioning Method", "lcsap.gnss_pos_method", FT_UINT8, BASE_DEC, VALS(lcsap_gnss_pos_method_vals), 0xc0, NULL, HFILL } - }, + }, { &hf_lcsap_gnss_id, { "GNSS ID", "lcsap.gnss_id", FT_UINT8, BASE_DEC, VALS(lcsap_gnss_id_vals), 0x38, NULL, HFILL } - }, + }, { &hf_lcsap_gnss_pos_usage, { "GNSS Positioning usage", "lcsap.gnss_pos_usage", FT_UINT8, BASE_DEC, VALS(lcsap_gnss_pos_usage_vals), 0x07, NULL, HFILL } - }, + }, /*--- Included file: packet-lcsap-hfarr.c ---*/ @@ -2908,4 +2905,15 @@ void proto_register_lcsap(void) { } - +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 2 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=2 tabstop=8 expandtab: + * :indentSize=2:tabSize=8:noTabs=true: + */ |