diff options
author | Michael Tüxen <tuexen@wireshark.org> | 2015-10-01 14:17:26 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@wireshark.org> | 2015-10-01 14:22:12 +0000 |
commit | c53d2f0d0e33de4419b93637d23e04bbcb59af1b (patch) | |
tree | 50abab5e1351abe23ad0b3c52be244b3c8e5ccc2 | |
parent | d9233585be5e0b01cb9ad618e9b7f3801c6821bf (diff) |
Revert "SCTP: Add I_DATA support"
This reverts commit 4e9361dc88eefef27d031e29e2f8ca9891cc03eb.
Change-Id: Ia7aee9ffbe5bc5d3ae88e957c234cbee7b65f457
Reviewed-on: https://code.wireshark.org/review/10723
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
-rw-r--r-- | epan/dissectors/packet-sctp.c | 197 | ||||
-rw-r--r-- | ui/gtk/sctp_chunk_stat.c | 12 | ||||
-rw-r--r-- | ui/gtk/sctp_graph_dlg.c | 4 | ||||
-rw-r--r-- | ui/qt/sctp_graph_arwnd_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/sctp_graph_byte_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/sctp_graph_dialog.cpp | 14 | ||||
-rw-r--r-- | ui/tap-sctp-analysis.c | 44 | ||||
-rw-r--r-- | ui/tap-sctp-analysis.h | 26 |
8 files changed, 79 insertions, 228 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index cc1b403e9e..54813dd13b 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -117,9 +117,6 @@ static int hf_data_chunk_tsn = -1; static int hf_data_chunk_stream_id = -1; static int hf_data_chunk_stream_seq_number = -1; static int hf_data_chunk_payload_proto_id = -1; -static int hf_idata_chunk_reserved = -1; -static int hf_idata_chunk_mid = -1; -static int hf_idata_chunk_fsn = -1; static int hf_data_chunk_e_bit = -1; static int hf_data_chunk_b_bit = -1; @@ -325,7 +322,6 @@ static dissector_handle_t data_handle; #define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 #define SCTP_AUTH_CHUNK_ID 15 #define SCTP_NR_SACK_CHUNK_ID 16 -#define SCTP_I_DATA_CHUNK_ID 0x40 #define SCTP_ASCONF_ACK_CHUNK_ID 0x80 #define SCTP_PKTDROP_CHUNK_ID 0x81 #define SCTP_RE_CONFIG_CHUNK_ID 0x82 @@ -352,7 +348,6 @@ static const value_string chunk_type_values[] = { { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, { SCTP_AUTH_CHUNK_ID, "AUTH" }, { SCTP_NR_SACK_CHUNK_ID, "NR-SACK" }, - { SCTP_I_DATA_CHUNK_ID, "I-DATA" }, { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, { SCTP_RE_CONFIG_CHUNK_ID, "RE_CONFIG" }, @@ -518,8 +513,6 @@ typedef struct _infodata_t { static wmem_list_t *assoc_info_list = NULL; static guint num_assocs = 0; -static guint32 frag_ppid = 0; /* Save the PPID for the fragmented idata packets, as they -are only present in the first fragment */ UAT_CSTRING_CB_DEF(type_fields, type_name, type_field_t) UAT_VS_DEF(type_fields, type_enable, type_field_t, guint, 0, "Show") @@ -944,7 +937,7 @@ static void dissect_error_cause(tvbuff_t *, packet_info *, proto_tree *); static void dissect_error_causes(tvbuff_t *, packet_info *, proto_tree *); -static gboolean dissect_data_chunk(tvbuff_t*, guint16, packet_info*, proto_tree*, proto_tree*, proto_item*, proto_item*, sctp_half_assoc_t*, gboolean); +static gboolean dissect_data_chunk(tvbuff_t*, guint16, packet_info*, proto_tree*, proto_tree*, proto_item*, proto_item*, sctp_half_assoc_t*); static void dissect_sctp_packet(tvbuff_t *, packet_info *, proto_tree *, gboolean); @@ -2544,41 +2537,21 @@ dissect_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, gui #define DATA_CHUNK_STREAM_ID_LENGTH 2 #define DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH 2 #define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 -#define I_DATA_CHUNK_RESERVED_LENGTH 2 -#define I_DATA_CHUNK_MID_LENGTH 4 -#define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 -#define I_DATA_CHUNK_FSN_LENGTH 4 #define DATA_CHUNK_TSN_OFFSET (CHUNK_VALUE_OFFSET + 0) #define DATA_CHUNK_STREAM_ID_OFFSET (DATA_CHUNK_TSN_OFFSET + DATA_CHUNK_TSN_LENGTH) #define DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET (DATA_CHUNK_STREAM_ID_OFFSET + \ - DATA_CHUNK_STREAM_ID_LENGTH) + DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH) #define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET (DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET + \ DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH) #define DATA_CHUNK_PAYLOAD_OFFSET (DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET + \ DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) -#define I_DATA_CHUNK_RESERVED_OFFSET (DATA_CHUNK_STREAM_ID_OFFSET + \ - DATA_CHUNK_STREAM_ID_LENGTH) -#define I_DATA_CHUNK_MID_OFFSET (I_DATA_CHUNK_RESERVED_OFFSET + \ - I_DATA_CHUNK_RESERVED_LENGTH) -#define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ - I_DATA_CHUNK_MID_LENGTH) -#define I_DATA_CHUNK_FSN_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ - I_DATA_CHUNK_MID_LENGTH) -#define I_DATA_CHUNK_PAYLOAD_OFFSET (I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET + \ - I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ DATA_CHUNK_TSN_LENGTH + \ DATA_CHUNK_STREAM_ID_LENGTH + \ DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH + \ DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) -#define I_DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ - DATA_CHUNK_TSN_LENGTH + \ - DATA_CHUNK_STREAM_ID_LENGTH + \ - I_DATA_CHUNK_RESERVED_LENGTH + \ - I_DATA_CHUNK_MID_LENGTH +\ - I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define SCTP_DATA_CHUNK_E_BIT 0x01 #define SCTP_DATA_CHUNK_B_BIT 0x02 @@ -2594,8 +2567,7 @@ typedef struct _frag_key { guint16 dport; guint32 verification_tag; guint16 stream_id; - guint32 stream_seq_num; - guint8 u_bit; + guint16 stream_seq_num; } frag_key; @@ -2609,8 +2581,7 @@ frag_equal(gconstpointer k1, gconstpointer k2) (key1->dport == key2->dport) && (key1->verification_tag == key2->verification_tag) && (key1->stream_id == key2->stream_id) && - (key1->stream_seq_num == key2->stream_seq_num) && - (key1->u_bit == key2->u_bit) + (key1->stream_seq_num == key2->stream_seq_num) ? TRUE : FALSE); } @@ -2621,7 +2592,7 @@ frag_hash(gconstpointer k) const frag_key *key = (const frag_key *) k; return key->sport ^ key->dport ^ key->verification_tag ^ - key->stream_id ^ key->stream_seq_num ^ key->u_bit; + key->stream_id ^ key->stream_seq_num; } @@ -2676,7 +2647,7 @@ sctp_cleanup(void) static sctp_frag_msg* -find_message(guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) +find_message(guint16 stream_id, guint16 stream_seq_num) { frag_key key; @@ -2685,19 +2656,18 @@ find_message(guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) key.verification_tag = sctp_info.verification_tag; key.stream_id = stream_id; key.stream_seq_num = stream_seq_num; - key.u_bit = u_bit; return (sctp_frag_msg *)g_hash_table_lookup(frag_table, &key); } static sctp_fragment* -find_fragment(guint32 tsn, guint16 stream_id, guint32 stream_seq_num, guint8 u_bit) +find_fragment(guint32 tsn, guint16 stream_id, guint16 stream_seq_num) { sctp_frag_msg *msg; sctp_fragment *next_fragment; - msg = find_message(stream_id, stream_seq_num, u_bit); + msg = find_message(stream_id, stream_seq_num); if (msg) { next_fragment = msg->fragments; @@ -2714,7 +2684,7 @@ find_fragment(guint32 tsn, guint16 stream_id, guint32 stream_seq_num, guint8 u_b static sctp_fragment * add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn, - guint16 stream_id, guint32 stream_seq_num, guint8 b_bit, guint8 e_bit, guint8 u_bit) + guint16 stream_id, guint16 stream_seq_num, guint8 b_bit, guint8 e_bit) { sctp_frag_msg *msg; sctp_fragment *fragment, *last_fragment; @@ -2726,7 +2696,7 @@ add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn, return NULL; /* lookup message. if not found, create it */ - msg = find_message(stream_id, stream_seq_num, u_bit); + msg = find_message(stream_id, stream_seq_num); if (!msg) { msg = (sctp_frag_msg *)g_malloc (sizeof (sctp_frag_msg)); @@ -2742,13 +2712,12 @@ add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn, key->verification_tag = sctp_info.verification_tag; key->stream_id = stream_id; key->stream_seq_num = stream_seq_num; - key->u_bit = u_bit; g_hash_table_insert(frag_table, key, msg); } /* lookup segment. if not found, create it */ - fragment = find_fragment(tsn, stream_id, stream_seq_num, u_bit); + fragment = find_fragment(tsn, stream_id, stream_seq_num); if (fragment) { /* this fragment is already known. @@ -2861,7 +2830,7 @@ add_fragment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 tsn, static tvbuff_t* fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, packet_info *pinfo, proto_tree *tree, guint16 stream_id, - guint32 stream_seq_num, guint8 u_bit) + guint16 stream_seq_num) { sctp_frag_msg *msg; sctp_complete_msg *message, *last_message; @@ -2872,7 +2841,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, proto_item *item; proto_tree *ptree; - msg = find_message(stream_id, stream_seq_num, u_bit); + msg = find_message(stream_id, stream_seq_num); if (!msg) { /* no message, we can't do anything */ @@ -2902,7 +2871,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, message->len, message->end - message->begin + 1); if (message->begin > message->end) { - for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); + for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num); frag_i; frag_i = frag_i->next) { @@ -2926,7 +2895,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, mark_frame_as_depended_upon(pinfo, frag_i->frame_num); } } else { - for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); + for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num); frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { @@ -3141,7 +3110,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, message->len, message->end - message->begin + 1); if (message->begin > message->end) { - for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); + for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num); frag_i; frag_i = frag_i->next) { @@ -3161,7 +3130,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment *fragment, offset += frag_i->len; } } else { - for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num, u_bit); + for (frag_i = find_fragment(message->begin, stream_id, stream_seq_num); frag_i && frag_i->tsn <= message->end; frag_i = frag_i->next) { @@ -3200,7 +3169,7 @@ export_sctp_data_chunk(packet_info *pinfo, tvbuff_t *tvb, const gchar *proto_nam static gboolean dissect_fragmented_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, proto_tree *chunk_tree, guint32 tsn, guint32 ppi, guint16 stream_id, - guint32 stream_seq_num, guint8 b_bit, guint8 e_bit, guint8 u_bit) + guint16 stream_seq_num, guint8 b_bit, guint8 e_bit) { sctp_fragment *fragment; tvbuff_t *new_tvb = NULL; @@ -3212,11 +3181,11 @@ dissect_fragmented_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree if (tvb_reported_length(payload_tvb) > tvb_captured_length(payload_tvb)) return TRUE; - /* add fragment to list of known fragments. returns NULL if segment is a duplicate */ - fragment = add_fragment(payload_tvb, pinfo, chunk_tree, tsn, stream_id, stream_seq_num, b_bit, e_bit, u_bit); + /* add fragement to list of known fragments. returns NULL if segment is a duplicate */ + fragment = add_fragment(payload_tvb, pinfo, chunk_tree, tsn, stream_id, stream_seq_num, b_bit, e_bit); if (fragment) - new_tvb = fragment_reassembly(payload_tvb, fragment, pinfo, chunk_tree, stream_id, stream_seq_num, u_bit); + new_tvb = fragment_reassembly(payload_tvb, fragment, pinfo, chunk_tree, stream_id, stream_seq_num); /* pass reassembled data to next dissector, if possible */ if (new_tvb){ @@ -3270,33 +3239,25 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, - sctp_half_assoc_t* ha, - gboolean is_idata) + sctp_half_assoc_t *ha) { guint number_of_ppid; guint32 payload_proto_id; tvbuff_t *payload_tvb; proto_tree *flags_tree; guint8 e_bit, b_bit, u_bit; - guint16 stream_id; - guint32 tsn, ppid, stream_seq_num = 0; + guint16 stream_id, stream_seq_num = 0; + guint32 tsn, ppid; proto_item *tsn_item = NULL; gboolean call_subdissector = FALSE; gboolean is_retransmission; - if (is_idata) { - if (chunk_length < I_DATA_CHUNK_HEADER_LENGTH) { - proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, I_DATA_CHUNK_HEADER_LENGTH); - return TRUE; - } - payload_proto_id = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET); -} else { - if (chunk_length < DATA_CHUNK_HEADER_LENGTH) { - proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, DATA_CHUNK_HEADER_LENGTH); - return TRUE; - } - payload_proto_id = tvb_get_ntohl(chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET); -} + if (chunk_length <= DATA_CHUNK_HEADER_LENGTH) { + proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", chunk_length, DATA_CHUNK_HEADER_LENGTH); + return TRUE; + } + + payload_proto_id = tvb_get_ntohl(chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET); /* insert the PPID in the pinfo structure if it is not already there and there is still room */ for(number_of_ppid = 0; number_of_ppid < MAX_NUMBER_OF_PPIDS; number_of_ppid++) { @@ -3310,13 +3271,12 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, e_bit = tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_DATA_CHUNK_E_BIT; b_bit = tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_DATA_CHUNK_B_BIT; u_bit = tvb_get_guint8(chunk_tvb, CHUNK_FLAGS_OFFSET) & SCTP_DATA_CHUNK_U_BIT; + stream_id = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET); + stream_seq_num = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET); tsn = tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET); if (chunk_tree) { - if (is_idata) - proto_item_set_len(chunk_item, I_DATA_CHUNK_HEADER_LENGTH); - else - proto_item_set_len(chunk_item, DATA_CHUNK_HEADER_LENGTH); + proto_item_set_len(chunk_item, DATA_CHUNK_HEADER_LENGTH); flags_tree = proto_item_add_subtree(flags_item, ett_sctp_data_chunk_flags); proto_tree_add_item(flags_tree, hf_data_chunk_e_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_data_chunk_b_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); @@ -3324,17 +3284,9 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, proto_tree_add_item(flags_tree, hf_data_chunk_i_bit, chunk_tvb, CHUNK_FLAGS_OFFSET, CHUNK_FLAGS_LENGTH, ENC_BIG_ENDIAN); tsn_item = proto_tree_add_item(chunk_tree, hf_data_chunk_tsn, chunk_tvb, DATA_CHUNK_TSN_OFFSET, DATA_CHUNK_TSN_LENGTH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_data_chunk_stream_id, chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET, DATA_CHUNK_STREAM_ID_LENGTH, ENC_BIG_ENDIAN); - if (is_idata) { - proto_tree_add_item(chunk_tree, hf_idata_chunk_reserved, chunk_tvb, I_DATA_CHUNK_RESERVED_OFFSET, I_DATA_CHUNK_RESERVED_LENGTH, ENC_BIG_ENDIAN); - proto_tree_add_item(chunk_tree, hf_idata_chunk_mid, chunk_tvb, I_DATA_CHUNK_MID_OFFSET, I_DATA_CHUNK_MID_LENGTH, ENC_BIG_ENDIAN); - if (b_bit) - proto_tree_add_item(chunk_tree, hf_data_chunk_payload_proto_id, chunk_tvb, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET, I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH, ENC_BIG_ENDIAN); - else - proto_tree_add_item(chunk_tree, hf_idata_chunk_fsn, chunk_tvb, I_DATA_CHUNK_FSN_OFFSET, I_DATA_CHUNK_FSN_LENGTH, ENC_BIG_ENDIAN); - } else { - proto_tree_add_item(chunk_tree, hf_data_chunk_stream_seq_number, chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET, DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH, ENC_BIG_ENDIAN); - proto_tree_add_item(chunk_tree, hf_data_chunk_payload_proto_id, chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH, ENC_BIG_ENDIAN); - } + proto_tree_add_item(chunk_tree, hf_data_chunk_stream_seq_number, chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET, DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_tree, hf_data_chunk_payload_proto_id, chunk_tvb, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET, DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH, ENC_BIG_ENDIAN); + proto_item_append_text(chunk_item, "(%s, ", (u_bit) ? "unordered" : "ordered"); if (b_bit) { if (e_bit) @@ -3348,39 +3300,20 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, proto_item_append_text(chunk_item, "middle"); } - if (is_idata) { - if (b_bit) - proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, MID: %u, payload length: %u byte%s)", - tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET), - tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), - tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET), - chunk_length - I_DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, "", "s")); - else - proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, MID: %u, FSN: %u, payload length: %u byte%s)", - tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET), - tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), - tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET), - tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_FSN_OFFSET), - chunk_length - I_DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, "", "s")); - } else - proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, SSN: %u, PPID: %u, payload length: %u byte%s)", - tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET), - tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), - tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET), - payload_proto_id, - chunk_length - DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - DATA_CHUNK_HEADER_LENGTH, "", "s")); + proto_item_append_text(chunk_item, " segment, TSN: %u, SID: %u, SSN: %u, PPID: %u, payload length: %u byte%s)", + tvb_get_ntohl(chunk_tvb, DATA_CHUNK_TSN_OFFSET), + tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET), + tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET), + payload_proto_id, + chunk_length - DATA_CHUNK_HEADER_LENGTH, plurality(chunk_length - DATA_CHUNK_HEADER_LENGTH, "", "s")); } - is_retransmission = sctp_tsn(pinfo, chunk_tvb, tsn_item, ha, tsn); + is_retransmission = sctp_tsn(pinfo, chunk_tvb, tsn_item, ha, tsn); + + payload_tvb = tvb_new_subset(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET, + MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET)), + MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET))); - if (is_idata) - payload_tvb = tvb_new_subset(chunk_tvb, I_DATA_CHUNK_PAYLOAD_OFFSET, - MIN(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, I_DATA_CHUNK_PAYLOAD_OFFSET)), - MIN(chunk_length - I_DATA_CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, I_DATA_CHUNK_PAYLOAD_OFFSET))); - else - payload_tvb = tvb_new_subset(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET, - MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_captured_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET)), - MIN(chunk_length - DATA_CHUNK_HEADER_LENGTH, tvb_reported_length_remaining(chunk_tvb, DATA_CHUNK_PAYLOAD_OFFSET))); /* Is this a fragment? */ if (b_bit && e_bit) { /* No - just call the subdissector. */ @@ -3449,26 +3382,12 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, /* The logic above should ensure this... */ DISSECTOR_ASSERT(use_reassembly); - stream_id = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_ID_OFFSET); - if (is_idata) { - /* The stream_seq_num variable is used to hold the MID, the tsn variable holds the FSN*/ - stream_seq_num = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_MID_OFFSET); - if (b_bit) { - tsn = 0; - frag_ppid = payload_proto_id; - } else { - tsn = tvb_get_ntohl(chunk_tvb, I_DATA_CHUNK_FSN_OFFSET); - payload_proto_id = frag_ppid; - } - } else { - /* if unordered set stream_seq_num to 0 for easier handling */ - if (u_bit) - stream_seq_num = 0; - else - stream_seq_num = tvb_get_ntohs(chunk_tvb, DATA_CHUNK_STREAM_SEQ_NUMBER_OFFSET); - } + /* if unordered set stream_seq_num to 0 for easier handling */ + if (u_bit) + stream_seq_num = 0; + /* start reassembly */ - return dissect_fragmented_payload(payload_tvb, pinfo, tree, chunk_tree, tsn, payload_proto_id, stream_id, stream_seq_num, b_bit, e_bit, u_bit); + return dissect_fragmented_payload(payload_tvb, pinfo, tree, chunk_tree, tsn, payload_proto_id, stream_id, stream_seq_num, b_bit, e_bit); } } @@ -4331,10 +4250,7 @@ dissect_sctp_chunk(tvbuff_t *chunk_tvb, /* now dissect the chunk value */ switch(type) { case SCTP_DATA_CHUNK_ID: - result = dissect_data_chunk(chunk_tvb, length, pinfo, tree, chunk_tree, chunk_item, flags_item, ha, FALSE); - break; - case SCTP_I_DATA_CHUNK_ID: - result = dissect_data_chunk(chunk_tvb, length, pinfo, tree, chunk_tree, chunk_item, flags_item, ha, TRUE); + result = dissect_data_chunk(chunk_tvb, length, pinfo, tree, chunk_tree, chunk_item, flags_item, ha); break; case SCTP_INIT_CHUNK_ID: dissect_init_chunk(chunk_tvb, length, pinfo, chunk_tree, chunk_item); @@ -4743,13 +4659,10 @@ proto_register_sctp(void) #if 0 { &hf_cumulative_tsn_ack, { "Cumulative TSN Ack", "sctp.cumulative_tsn_ack", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, #endif - { &hf_data_chunk_tsn, { "Transmission sequence number", "sctp.data_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_data_chunk_stream_id, { "Stream identifier", "sctp.data_sid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_data_chunk_tsn, { "TSN", "sctp.data_tsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_data_chunk_stream_id, { "Stream Identifier", "sctp.data_sid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_stream_seq_number, { "Stream sequence number", "sctp.data_ssn", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_payload_proto_id, { "Payload protocol identifier", "sctp.data_payload_proto_id", FT_UINT32, BASE_DEC, VALS(sctp_payload_proto_id_values), 0x0, NULL, HFILL } }, - { &hf_idata_chunk_reserved, { "Reserved", "sctp.data_reserved", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_idata_chunk_mid, { "Message identifier", "sctp.data_mid", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_idata_chunk_fsn, { "Fragment sequence number", "sctp.data_fsn", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_data_chunk_e_bit, { "E-Bit", "sctp.data_e_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_e_bit_value), SCTP_DATA_CHUNK_E_BIT, NULL, HFILL } }, { &hf_data_chunk_b_bit, { "B-Bit", "sctp.data_b_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_b_bit_value), SCTP_DATA_CHUNK_B_BIT, NULL, HFILL } }, { &hf_data_chunk_u_bit, { "U-Bit", "sctp.data_u_bit", FT_BOOLEAN, 8, TFS(&sctp_data_chunk_u_bit_value), SCTP_DATA_CHUNK_U_BIT, NULL, HFILL } }, diff --git a/ui/gtk/sctp_chunk_stat.c b/ui/gtk/sctp_chunk_stat.c index 5742c428cf..e4266e0df2 100644 --- a/ui/gtk/sctp_chunk_stat.c +++ b/ui/gtk/sctp_chunk_stat.c @@ -207,12 +207,11 @@ sctpstat_draw(void *phs) 12, tmp->chunk_count[SCTP_ABORT_CHUNK_ID], 13, tmp->chunk_count[SCTP_ERROR_CHUNK_ID], 14, tmp->chunk_count[SCTP_NR_SACK_CHUNK_ID], - 15, tmp->chunk_count[SCTP_IDATA_CHUNK_ID], - 16, tmp->chunk_count[SCTP_ASCONF_ACK_CHUNK_ID], - 17, tmp->chunk_count[SCTP_PKTDROP_CHUNK_ID], - 18, tmp->chunk_count[SCTP_FORWARD_TSN_CHUNK_ID], - 19, tmp->chunk_count[SCTP_ASCONF_CHUNK_ID], - 20, tmp->chunk_count[OTHER_CHUNKS_INDEX], + 15, tmp->chunk_count[SCTP_ASCONF_ACK_CHUNK_ID], + 16, tmp->chunk_count[SCTP_PKTDROP_CHUNK_ID], + 17, tmp->chunk_count[SCTP_FORWARD_TSN_CHUNK_ID], + 18, tmp->chunk_count[SCTP_ASCONF_CHUNK_ID], + 19, tmp->chunk_count[OTHER_CHUNKS_INDEX], -1 ); wmem_free(NULL, src_addr); @@ -251,7 +250,6 @@ static const stat_column titles[]={ {G_TYPE_UINT, TAP_ALIGN_RIGHT, "ABORT" }, {G_TYPE_UINT, TAP_ALIGN_RIGHT, "ERROR" }, {G_TYPE_UINT, TAP_ALIGN_RIGHT, "NR-SACK" }, - {G_TYPE_UINT, TAP_ALIGN_RIGHT, "IDATA" }, {G_TYPE_UINT, TAP_ALIGN_RIGHT, "ASCONF-ACK" }, {G_TYPE_UINT, TAP_ALIGN_RIGHT, "PKTDROP" }, {G_TYPE_UINT, TAP_ALIGN_RIGHT, "FORWARD-TSN" }, diff --git a/ui/gtk/sctp_graph_dlg.c b/ui/gtk/sctp_graph_dlg.c index 684636b8e0..f702a68491 100644 --- a/ui/gtk/sctp_graph_dlg.c +++ b/ui/gtk/sctp_graph_dlg.c @@ -569,7 +569,7 @@ draw_tsn_graph(struct sctp_udata *u_data) while (tlist) { type = ((struct chunk_header *)tlist->data)->type; - if (type == SCTP_DATA_CHUNK_ID || type == SCTP_IDATA_CHUNK_ID || type == SCTP_FORWARD_TSN_CHUNK_ID) + if (type == SCTP_DATA_CHUNK_ID || type == SCTP_FORWARD_TSN_CHUNK_ID) tsnumber = g_ntohl(((struct data_chunk_header *)tlist->data)->tsn); if (tsnumber >= min_tsn && tsnumber <= max_tsn && tsn->secs >= min_secs) { @@ -589,7 +589,7 @@ draw_tsn_graph(struct sctp_udata *u_data) #else cr = gdk_cairo_create (u_data->io->pixmap); #endif - if ((type == SCTP_DATA_CHUNK_ID) || (type == SCTP_IDATA_CHUNK_ID)) + if (type == SCTP_DATA_CHUNK_ID) gdk_cairo_set_source_rgba (cr, &black_color); else gdk_cairo_set_source_rgba (cr, &pink_color); diff --git a/ui/qt/sctp_graph_arwnd_dialog.cpp b/ui/qt/sctp_graph_arwnd_dialog.cpp index a36e5bdfbd..abaeb5832a 100644 --- a/ui/qt/sctp_graph_arwnd_dialog.cpp +++ b/ui/qt/sctp_graph_arwnd_dialog.cpp @@ -76,10 +76,10 @@ void SCTPGraphArwndDialog::drawArwndGraph() if (direction == 1) { listSACK = g_list_last(selected_assoc->sack1); - startArwnd = selected_assoc->arwnd2; + startArwnd = selected_assoc->arwnd1; } else { listSACK = g_list_last(selected_assoc->sack2); - startArwnd = selected_assoc->arwnd1; + startArwnd = selected_assoc->arwnd2; } while (listSACK) { tsn = (tsn_t*) (listSACK->data); diff --git a/ui/qt/sctp_graph_byte_dialog.cpp b/ui/qt/sctp_graph_byte_dialog.cpp index 4af5a847e2..2d24ba73d2 100644 --- a/ui/qt/sctp_graph_byte_dialog.cpp +++ b/ui/qt/sctp_graph_byte_dialog.cpp @@ -90,12 +90,8 @@ void SCTPGraphByteDialog::drawBytesGraph() while (tlist) { type = ((struct chunk_header *)tlist->data)->type; - if (type == SCTP_DATA_CHUNK_ID || type == SCTP_I_DATA_CHUNK_ID) { + if (type == SCTP_DATA_CHUNK_ID) { length = g_ntohs(((struct data_chunk_header *)tlist->data)->length); - if (type == SCTP_DATA_CHUNK_ID) - length -= DATA_CHUNK_HEADER_LENGTH; - else - length -= I_DATA_CHUNK_HEADER_LENGTH; sumBytes += length; yb.append(sumBytes); xb.append(tsn->secs + tsn->usecs/1000000.0); diff --git a/ui/qt/sctp_graph_dialog.cpp b/ui/qt/sctp_graph_dialog.cpp index 2052650d0e..761db06518 100644 --- a/ui/qt/sctp_graph_dialog.cpp +++ b/ui/qt/sctp_graph_dialog.cpp @@ -86,8 +86,8 @@ void SCTPGraphDialog::drawNRSACKGraph() list = g_list_last(selected_assoc->sack1); min_tsn = selected_assoc->min_tsn1; } else { - list = g_list_last(selected_assoc->sack2); - min_tsn = selected_assoc->min_tsn2; + list = g_list_last(selected_assoc->sack1); + min_tsn = selected_assoc->min_tsn1; } while (list) { sack = (tsn_t*) (list->data); @@ -280,7 +280,7 @@ void SCTPGraphDialog::drawTSNGraph() while (tlist) { type = ((struct chunk_header *)tlist->data)->type; - if (type == SCTP_DATA_CHUNK_ID || type == SCTP_I_DATA_CHUNK_ID || type == SCTP_FORWARD_TSN_CHUNK_ID) { + if (type == SCTP_DATA_CHUNK_ID || type == SCTP_FORWARD_TSN_CHUNK_ID) { tsnumber = g_ntohl(((struct data_chunk_header *)tlist->data)->tsn); yt.append(tsnumber); xt.append(tsn->secs + tsn->usecs/1000000.0); @@ -314,7 +314,6 @@ void SCTPGraphDialog::drawTSNGraph() void SCTPGraphDialog::drawGraph(int which) { guint32 maxTSN, minTSN; - gint64 minBound; gIsSackChunkPresent = false; gIsNRSackChunkPresent = false; @@ -349,12 +348,7 @@ void SCTPGraphDialog::drawGraph(int which) connect(ui->sctpPlot, SIGNAL(plottableClick(QCPAbstractPlottable*,QMouseEvent*)), this, SLOT(graphClicked(QCPAbstractPlottable*, QMouseEvent*))); // set axes ranges, so we see all data: QCPRange myXRange(selected_assoc->min_secs, (selected_assoc->max_secs+1)); - if (maxTSN - minTSN < 5) { - minBound = 0; - } else { - minBound = minTSN; - } - QCPRange myYRange(minBound, maxTSN); + QCPRange myYRange(minTSN, maxTSN); ui->sctpPlot->xAxis->setRange(myXRange); ui->sctpPlot->yAxis->setRange(myYRange); ui->sctpPlot->replot(); diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c index 6e3db28f4c..6652fe705e 100644 --- a/ui/tap-sctp-analysis.c +++ b/ui/tap-sctp-analysis.c @@ -478,7 +478,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) @@ -508,7 +507,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) @@ -585,7 +583,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) @@ -607,15 +604,10 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi info->ep1_chunk_count[idx]++; info = add_chunk_count(&tmp_info.src, info, 1, idx); - if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) || - (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID)) + if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID)) { datachunk = TRUE; - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH; - } else { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH; - } + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; info->n_data_chunks++; info->n_data_bytes+=length; info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1; @@ -663,11 +655,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi tsn_s->offset = 0; tsn_s->framenumber = framenumber; if (datachunk) - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) { - tsn_s->length = length - DATA_CHUNK_HEADER_LENGTH; - } else { - tsn_s->length = length - I_DATA_CHUNK_HEADER_LENGTH; - } + tsn_s->length = length-DATA_CHUNK_HEADER_LENGTH; else tsn_s->length = length; if (tsn->secs < info->min_secs) @@ -793,7 +781,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) @@ -824,7 +811,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs; sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000; if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) || - ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) || ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) @@ -946,7 +932,6 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi { if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) && - ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) && ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID)) @@ -971,10 +956,9 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi info->ep2_chunk_count[idx]++; info = add_chunk_count(&tmp_info.src, info,info->direction, idx); - if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) || - (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID)) + if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_DATA_CHUNK_ID)) datachunk = TRUE; - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID) + if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_FORWARD_TSN_CHUNK_ID)) forwardchunk = TRUE; if ((datachunk || forwardchunk) && tsn != NULL) { @@ -985,11 +969,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi { t_s_n = (guint8 *)g_malloc(16); tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16); - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) { - length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; - } else { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH; - } + length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; info->n_data_chunks++; info->n_data_bytes+=length; } @@ -1076,11 +1056,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi { if (datachunk) { - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH; - } else { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH; - } + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; info->n_data_chunks_ep2++; info->n_data_bytes_ep2+=length; } @@ -1094,11 +1070,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi info->max_tsn2 = tsnumber; if (datachunk) { - if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH; - } else { - length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH; - } + length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH; info->n_data_chunks_ep2++; info->n_data_bytes_ep2+=length; } diff --git a/ui/tap-sctp-analysis.h b/ui/tap-sctp-analysis.h index 8c939fbb4b..b7fabd19db 100644 --- a/ui/tap-sctp-analysis.h +++ b/ui/tap-sctp-analysis.h @@ -56,7 +56,6 @@ extern "C" { #define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 #define SCTP_AUTH_CHUNK_ID 15 #define SCTP_NR_SACK_CHUNK_ID 16 -#define SCTP_I_DATA_CHUNK_ID 0x40 #define SCTP_ASCONF_ACK_CHUNK_ID 0x80 #define SCTP_PKTDROP_CHUNK_ID 0x81 #define SCTP_RE_CONFIG_CHUNK_ID 0x82 @@ -66,7 +65,7 @@ extern "C" { #define SCTP_IETF_EXT 0xFF #define IS_SCTP_CHUNK_TYPE(t) \ - (((t) <= 17) || ((t) == 0x40) || ((t) == 0xC0) || ((t) == 0xC1) || ((t) == 0x80) || ((t) == 0x81)) + (((t) <= 16) || ((t) == 0xC0) || ((t) == 0xC1) || ((t) == 0x80) || ((t) == 0x81)) #define CHUNK_TYPE_LENGTH 1 #define CHUNK_FLAGS_LENGTH 1 @@ -100,31 +99,11 @@ extern "C" { #define DATA_CHUNK_STREAM_ID_LENGTH 2 #define DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH 2 #define DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 -#define I_DATA_CHUNK_RESERVED_LENGTH 2 -#define I_DATA_CHUNK_MID_LENGTH 4 -#define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH 4 -#define I_DATA_CHUNK_FSN_LENGTH 4 -#define I_DATA_CHUNK_RESERVED_OFFSET (DATA_CHUNK_STREAM_ID_OFFSET + \ - DATA_CHUNK_STREAM_ID_LENGTH) -#define I_DATA_CHUNK_MID_OFFSET (I_DATA_CHUNK_RESERVED_OFFSET + \ - I_DATA_CHUNK_RESERVED_LENGTH) -#define I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ - I_DATA_CHUNK_MID_LENGTH) -#define I_DATA_CHUNK_FSN_OFFSET (I_DATA_CHUNK_MID_OFFSET + \ - I_DATA_CHUNK_MID_LENGTH) -#define I_DATA_CHUNK_PAYLOAD_OFFSET (I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_OFFSET + \ - I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ DATA_CHUNK_TSN_LENGTH + \ DATA_CHUNK_STREAM_ID_LENGTH + \ DATA_CHUNK_STREAM_SEQ_NUMBER_LENGTH + \ DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) -#define I_DATA_CHUNK_HEADER_LENGTH (CHUNK_HEADER_LENGTH + \ - DATA_CHUNK_TSN_LENGTH + \ - DATA_CHUNK_STREAM_ID_LENGTH + \ - I_DATA_CHUNK_RESERVED_LENGTH + \ - I_DATA_CHUNK_MID_LENGTH +\ - I_DATA_CHUNK_PAYLOAD_PROTOCOL_ID_LENGTH) #define MAX_ADDRESS_LEN 47 #define SCTP_ABORT_CHUNK_T_BIT 0x01 @@ -180,8 +159,7 @@ static const value_string chunk_type_values[] = { { SCTP_CWR_CHUNK_ID, "CWR" }, { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, { SCTP_AUTH_CHUNK_ID, "AUTH" }, - { SCTP_NR_SACK_CHUNK_ID, "NR_SACK" }, - { SCTP_I_DATA_CHUNK_ID, "I_DATA" }, + { SCTP_NR_SACK_CHUNK_ID, "NR-SACK" }, { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, { SCTP_RE_CONFIG_CHUNK_ID, "RE_CONFIG" }, |