diff options
-rw-r--r-- | docbook/release-notes.xml | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-btl2cap.c | 117 | ||||
-rw-r--r-- | epan/dissectors/packet-fclctl.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-sctp.c | 3 | ||||
-rw-r--r-- | epan/sctpppids.h | 3 |
5 files changed, 76 insertions, 55 deletions
diff --git a/docbook/release-notes.xml b/docbook/release-notes.xml index 26d3c883b6..9376415b01 100644 --- a/docbook/release-notes.xml +++ b/docbook/release-notes.xml @@ -241,12 +241,16 @@ There are no new protocols in this release. <!-- Sort alphabetically --> AFP, +Bluetooth L2CAP, CIP, CTDB, DCP ETSI, EtherCAT Mailbox, +FC Link Control, +LISP, NFS, RTPS2, +SCTP, STUN, XTP diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c index 1160362c11..006a5d8125 100644 --- a/epan/dissectors/packet-btl2cap.c +++ b/epan/dissectors/packet-btl2cap.c @@ -16,12 +16,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -307,7 +307,7 @@ static const value_string option_fcs_vals[] = { { 0, NULL } }; -static int +static int dissect_comrej(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) { guint16 reason; @@ -426,7 +426,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t option_type = tvb_get_guint8(tvb, offset); option_length = tvb_get_guint8(tvb, offset+1); - ti_option = proto_tree_add_none_format(tree, + ti_option = proto_tree_add_none_format(tree, hf_btl2cap_option, tvb, offset, option_length + 2, "Option: "); @@ -477,7 +477,7 @@ dissect_options(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *t break; case 0x04: /* Retransmission and Flow Control*/ - if(config_data) + if(config_data) { config_data->mode = tvb_get_guint8(tvb, offset); config_data->txwindow = tvb_get_guint8(tvb, offset+1); @@ -614,7 +614,7 @@ dissect_inforesponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tr break; case 0x0002: /* Extended Features */ - ti_features = proto_tree_add_none_format(tree, + ti_features = proto_tree_add_none_format(tree, hf_btl2cap_info_extfeatures, tvb, offset, 4, "Features: "); @@ -713,7 +713,7 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_ return offset; } -static int +static int dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { guint16 scid, dcid; @@ -876,13 +876,21 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, sdulen = tvb_get_letohs(tvb, offset); pi = proto_tree_add_item(btl2cap_tree, hf_btl2cap_sdulength, tvb, offset, 2, TRUE); offset += 2; - length -= 6; /*Control, SDUlength, FCS*/ /* Detect malformed data */ + + if (length <= 6) { + expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN, + "SDU length too short: %u", length); + THROW(ReportedBoundsError); + } + + length -= 6; /*Control, SDUlength, FCS*/ + if (sdulen < length) { sdulen = length; - expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN, - "SDU length less than length of first packet"); + expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN, + "SDU length less than length of first packet (%u < %u)", sdulen, length); } if(!pinfo->fd->flags.visited){ @@ -891,8 +899,8 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, mfp->last_frame=0; mfp->tot_len=sdulen; mfp->reassembled=se_alloc(sdulen); - tvb_memcpy(tvb, mfp->reassembled, offset, length); - mfp->cur_off=length; + tvb_memcpy(tvb, mfp->reassembled, offset, sdulen); + mfp->cur_off = sdulen; se_tree_insert32(config_data->start_fragments, pinfo->fd->num, mfp); } else { mfp=se_tree_lookup32(config_data->start_fragments, pinfo->fd->num); @@ -904,6 +912,11 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_append_fstr(pinfo->cinfo, COL_INFO, "[Reassembled in #%u] ", mfp->last_frame); } } else { + if (length <= 4) { + expert_add_info_format(pinfo, btl2cap_tree, PI_MALFORMED, PI_WARN, + "Control / FCS length too short: %u", length); + THROW(ReportedBoundsError); + } length -= 4; /*Control, FCS*/ } if(segment == 0x02 || segment == 0x03) { @@ -990,7 +1003,7 @@ static void dissect_s_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree /* Code to actually dissect the packets * This dissector will only be called ontop of BTHCI ACL - * and this dissector _REQUIRES_ that + * and this dissector _REQUIRES_ that * pinfo->private_data points to a valid bthci_acl_data_t structure */ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -1038,10 +1051,10 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 cmd_code; guint16 cmd_length; - ti_command=proto_tree_add_none_format(btl2cap_tree, + ti_command=proto_tree_add_none_format(btl2cap_tree, hf_btl2cap_command, tvb, offset, length, - "Command: "); + "Command: "); btl2cap_cmd_tree=proto_item_add_subtree(ti_command, ett_btl2cap_cmd); cmd_code=tvb_get_guint8(tvb, offset); @@ -1094,10 +1107,10 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case 0x07: /* Disconnect Response */ - offset=dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_cmd_tree); + offset=dissect_disconnrequestresponse(tvb, offset, pinfo, btl2cap_cmd_tree); proto_item_append_text(ti_command, "Disconnect Response"); col_append_str(pinfo->cinfo, COL_INFO, "Disconnect Response"); - break; + break; case 0x08: /* Echo Request */ proto_item_append_text(ti_command, "Echo Request"); @@ -1177,7 +1190,7 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length); /* call next dissector */ - if(!dissector_try_port(l2cap_psm_dissector_table, (guint32) psm, + if(!dissector_try_port(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree)){ /* unknown protocol. declare as data */ proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, tvb, offset, length, TRUE); @@ -1250,63 +1263,63 @@ static void dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Register the protocol with Wireshark */ void proto_register_btl2cap(void) -{ +{ /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { { &hf_btl2cap_length, { "Length", "btl2cap.length", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "L2CAP Payload Length", HFILL } }, { &hf_btl2cap_cid, { "CID", "btl2cap.cid", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_HEX, NULL, 0x0, "L2CAP Channel Identifier", HFILL } }, { &hf_btl2cap_payload, { "Payload", "btl2cap.payload", - FT_BYTES, BASE_NONE, NULL, 0x0, + FT_BYTES, BASE_NONE, NULL, 0x0, "L2CAP Payload", HFILL } }, { &hf_btl2cap_command, { "Command", "btl2cap.command", - FT_NONE, BASE_NONE, NULL, 0x0, + FT_NONE, BASE_NONE, NULL, 0x0, "L2CAP Command", HFILL } }, { &hf_btl2cap_cmd_code, { "Command Code", "btl2cap.cmd_code", - FT_UINT8, BASE_HEX, VALS(command_code_vals), 0x0, + FT_UINT8, BASE_HEX, VALS(command_code_vals), 0x0, "L2CAP Command Code", HFILL } }, { &hf_btl2cap_cmd_ident, { "Command Identifier", "btl2cap.cmd_ident", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_UINT8, BASE_HEX, NULL, 0x0, "L2CAP Command Identifier", HFILL } }, { &hf_btl2cap_cmd_length, { "Command Length", "btl2cap.cmd_length", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "L2CAP Command Length", HFILL } }, { &hf_btl2cap_cmd_data, { "Command Data", "btl2cap.cmd_data", - FT_NONE, BASE_NONE, NULL, 0x0, + FT_NONE, BASE_NONE, NULL, 0x0, "L2CAP Command Data", HFILL } }, { &hf_btl2cap_psm, { "PSM", "btl2cap.psm", - FT_UINT16, BASE_HEX, VALS(psm_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(psm_vals), 0x0, "Protocol/Service Multiplexer", HFILL } }, { &hf_btl2cap_scid, { "Source CID", "btl2cap.scid", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_HEX, NULL, 0x0, "Source Channel Identifier", HFILL } }, { &hf_btl2cap_dcid, { "Destination CID", "btl2cap.dcid", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_HEX, NULL, 0x0, "Destination Channel Identifier", HFILL } }, { &hf_btl2cap_icid, @@ -1326,7 +1339,7 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_result, { "Result", "btl2cap.result", - FT_UINT16, BASE_HEX, VALS(result_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(result_vals), 0x0, NULL, HFILL } }, { &hf_btl2cap_move_result, @@ -1341,22 +1354,22 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_status, { "Status", "btl2cap.status", - FT_UINT16, BASE_HEX, VALS(status_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(status_vals), 0x0, NULL, HFILL } }, { &hf_btl2cap_rej_reason, { "Reason", "btl2cap.rej_reason", - FT_UINT16, BASE_HEX, VALS(reason_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(reason_vals), 0x0, NULL, HFILL } }, { &hf_btl2cap_sig_mtu, { "Maximum Signalling MTU", "btl2cap.sig_mtu", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_btl2cap_info_mtu, { "Remote Entity MTU", "btl2cap.info_mtu", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "Remote entity acceptable connectionless MTU", HFILL } }, { &hf_btl2cap_info_flowcontrol, @@ -1441,12 +1454,12 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_info_type, { "Information Type", "btl2cap.info_type", - FT_UINT16, BASE_HEX, VALS(info_type_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(info_type_vals), 0x0, "Type of implementation-specific information", HFILL } }, { &hf_btl2cap_info_result, { "Result", "btl2cap.info_result", - FT_UINT16, BASE_HEX, VALS(info_result_vals), 0x0, + FT_UINT16, BASE_HEX, VALS(info_result_vals), 0x0, "Information about the success of the request", HFILL } }, { &hf_btl2cap_info_extfeatures, @@ -1456,7 +1469,7 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_continuation_flag, { "Continuation Flag", "btl2cap.continuation", - FT_BOOLEAN, 16, NULL, 0x0001, + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, { &hf_btl2cap_configuration_result, @@ -1466,22 +1479,22 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_option_type, { "Type", "btl2cap.option_type", - FT_UINT8, BASE_HEX, VALS(option_type_vals), 0x0, + FT_UINT8, BASE_HEX, VALS(option_type_vals), 0x0, "Type of option", HFILL } }, { &hf_btl2cap_option_length, { "Length", "btl2cap.option_length", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, 0x0, "Number of octets in option payload", HFILL } }, { &hf_btl2cap_option_mtu, { "MTU", "btl2cap.option_mtu", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "Maximum Transmission Unit", HFILL } }, { &hf_btl2cap_option_flushTO, { "Flush Timeout (ms)", "btl2cap.option_flushto", - FT_UINT16, BASE_DEC, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "Flush Timeout in milliseconds", HFILL } }, { &hf_btl2cap_option_flush_to_us, @@ -1511,37 +1524,37 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_option_flags, { "Flags", "btl2cap.option_flags", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_UINT8, BASE_HEX, NULL, 0x0, "Flags - must be set to 0 (Reserved for future use)", HFILL } }, { &hf_btl2cap_option_service_type, { "Service Type", "btl2cap.option_servicetype", - FT_UINT8, BASE_HEX, VALS(option_servicetype_vals), 0x0, + FT_UINT8, BASE_HEX, VALS(option_servicetype_vals), 0x0, "Level of service required", HFILL } }, { &hf_btl2cap_option_tokenrate, { "Token Rate (bytes/s)", "btl2cap.option_tokenrate", - FT_UINT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "Rate at which traffic credits are granted (bytes/s)", HFILL } }, { &hf_btl2cap_option_tokenbucketsize, { "Token Bucket Size (bytes)", "btl2cap.option_tokenbsize", - FT_UINT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "Size of the token bucket (bytes)", HFILL } }, { &hf_btl2cap_option_peakbandwidth, { "Peak Bandwidth (bytes/s)", "btl2cap.option_peakbandwidth", - FT_UINT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "Limit how fast packets may be sent (bytes/s)", HFILL } }, { &hf_btl2cap_option_latency, { "Latency (microseconds)", "btl2cap.option_latency", - FT_UINT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "Maximal acceptable delay (microseconds)", HFILL } }, { &hf_btl2cap_option_delayvariation, { "Delay Variation (microseconds)", "btl2cap.option_delayvar", - FT_UINT32, BASE_DEC, NULL, 0x0, + FT_UINT32, BASE_DEC, NULL, 0x0, "Difference between maximum and minimum delay (microseconds)", HFILL } }, { &hf_btl2cap_option_retransmissionmode, @@ -1586,7 +1599,7 @@ proto_register_btl2cap(void) }, { &hf_btl2cap_option, { "Configuration Parameter Option", "btl2cap.conf_param_option", - FT_NONE, BASE_NONE, NULL, 0x0, + FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_btl2cap_control_sar, @@ -1674,10 +1687,8 @@ proto_register_btl2cap(void) } -void +void proto_reg_handoff_btl2cap(void) { } - - diff --git a/epan/dissectors/packet-fclctl.c b/epan/dissectors/packet-fclctl.c index 0475fb8570..42f4a1164c 100644 --- a/epan/dissectors/packet-fclctl.c +++ b/epan/dissectors/packet-fclctl.c @@ -141,13 +141,13 @@ const gchar * fclctl_get_paramstr (guint32 linkctl_type, guint32 param) { if (linkctl_type == FC_LCTL_PBSY) { - return g_strdup_printf("%s, %s", + return ep_strdup_printf("%s, %s", val_to_str (((param & 0xFF000000) >> 24), fc_lctl_pbsy_acode_val, "0x%x"), val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_pbsy_rjt_val, "0x%x")); } if ((linkctl_type == FC_LCTL_FRJT) || (linkctl_type == FC_LCTL_PRJT)) { - return g_strdup_printf("%s, %s", + return ep_strdup_printf("%s, %s", val_to_str (((param & 0xFF000000) >> 24), fc_lctl_rjt_acode_val, "0x%x"), val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_rjt_val, "%x")); } diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 2af58de726..4f6256a9ab 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -354,6 +354,9 @@ static const value_string sctp_payload_proto_id_values[] = { /* Unassigned 26 */ { X2AP_PAYLOAD_PROTOCOL_ID, "X2AP" }, { IRCP_PAYLOAD_PROTOCOL_ID, "IRCP" }, + { DIAMETER_PROTOCOL_ID, "DIAMETER" }, + { DIAMETER_DTLS_PROTOCOL_ID, "DIAMETER OVER DTLS" }, + { R14P_BER_PROTOCOL_ID, "R14P" }, { 0, NULL } }; diff --git a/epan/sctpppids.h b/epan/sctpppids.h index 3db8c17bf6..f19a5dbe52 100644 --- a/epan/sctpppids.h +++ b/epan/sctpppids.h @@ -59,5 +59,8 @@ /* Unassigned 26 */ #define X2AP_PAYLOAD_PROTOCOL_ID 27 #define IRCP_PAYLOAD_PROTOCOL_ID 28 +#define DIAMETER_PROTOCOL_ID 46 +#define DIAMETER_DTLS_PROTOCOL_ID 47 +#define R14P_BER_PROTOCOL_ID 48 #define M2TP_PAYLOAD_PROTOCOL_ID 99 /* s-link */ #endif /* sctpppids.h */ |