diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-04-20 17:47:59 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-04-21 00:48:40 +0000 |
commit | 6c6aeb1841a7cd65e77e8729dde4e7ba25e327ad (patch) | |
tree | 7bff6cb9dae4f33b1d9ef92ff026671ee8c835bc /asn1/sabp | |
parent | fde8ef07135c1b057fcf83fab40ebd0a3572a6b6 (diff) | |
download | wireshark-6c6aeb1841a7cd65e77e8729dde4e7ba25e327ad.tar.gz wireshark-6c6aeb1841a7cd65e77e8729dde4e7ba25e327ad.tar.bz2 wireshark-6c6aeb1841a7cd65e77e8729dde4e7ba25e327ad.zip |
Fix various white space issues and typoes and regenerate SABP dissector.
Change-Id: Ic036dcbb36b2f0e1eda46062867b762d150b78e0
Reviewed-on: https://code.wireshark.org/review/1232
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'asn1/sabp')
-rw-r--r-- | asn1/sabp/SABP-PDU-Descriptions.asn | 4 | ||||
-rw-r--r-- | asn1/sabp/packet-sabp-template.c | 178 |
2 files changed, 88 insertions, 94 deletions
diff --git a/asn1/sabp/SABP-PDU-Descriptions.asn b/asn1/sabp/SABP-PDU-Descriptions.asn index 135eea9363..7583f0ddd4 100644 --- a/asn1/sabp/SABP-PDU-Descriptions.asn +++ b/asn1/sabp/SABP-PDU-Descriptions.asn @@ -76,9 +76,7 @@ SABP-ELEMENTARY-PROCEDURE ::= CLASS { } WITH SYNTAX { INITIATING MESSAGE &InitiatingMessage - [SUCCESSFUL OUTCOME - -&SuccessfulOutcome] + [SUCCESSFUL OUTCOME &SuccessfulOutcome] [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] PROCEDURE CODE &procedureCode [CRITICALITY &criticality] diff --git a/asn1/sabp/packet-sabp-template.c b/asn1/sabp/packet-sabp-template.c index e7811cbbb4..a987770203 100644 --- a/asn1/sabp/packet-sabp-template.c +++ b/asn1/sabp/packet-sabp-template.c @@ -1,5 +1,5 @@ -/* packet-sbap.c - * Routines for UTRAN Iu-BC Interface: Service Area Broadcast Protocol (SBAP) packet dissection +/* packet-sabp.c + * Routines for UTRAN Iu-BC Interface: Service Area Broadcast Protocol (SABP) packet dissection * Copyright 2007, Tomas Kukosa <tomas.kukosa@siemens.com> * * Wireshark - Network traffic analyzer @@ -125,105 +125,103 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p static void dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *item, *cbs_page_item; - proto_tree *subtree; - tvbuff_t *page_tvb, *unpacked_tvb; - int offset = 0; - int n; - guint8 nr_pages, len, cb_inf_msg_len; - - - /* Octet 1 Number-of-Pages */ - nr_pages = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tree, hf_sabp_no_of_pages, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - /* - * NOTE: n equal to or less than 15 - */ - if(nr_pages > 15){ - /* Error */ - return; - } - for (n = 0; n < nr_pages; n++) { - item = proto_tree_add_text(tree, tvb, offset, 83, "CB page %u data", n+1); - subtree = proto_item_add_subtree(item, ett_sabp_cbs_page); - /* octet 2 - 83 CBS-Message-Information-Page 1 */ - cbs_page_item = proto_tree_add_item(subtree, hf_sabp_cb_msg_inf_page, tvb, offset, 82, ENC_BIG_ENDIAN); - cb_inf_msg_len = tvb_get_guint8(tvb,offset+82); - page_tvb = tvb_new_subset(tvb, offset, cb_inf_msg_len, cb_inf_msg_len); - unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0); - len = tvb_length(unpacked_tvb); - if (unpacked_tvb != NULL){ - if (tree != NULL){ - proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content); - proto_tree_add_item(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, ENC_UTF_8|ENC_NA); - } - } - - offset = offset+82; - /* 84 CBS-Message-Information-Length 1 */ - proto_tree_add_item(subtree, hf_sabp_cb_inf_len, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - } - - + proto_item *item, *cbs_page_item; + proto_tree *subtree; + tvbuff_t *page_tvb, *unpacked_tvb; + int offset = 0; + int n; + guint8 nr_pages, len, cb_inf_msg_len; + + + /* Octet 1 Number-of-Pages */ + nr_pages = tvb_get_guint8(tvb, offset); + proto_tree_add_item(tree, hf_sabp_no_of_pages, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + /* + * NOTE: n equal to or less than 15 + */ + if(nr_pages > 15){ + /* Error */ + return; + } + for (n = 0; n < nr_pages; n++) { + item = proto_tree_add_text(tree, tvb, offset, 83, "CB page %u data", n+1); + subtree = proto_item_add_subtree(item, ett_sabp_cbs_page); + /* octet 2 - 83 CBS-Message-Information-Page 1 */ + cbs_page_item = proto_tree_add_item(subtree, hf_sabp_cb_msg_inf_page, tvb, offset, 82, ENC_BIG_ENDIAN); + cb_inf_msg_len = tvb_get_guint8(tvb,offset+82); + page_tvb = tvb_new_subset(tvb, offset, cb_inf_msg_len, cb_inf_msg_len); + unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0); + len = tvb_length(unpacked_tvb); + if (unpacked_tvb != NULL){ + if (tree != NULL){ + proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content); + proto_tree_add_item(cbs_page_subtree, hf_sabp_cbs_page_content, unpacked_tvb, 0, len, ENC_UTF_8|ENC_NA); + } + } + + offset = offset+82; + /* 84 CBS-Message-Information-Length 1 */ + proto_tree_add_item(subtree, hf_sabp_cb_inf_len, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + } } static guint get_sabp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { - guint32 type_length; - int bit_offset; - asn1_ctx_t asn1_ctx; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); - - /* Length should be in the 3:d octet */ - offset = offset + 3; - - bit_offset = offset<<3; - /* Get the length of the sabp packet. offset in bits */ - dissect_per_length_determinant(tvb, bit_offset, &asn1_ctx, NULL, -1, &type_length); - - /* - * Return the length of the PDU - * which is 3 + the length of the length, we only care about length up to 16K - * ("n" less than 128) a single octet containing "n" with bit 8 set to zero; - * ("n" less than 16K) two octets containing "n" with bit 8 of the first octet set to 1 and bit 7 set to zero; - */ - if (type_length < 128) - return type_length+4; - - return type_length+5; + guint32 type_length; + int bit_offset; + asn1_ctx_t asn1_ctx; + asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); + + /* Length should be in the 3:d octet */ + offset = offset + 3; + + bit_offset = offset<<3; + /* Get the length of the sabp packet. offset in bits */ + dissect_per_length_determinant(tvb, bit_offset, &asn1_ctx, NULL, -1, &type_length); + + /* + * Return the length of the PDU + * which is 3 + the length of the length, we only care about length up to 16K + * ("n" less than 128) a single octet containing "n" with bit 8 set to zero; + * ("n" less than 16K) two octets containing "n" with bit 8 of the first octet set to 1 and bit 7 set to zero; + */ + if (type_length < 128) + return type_length+4; + + return type_length+5; } static int dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - proto_item *sabp_item = NULL; - proto_tree *sabp_tree = NULL; + proto_item *sabp_item = NULL; + proto_tree *sabp_tree = NULL; - /* make entry in the Protocol column on summary display */ - col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); + /* make entry in the Protocol column on summary display */ + col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME); - /* create the sbap protocol tree */ - sabp_item = proto_tree_add_item(tree, proto_sabp, tvb, 0, -1, ENC_NA); - sabp_tree = proto_item_add_subtree(sabp_item, ett_sabp); + /* create the sabp protocol tree */ + sabp_item = proto_tree_add_item(tree, proto_sabp, tvb, 0, -1, ENC_NA); + sabp_tree = proto_item_add_subtree(sabp_item, ett_sabp); - dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree, NULL); - return tvb_length(tvb); + dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree, NULL); + return tvb_length(tvb); } /* Note a little bit of a hack assumes length max takes two bytes and that the length starts at byte 4 */ static int dissect_sabp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - tcp_dissect_pdus(tvb, pinfo, tree, gbl_sabp_desegment, 5, - get_sabp_pdu_len, dissect_sabp, data); - return tvb_length(tvb); + tcp_dissect_pdus(tvb, pinfo, tree, gbl_sabp_desegment, 5, + get_sabp_pdu_len, dissect_sabp, data); + return tvb_length(tvb); } -/*--- proto_register_sbap -------------------------------------------*/ +/*--- proto_register_sabp -------------------------------------------*/ void proto_register_sabp(void) { /* List of fields */ @@ -251,14 +249,14 @@ void proto_register_sabp(void) { /* List of subtrees */ static gint *ett[] = { - &ett_sabp, - &ett_sabp_e212, - &ett_sabp_cbs_data_coding, - &ett_sabp_bcast_msg, - &ett_sabp_cbs_serial_number, - &ett_sabp_cbs_new_serial_number, - &ett_sabp_cbs_page, - &ett_sabp_cbs_page_content, + &ett_sabp, + &ett_sabp_e212, + &ett_sabp_cbs_data_coding, + &ett_sabp_bcast_msg, + &ett_sabp_cbs_serial_number, + &ett_sabp_cbs_new_serial_number, + &ett_sabp_cbs_page, + &ett_sabp_cbs_page_content, #include "packet-sabp-ettarr.c" }; @@ -279,11 +277,10 @@ void proto_register_sabp(void) { sabp_proc_imsg_dissector_table = register_dissector_table("sabp.proc.imsg", "SABP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_UINT32, BASE_DEC); sabp_proc_sout_dissector_table = register_dissector_table("sabp.proc.sout", "SABP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_UINT32, BASE_DEC); sabp_proc_uout_dissector_table = register_dissector_table("sabp.proc.uout", "SABP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_UINT32, BASE_DEC); - } -/*--- proto_reg_handoff_sbap ---------------------------------------*/ +/*--- proto_reg_handoff_sabp ---------------------------------------*/ void proto_reg_handoff_sabp(void) { @@ -294,10 +291,9 @@ proto_reg_handoff_sabp(void) sabp_tcp_handle = find_dissector("sabp.tcp"); dissector_add_uint("udp.port", 3452, sabp_handle); dissector_add_uint("tcp.port", 3452, sabp_tcp_handle); - dissector_add_uint("sctp.ppi", SABP_PAYLOAD_PROTOCOL_ID, sabp_handle); + dissector_add_uint("sctp.ppi", SABP_PAYLOAD_PROTOCOL_ID, sabp_handle); #include "packet-sabp-dis-tab.c" - } |