diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-08-21 21:37:31 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2012-08-21 21:37:31 +0000 |
commit | d847bc85a5b1a5e12b996bdc0b1daf91d4576792 (patch) | |
tree | 5f99ff8fa1e24fb9cb65b04173e3d1f94916e27d /epan/dissectors/packet-pdcp-lte.c | |
parent | 1470f4a6b7c8ab48ea0855b6a193ee8dd7e6d0b4 (diff) |
Delete the ROHC from here as it is superceded by packet-rohc.c
svn path=/trunk/; revision=44610
Diffstat (limited to 'epan/dissectors/packet-pdcp-lte.c')
-rw-r--r-- | epan/dissectors/packet-pdcp-lte.c | 1679 |
1 files changed, 7 insertions, 1672 deletions
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index f845fdd274..4a734b4ddf 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -48,8 +48,6 @@ /* TODO: - Support for deciphering - Verify MAC authentication bytes - - Delete old ROHC support from here once sure everything useful useful has - been merged into packet-rohc.c */ @@ -65,7 +63,6 @@ static int hf_pdcp_lte_ueid = -1; static int hf_pdcp_lte_channel_type = -1; static int hf_pdcp_lte_channel_id = -1; -/* static int hf_pdcp_lte_rohc = -1; */ static int hf_pdcp_lte_rohc_compression = -1; static int hf_pdcp_lte_rohc_mode = -1; static int hf_pdcp_lte_rohc_rnd = -1; @@ -93,88 +90,6 @@ static int hf_pdcp_lte_fms = -1; static int hf_pdcp_lte_bitmap = -1; static int hf_pdcp_lte_bitmap_not_received = -1; -/* Robust Header Compression Fields */ -#if 0 -static int hf_pdcp_lte_rohc_padding = -1; -static int hf_pdcp_lte_rohc_r_0_crc = -1; -static int hf_pdcp_lte_rohc_feedback = -1; - -static int hf_pdcp_lte_rohc_type0_t = -1; -static int hf_pdcp_lte_rohc_type1_t = -1; -static int hf_pdcp_lte_rohc_type2_t = -1; - -static int hf_pdcp_lte_rohc_d = -1; -static int hf_pdcp_lte_rohc_ir_crc = -1; - -static int hf_pdcp_lte_rohc_static_ipv4 = -1; -static int hf_pdcp_lte_rohc_ip_version = -1; -static int hf_pdcp_lte_rohc_ip_protocol = -1; -static int hf_pdcp_lte_rohc_ip_src = -1; -static int hf_pdcp_lte_rohc_ip_dst = -1; - -static int hf_pdcp_lte_rohc_static_udp = -1; -static int hf_pdcp_lte_rohc_static_udp_src_port = -1; -static int hf_pdcp_lte_rohc_static_udp_dst_port = -1; - -static int hf_pdcp_lte_rohc_static_rtp = -1; -static int hf_pdcp_lte_rohc_static_rtp_ssrc = -1; - -static int hf_pdcp_lte_rohc_dynamic_ipv4 = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_tos = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_ttl = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_id = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_df = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_rnd = -1; -static int hf_pdcp_lte_rohc_dynamic_ipv4_nbo = -1; - -static int hf_pdcp_lte_rohc_dynamic_udp = -1; -static int hf_pdcp_lte_rohc_dynamic_udp_checksum = -1; -static int hf_pdcp_lte_rohc_dynamic_udp_seqnum = -1; - -static int hf_pdcp_lte_rohc_dynamic_rtp = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_rx = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_cc = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_seqnum = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_timestamp = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_reserved3 = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_x = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_mode = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_tis = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_tss = -1; -static int hf_pdcp_lte_rohc_dynamic_rtp_ts_stride = -1; - -static int hf_pdcp_lte_rohc_ts = -1; -static int hf_pdcp_lte_rohc_m = -1; -static int hf_pdcp_lte_rohc_uor2_sn = -1; -static int hf_pdcp_lte_rohc_uor2_x = -1; - -static int hf_pdcp_lte_rohc_add_cid = -1; -static int hf_pdcp_lte_rohc_large_cid = -1; - -static int hf_pdcp_lte_rohc_uo0_sn = -1; -static int hf_pdcp_lte_rohc_uo0_crc = -1; - -static int hf_pdcp_lte_rohc_r0_sn = -1; -static int hf_pdcp_lte_rohc_r0_crc_sn = -1; -static int hf_pdcp_lte_rohc_r0_crc_crc = -1; - -static int hf_pdcp_lte_rohc_feedback_code = -1; -static int hf_pdcp_lte_rohc_feedback_size = -1; -static int hf_pdcp_lte_rohc_feedback_feedback1 = -1; -static int hf_pdcp_lte_rohc_feedback_feedback2 = -1; -static int hf_pdcp_lte_rohc_feedback_ack_type = -1; -static int hf_pdcp_lte_rohc_feedback_mode = -1; -static int hf_pdcp_lte_rohc_feedback_sn = -1; -static int hf_pdcp_lte_rohc_feedback_option = -1; -static int hf_pdcp_lte_rohc_feedback_length = -1; -static int hf_pdcp_lte_rohc_feedback_crc = -1; -static int hf_pdcp_lte_rohc_feedback_option_sn = -1; -static int hf_pdcp_lte_rohc_feedback_option_clock = -1; - -static int hf_pdcp_lte_rohc_ip_id = -1; -static int hf_pdcp_lte_rohc_udp_checksum = -1; -static int hf_pdcp_lte_rohc_payload = -1; -#endif /* Sequence Analysis */ static int hf_pdcp_lte_sequence_analysis = -1; @@ -194,14 +109,7 @@ static int ett_pdcp = -1; static int ett_pdcp_configuration = -1; static int ett_pdcp_packet = -1; static int ett_pdcp_lte_sequence_analysis = -1; -static int ett_pdcp_rohc = -1; -static int ett_pdcp_rohc_static_ipv4 = -1; -static int ett_pdcp_rohc_static_udp = -1; -static int ett_pdcp_rohc_static_rtp = -1; -static int ett_pdcp_rohc_dynamic_ipv4 = -1; -static int ett_pdcp_rohc_dynamic_udp = -1; -static int ett_pdcp_rohc_dynamic_rtp = -1; -static int ett_pdcp_rohc_report_bitmap = -1; +static int ett_pdcp_report_bitmap = -1; static const value_string direction_vals[] = @@ -493,7 +401,7 @@ static void addChannelSequenceInfo(pdcp_sequence_report_in_frame *p, ti = proto_tree_add_boolean(seqnum_tree, hf_pdcp_lte_sequence_analysis_ok, tvb, 0, 0, TRUE); PROTO_ITEM_SET_GENERATED(ti); - proto_item_append_text(seqnum_ti, " - OK"); + proto_item_append_string(seqnum_ti, " - OK"); /* Link to next SN in channel (if known) */ if (p->nextFrameNum != 0) { @@ -732,963 +640,6 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, /***************************************************************/ -#if 0 -/* Dissect a Large-CID field. - Return following offset */ -static int dissect_large_cid(proto_tree *tree, - tvbuff_t *tvb, - int offset) -{ - guint8 first_octet = tvb_get_guint8(tvb, offset); - - if ((first_octet & 0x80) == 0) { - /* One byte */ - proto_tree_add_uint(tree, hf_pdcp_lte_rohc_large_cid, tvb, offset, 1, - first_octet); - return offset+1; - } - else { - /* Two bytes */ - guint16 bytes = tvb_get_ntohs(tvb, offset) & 0x7fff; - proto_tree_add_uint(tree, hf_pdcp_lte_rohc_large_cid, tvb, offset, 2, - bytes); - return offset+2; - } - -} - -static int dissect_pdcp_dynamic_chain(proto_tree *tree, - proto_item *root_item _U_, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - /* IPv4 dynamic */ - if (p_pdcp_info->rohc_ip_version == 4) { - proto_tree *dynamic_ipv4_tree; - proto_item *root_ti; - int tree_start_offset = offset; - guint8 tos, ttl, rnd, nbo; - guint16 id; - - /* Create dynamic IPv4 subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_dynamic_ipv4, tvb, offset, -1, ENC_NA); - dynamic_ipv4_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_dynamic_ipv4); - - /* ToS */ - tos = tvb_get_guint8(tvb, offset); - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_tos, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* TTL */ - ttl = tvb_get_guint8(tvb, offset); - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_ttl, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* IP-ID */ - id = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_id, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* IP flags */ - rnd = (tvb_get_guint8(tvb, offset) & 0x40) >> 6; - nbo = (tvb_get_guint8(tvb, offset) & 0x20) >> 5; - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_df, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_rnd, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(dynamic_ipv4_tree, hf_pdcp_lte_rohc_dynamic_ipv4_nbo, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* TODO: general extension header list... */ - offset++; - - /* Set proper length for subtree */ - proto_item_set_len(root_ti, offset-tree_start_offset); - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (ToS=%u, TTL=%u, ID=%u, RND=%u, NBO=%u)", - tos, ttl, id, rnd, nbo); - } - - /* UDP dynamic */ - if ((p_pdcp_info->profile == 1) || - (p_pdcp_info->profile == 2)) { - - proto_tree *dynamic_udp_tree; - proto_item *root_ti; - unsigned short checksum; - - /* Create dynamic UDP subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_dynamic_udp, tvb, offset, 2, ENC_NA); - dynamic_udp_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_dynamic_udp); - - /* 16-bit checksum */ - checksum = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(dynamic_udp_tree, hf_pdcp_lte_rohc_dynamic_udp_checksum, tvb, offset, 2, ENC_BIG_ENDIAN); - offset +=2; - - if (p_pdcp_info->profile == 2) { - guint16 seqnum; - - seqnum = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(dynamic_udp_tree, hf_pdcp_lte_rohc_dynamic_udp_seqnum, tvb, offset, 2, ENC_BIG_ENDIAN); - offset +=2; - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (checksum = %04x, seqnum = %u)", checksum, seqnum); - } - else { - /* Add summary to root item */ - proto_item_append_text(root_ti, " (checksum = %04x)", checksum); - } - } - - /* RTP dynamic */ - if (p_pdcp_info->profile == 1) { - proto_tree *dynamic_rtp_tree; - proto_item *root_ti; - int tree_start_offset = offset; - guint8 rx; - /*guint8 contributing_csrcs;*/ - guint16 sequence_number; - guint32 timestamp; - guint8 tis=0, tss=0; - guint64 ts_stride=0; - - /* Create dynamic RTP subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_dynamic_rtp, tvb, offset, -1, ENC_NA); - dynamic_rtp_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_dynamic_rtp); - - /* TODO: */ - /* V | P | RX | CC */ - rx = tvb_get_guint8(tvb, offset) & 0x10; - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_rx, tvb, offset, 1, ENC_BIG_ENDIAN); - /*contributing_csrcs = tvb_get_guint8(tvb, offset) & 0x0f;*/ - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_cc, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - - /* TODO: */ - /* M | PT */ - offset += 1; - - /* Sequence number */ - sequence_number = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_seqnum, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* Timestamp (4 octets) */ - timestamp = tvb_get_ntohl(tvb, offset); - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - /* TODO: CSRC list */ - /*offset += (4 * contributing_csrcs); */ - offset++; - - /* TODO: Reserved | X | Mode | TIS | TIS */ - if (rx) { - guint8 this_byte = tvb_get_guint8(tvb, offset); - proto_item *reserved_ti = proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_reserved3, - tvb, offset, 1, ENC_BIG_ENDIAN); - - /* Check reserved bits are 0 */ - if ((this_byte & 0xe0) != 0) { - expert_add_info_format(pinfo, reserved_ti, PI_MALFORMED, PI_ERROR, - "Reserved bits have value 0x%x - should be 0x0", - (this_byte & 0xe0)); - } - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_x, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_mode, tvb, offset, 1, ENC_BIG_ENDIAN); - tss = (this_byte & 0x02); - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_tss, tvb, offset, 1, ENC_BIG_ENDIAN); - tis = (this_byte & 0x01); - proto_tree_add_item(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_tis, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - } - - /* TODO: the length of these fields can be learned by looked at the leading bits, see - RFC 3095, "4.5.6. Self-describing variable-length values" */ - /* TODO: TS-Stride (1-4 bytes) */ - if (tis) { - /* Assume encoded in two bytes for now... */ - proto_tree_add_bits_ret_val(dynamic_rtp_tree, hf_pdcp_lte_rohc_dynamic_rtp_ts_stride, - tvb, offset*8 + 2, 14, &ts_stride, ENC_BIG_ENDIAN); - offset += 2; - } - - /* TODO: Time-stride (1-4 bytes) */ - if (tss) { - } - - /* Set proper length for subtree */ - proto_item_set_len(root_ti, offset-tree_start_offset); - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (seqnum = %u, timestamp = %u)", - sequence_number, timestamp); - } - - return offset; -} - -#endif -#if 0 -static int dissect_pdcp_irdyn_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - - col_append_str(pinfo->cinfo, COL_INFO, " IRDYN"); - proto_item_append_text(root_item, " (IRDYN)"); - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Profile */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_profile, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* 8-bit CRC */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_ir_crc, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Dissect dynamic chain */ - offset = dissect_pdcp_dynamic_chain(tree, - root_item, - tvb, - offset, - p_pdcp_info, - pinfo); - return offset; -} -#endif - -#if 0 -static int dissect_pdcp_ir_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - unsigned char dynamic_chain_present; - rohc_info *p_rohc_info; - - col_append_str(pinfo->cinfo, COL_INFO, " IR"); - proto_item_append_text(root_item, " (IR)"); - - /* Is dynamic chain present? */ - dynamic_chain_present = tvb_get_guint8(tvb, offset) & 0x1; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_d, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Profile */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_profile, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* 8-bit CRC */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_ir_crc, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* IPv4 static part */ - if (p_pdcp_info->rohc_ip_version == 4) { - proto_tree *static_ipv4_tree; - proto_item *root_ti; - int tree_start_offset = offset; - guint8 protocol; - guint32 source, dest; - - /* Create static IPv4 subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_static_ipv4, tvb, offset, -1, ENC_NA); - static_ipv4_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_static_ipv4); - - /* IP version (must be 4) */ - proto_tree_add_item(static_ipv4_tree, hf_pdcp_lte_rohc_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Protocol */ - protocol = tvb_get_guint8(tvb, offset); - proto_tree_add_item(static_ipv4_tree, hf_pdcp_lte_rohc_ip_protocol, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Source address */ - source = tvb_get_ipv4(tvb, offset); - proto_tree_add_item(static_ipv4_tree, hf_pdcp_lte_rohc_ip_src, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - /* Dest address */ - dest = tvb_get_ipv4(tvb, offset); - proto_tree_add_item(static_ipv4_tree, hf_pdcp_lte_rohc_ip_dst, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - /* Set proper length for subtree */ - proto_item_set_len(root_ti, offset-tree_start_offset); - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (prot=%s: %s -> %s)", - val_to_str_const(protocol, ip_protocol_vals, "Unknown"), - get_hostname(source), - get_hostname(dest)); - } - - /* UDP static part. TODO: also check protocol from last part!? */ - if ((p_pdcp_info->profile == 1) || - (p_pdcp_info->profile == 2)) { - - proto_tree *static_udp_tree; - proto_item *root_ti; - int tree_start_offset = offset; - unsigned short source_port, dest_port; - - /* Create static UDP subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_static_udp, tvb, offset, -1, ENC_NA); - static_udp_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_static_udp); - - /* Source port */ - source_port = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(static_udp_tree, hf_pdcp_lte_rohc_static_udp_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* Dest port */ - dest_port = tvb_get_ntohs(tvb, offset); - proto_tree_add_item(static_udp_tree, hf_pdcp_lte_rohc_static_udp_src_port, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - - /* Set proper length for subtree */ - proto_item_set_len(root_ti, offset-tree_start_offset); - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (%u -> %u)", source_port, dest_port); - } - - /* RTP static */ - if (p_pdcp_info->profile == 1) { - proto_tree *static_rtp_tree; - proto_item *root_ti; - guint32 ssrc; - - /* Create static RTP subtree */ - root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_static_rtp, tvb, offset, 4, ENC_NA); - static_rtp_tree = proto_item_add_subtree(root_ti, ett_pdcp_rohc_static_rtp); - - /* SSRC */ - ssrc = tvb_get_ntohl(tvb, offset); - proto_tree_add_item(static_rtp_tree, hf_pdcp_lte_rohc_static_rtp_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; - - /* Add summary to root item */ - proto_item_append_text(root_ti, " (SSRC=%u)", ssrc); - } - - - /* Dynamic chain */ - if (dynamic_chain_present) { - offset = dissect_pdcp_dynamic_chain(tree, - root_item, - tvb, - offset, - p_pdcp_info, - pinfo); - } - - return offset; -} - - -static int dissect_pdcp_feedback_feedback1(proto_tree *tree, - proto_item *item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info _U_, - packet_info *pinfo) -{ - guint8 sn; - - proto_item_append_text(item, " (type 1)"); - - /* TODO: profile-specific */ - sn = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_feedback1, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn); - - return offset; -} - -/* Includes Large-CID, if present */ -static int dissect_pdcp_feedback_feedback2(proto_tree *tree, - proto_item *item, - tvbuff_t *tvb, - int offset, - int size, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - proto_item *ti; - guint8 ack_type; - guint8 mode; - guint8 first_octet; - guint16 sn; - const char *full_mode_name; - int size_remaining; - - proto_item_append_text(item, " (type 2)"); - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Feedback2 hidden filter */ - ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_feedback2, tvb, offset, -1, ENC_NA); - PROTO_ITEM_SET_HIDDEN(ti); - - /* Ack-type */ - first_octet = tvb_get_guint8(tvb, offset); - ack_type = (first_octet & 0xc0) >> 6; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_ack_type, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* TODO: expert info on NACK? */ - - /* Mode */ - mode = (first_octet & 0x30) >> 4; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_mode, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* Show ACK-TYPE(Mode) in info column */ - full_mode_name = val_to_str_const(mode, rohc_mode_vals, "Error"); - - col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%c)", - val_to_str_const(ack_type, feedback_ack_vals, "Unknown"), - full_mode_name[0]); - - /* 11 bits of SN */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_sn, tvb, offset, 2, ENC_BIG_ENDIAN); - sn = tvb_get_ntohs(tvb, offset) & 0x7ff; - offset += 2; - - col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn); - - /* Loop over any remaining feedback options */ - size_remaining = size - 2; - - while (tvb_length_remaining(tvb, offset) > 0) { - guint8 option = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; - guint8 length = tvb_get_guint8(tvb, offset) & 0x0f; - guint8 one_byte_value; - - /* Preference setting controls showing option and lengths */ - if (global_pdcp_show_feedback_option_tag_length) { - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_option, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_length, tvb, offset, 1, ENC_BIG_ENDIAN); - } - offset++; - size_remaining--; - - /* TODO: switch including missing option types */ - switch (option) { - case 1: - /* CRC */ - one_byte_value = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_crc, tvb, offset, 1, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " CRC=%u ", one_byte_value); - break; - case 2: - /* REJECT: TODO */ - break; - case 3: - /* SN-Not-Valid: TODO */ - break; - case 4: - /* SN */ - one_byte_value = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_option_sn, tvb, offset, 1, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%u ", one_byte_value); - break; - case 5: - /* Clock */ - one_byte_value = tvb_get_guint8(tvb, offset); - proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_option_clock, tvb, offset, 1, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " Clock=%u ", one_byte_value); - break; - case 6: - /* Jitter: TODO */ - break; - case 7: - /* Loss: TODO */ - break; - - default: - /* TODO: unhandled option */ - break; - } - - /* Skip length */ - offset += length; - size_remaining -= length; - } - - return offset; -} - - -/* Dissect a feedback packet. - Return following offset */ -static int dissect_pdcp_feedback_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - guint8 code; - guint8 size; - proto_item *ti; - proto_item *feedback_ti; - proto_tree *feedback_tree; - - col_append_str(pinfo->cinfo, COL_INFO, " Feedback"); - proto_item_append_text(root_item, " (Feedback)"); - - /* Create feedback tree root */ - feedback_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback, tvb, offset, -1, ENC_NA); - feedback_tree = proto_item_add_subtree(feedback_ti, ett_pdcp_packet); - - /* Code */ - code = tvb_get_guint8(tvb, offset) & 0x07; - ti = proto_tree_add_item(feedback_tree, hf_pdcp_lte_rohc_feedback_code, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Optional length field */ - if (code != 0) { - proto_item_append_text(ti, " (length of feedback data)"); - size = code; - } - else { - proto_tree_add_item(feedback_tree, hf_pdcp_lte_rohc_feedback_size, tvb, offset, 1, ENC_BIG_ENDIAN); - size = tvb_get_guint8(tvb, offset); - offset++; - } - - /* Work out feedback type */ - if ((p_pdcp_info->cid_inclusion_info == CID_IN_ROHC_PACKET) && - !p_pdcp_info->large_cid_present) { - - /* Small CID */ - if (size == 1) { - offset = dissect_pdcp_feedback_feedback1(feedback_tree, feedback_ti, tvb, offset, p_pdcp_info, pinfo); - } - else if ((size > 1) && ((tvb_get_guint8(tvb, offset) & 0xc0) == 0xc0)) { - /* Add-CID here! */ - proto_tree_add_item(feedback_tree, hf_pdcp_lte_rohc_add_cid, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - if (size == 2) { - offset = dissect_pdcp_feedback_feedback1(feedback_tree, feedback_ti, tvb, offset, p_pdcp_info, pinfo); - } - else { - offset = dissect_pdcp_feedback_feedback2(feedback_tree, feedback_ti, tvb, offset, size, p_pdcp_info, pinfo); - } - } - else { - offset = dissect_pdcp_feedback_feedback2(feedback_tree, feedback_ti, tvb, offset, size, p_pdcp_info, pinfo); - } - } - else { - offset = dissect_pdcp_feedback_feedback2(feedback_tree, feedback_ti, tvb, offset, size, p_pdcp_info, pinfo); - } - - return offset; -} - - -/* Dissect R-0 packet. - Return following offset */ -static int dissect_pdcp_r_0_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - guint8 sn; - - col_append_str(pinfo->cinfo, COL_INFO, " R-0"); - proto_item_append_text(root_item, " (R-0)"); - - /* 6 bits of sn */ - sn = tvb_get_guint8(tvb, offset) & 0x3f; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_r0_sn, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn); - - return offset; -} - - -/* Dissect R-0-CRC packet. - Return following offset */ -static int dissect_pdcp_r_0_crc_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - guint8 sn; - - col_append_str(pinfo->cinfo, COL_INFO, " R-0-CRC"); - proto_item_append_text(root_item, " (R-0-CRC)"); - - proto_tree_add_item(tree, hf_pdcp_lte_rohc_r_0_crc, tvb, offset, -1, ENC_NA); - - /* 7 bits of sn */ - /* TODO: wrong! Large-cid may be in-between!!!! */ - sn = tvb_get_guint8(tvb, offset) & 0x3f; - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Conclude SN */ - sn = (sn << 1) + ((tvb_get_guint8(tvb, offset) & 0x80) >> 7); - proto_tree_add_uint(tree, hf_pdcp_lte_rohc_r0_crc_sn, tvb, offset, 1, sn); - - /* 7 bit CRC */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_r0_crc_crc, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* Show SN in info column */ - col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn); - - return offset; -} - - -/* Dissect UO-0-CRC packet. - Return following offset */ -static int dissect_pdcp_uo_0_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - guint8 sn; - - col_append_str(pinfo->cinfo, COL_INFO, " U0-0"); - proto_item_append_text(root_item, " (UO-0)"); - - /* SN */ - sn = (tvb_get_guint8(tvb, offset) & 0x78) >> 3; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_uo0_sn, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* CRC (3 bits) */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_uo0_crc, tvb, offset, 1, ENC_BIG_ENDIAN); - - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Show SN in info column */ - col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn); - - return offset; -} - - -/* Dissect R-1 packet. - Return following offset */ -static int dissect_pdcp_r_1_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - col_append_str(pinfo->cinfo, COL_INFO, " R-1"); - proto_item_append_text(root_item, " (R-1)"); - - /* TODO: octet before large-cid */ - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - if (p_pdcp_info->profile == 1) { - /* TODO: */ - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - } - - return offset; -} - - -/* Dissect R-1-TS or R-1-ID packet. - Return following offset */ -static int dissect_pdcp_r_1_ts_or_id_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - unsigned char T; - - /* TODO: octet before large-cid */ - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* T determines frame type */ - T = tvb_get_guint8(tvb, ++offset) >> 7; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_type1_t, tvb, offset, 1, ENC_BIG_ENDIAN); - if (T) { - col_append_str(pinfo->cinfo, COL_INFO, " R-1-TS"); - proto_item_append_text(root_item, " (R-1-TS)"); - } - else { - col_append_str(pinfo->cinfo, COL_INFO, " R-1-ID"); - proto_item_append_text(root_item, " (R-1-ID)"); - } - - if (p_pdcp_info->profile == 1) { - /* TODO: */ - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - } - - return offset; -} - - -/* Dissect UO-1 packet. - Return following offset */ -static int dissect_pdcp_uo_1_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - col_append_str(pinfo->cinfo, COL_INFO, " UO-1"); - proto_item_append_text(root_item, " (UO-1)"); - - /* TODO: octet before large-cid */ - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - if (p_pdcp_info->profile == 1) { - /* TODO: */ - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - } - - return offset; -} - - -/* Dissect UO-1-TS or UO-1-ID packet. - Return following offset */ -static int dissect_pdcp_uo_1_ts_or_id_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - unsigned char T; - - /* TODO: octet before large-cid */ - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* T determines frame type */ - T = tvb_get_guint8(tvb, ++offset) >> 5; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_type0_t, tvb, offset, 1, ENC_BIG_ENDIAN); - if (T) { - col_append_str(pinfo->cinfo, COL_INFO, " UO-1-TS"); - proto_item_append_text(root_item, " (UO-1-TS)"); - } - else { - col_append_str(pinfo->cinfo, COL_INFO, " UO-1-ID"); - proto_item_append_text(root_item, " (UO-1-ID)"); - } - - if (p_pdcp_info->profile == 1) { - /* TODO: */ - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - } - - return offset; -} - - - - - -/* Dissect UOR-2 packet. - Return following offset */ -static int dissect_pdcp_uor_2_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - guint8 ts; - - col_append_str(pinfo->cinfo, COL_INFO, " U0R-2"); - proto_item_append_text(root_item, " (UOR-2)"); - - /* TS straddles CID */ - ts = tvb_get_guint8(tvb, offset) & 0x1f; - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* Last bit of TS is here */ - ts = (ts << 1) | (tvb_get_guint8(tvb, offset) >> 7); - proto_tree_add_uint(tree, hf_pdcp_lte_rohc_ts, tvb, offset, 1, ts); - - if (p_pdcp_info->profile == 1) { - /* M */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_m, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* SN (6 bits) */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_uor2_sn, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - - /* X (one bit) */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_uor2_x, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* TODO: CRC */ - offset++; - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - offset += 2; - } - - return offset; -} - - -/* Dissect UOR-2-TS or UOR-2-ID packet. - Return following offset */ -static int dissect_pdcp_uor_2_ts_or_id_packet(proto_tree *tree, - proto_item *root_item, - tvbuff_t *tvb, - int offset, - struct pdcp_lte_info *p_pdcp_info, - packet_info *pinfo) -{ - unsigned char T; - - /* TODO: octet before large-cid. - TODO: can't decode this until we know what T is, - but T is after large-cid... */ - offset++; - - /* T determines frame type */ - T = tvb_get_guint8(tvb, offset) >> 7; - proto_tree_add_item(tree, hf_pdcp_lte_rohc_type2_t, tvb, offset, 1, ENC_BIG_ENDIAN); - - if (T) { - col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-TS"); - proto_item_append_text(root_item, " (UOR-2-TS)"); - } - else { - col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-ID"); - proto_item_append_text(root_item, " (UOR-2-ID)"); - } - - - if (T) { - /* UOR-2-TS format */ - - /* TS */ - guint8 ts = tvb_get_guint8(tvb, offset) & 0x1f; - proto_tree_add_uint(tree, hf_pdcp_lte_rohc_ts, tvb, offset, 1, ts); - offset++; - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* m */ - proto_tree_add_item(tree, hf_pdcp_lte_rohc_m, tvb, offset, 1, ENC_BIG_ENDIAN); - - /* TODO: */ - } - else { - /* TODO: UOR-2-ID format */ - - /* IP-ID */ - - /* Large CID */ - if (p_pdcp_info->large_cid_present) { - offset = dissect_large_cid(tree, tvb, offset); - } - - /* TODO: */ - } - - if (p_pdcp_info->profile == 1) { - /* TODO: */ - } - else if (p_pdcp_info->profile == 2) { - /* TODO: */ - } - - return offset; -} -#endif - - /* Show in the tree the config info attached to this frame, as generated fields */ static void show_pdcp_config(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, @@ -2007,14 +958,6 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree struct pdcp_lte_info *p_pdcp_info; rohc_info *p_rohc_info = NULL; tvbuff_t *rohc_tvb = NULL; -#if 0 - proto_tree *rohc_tree = NULL; - proto_item *rohc_ti = NULL; - guint8 base_header_byte; - gboolean udp_checksum_needed = TRUE; - gboolean ip_id_needed = TRUE; -#endif - /* Append this protocol name rather than replace. */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "PDCP-LTE"); @@ -2208,7 +1151,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree if (tvb_length_remaining(tvb, offset) > 0) { bitmap_ti = proto_tree_add_item(pdcp_tree, hf_pdcp_lte_bitmap, tvb, offset, -1, ENC_NA); - bitmap_tree = proto_item_add_subtree(bitmap_ti, ett_pdcp_rohc_report_bitmap); + bitmap_tree = proto_item_add_subtree(bitmap_ti, ett_pdcp_report_bitmap); /* For each byte... */ @@ -2361,13 +1304,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree val_to_str_const(p_pdcp_info->profile, rohc_profile_vals, "Unknown")); return; } -#if 0 - /* Create pdcp tree. */ - if (pdcp_tree) { - rohc_ti = proto_tree_add_item(pdcp_tree, hf_pdcp_lte_rohc, tvb, offset, -1, ENC_NA); - rohc_tree = proto_item_add_subtree(rohc_ti, ett_pdcp_rohc); - } -#endif + rohc_offset = offset; rohc_tvb = tvb_new_subset_remaining(tvb, rohc_offset); @@ -2394,198 +1331,11 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree col_clear(pinfo->cinfo, COL_INFO); } + /* Call the ROHC dissector */ call_dissector(rohc_handle, rohc_tvb, pinfo, tree); /* Let RLC write to columns again */ col_set_writable(pinfo->cinfo, global_pdcp_lte_layer_to_show == ShowRLCLayer); - - return; - -#if 0 - /* Skip any leading padding octets (11100000) */ - while (tvb_get_guint8(tvb, offset) == 0xe0) { - offset++; - } - if (offset > rohc_offset) { - proto_tree_add_item(rohc_tree, hf_pdcp_lte_rohc_padding, tvb, rohc_offset, - offset-rohc_offset, ENC_NA); - } - - /* Add-CID octet */ - cid = 0; - if ((p_pdcp_info->cid_inclusion_info == CID_IN_ROHC_PACKET) && - !p_pdcp_info->large_cid_present) - { - if (((tvb_get_guint8(tvb, offset) >> 4) & 0x0f) == 0x0e) { - cid = tvb_get_guint8(tvb, offset) & 0x0f; - proto_tree_add_item(rohc_tree, hf_pdcp_lte_rohc_add_cid, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - } - else { - /* Assume CID value of 0 if field absent */ - proto_item *ti = proto_tree_add_uint(rohc_tree, hf_pdcp_lte_rohc_add_cid, tvb, offset, 0, 0); - PROTO_ITEM_SET_GENERATED(ti); - } - } - - /* Now look at first octet of base header and identify packet type */ - base_header_byte = tvb_get_guint8(tvb, offset); - - /* IR (1111110) */ - if ((base_header_byte & 0xfe) == 0xfc) { - /* RoHC settings */ - p_rohc_info = ep_new(rohc_info); - - p_rohc_info->rohc_compression = p_pdcp_info->rohc_compression; - p_rohc_info->rohc_ip_version = p_pdcp_info->rohc_ip_version; - p_rohc_info->cid_inclusion_info = p_pdcp_info->cid_inclusion_info; - p_rohc_info->large_cid_present = p_pdcp_info->large_cid_present; - p_rohc_info->mode = p_pdcp_info->mode; - p_rohc_info->rnd = p_pdcp_info->rnd; - p_rohc_info->udp_checkum_present = p_pdcp_info->udp_checkum_present; - p_rohc_info->profile = p_pdcp_info->profile; - p_rohc_info->last_created_item = NULL; - - /*offset = dissect_pdcp_ir_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo);*/ - offset = dissect_rohc_ir_packet(tvb, rohc_tree, pinfo, offset, cid, TRUE/* fool the ROCH dissector */, p_rohc_info); - udp_checksum_needed = FALSE; - ip_id_needed = FALSE; - } - - /* IRDYN (11111000) */ - else if (base_header_byte == 0xf8) { - /* RoHC settings */ - p_rohc_info = ep_new(rohc_info); - - p_rohc_info->rohc_compression = p_pdcp_info->rohc_compression; - p_rohc_info->rohc_ip_version = p_pdcp_info->rohc_ip_version; - p_rohc_info->cid_inclusion_info = p_pdcp_info->cid_inclusion_info; - p_rohc_info->large_cid_present = p_pdcp_info->large_cid_present; - p_rohc_info->mode = p_pdcp_info->mode; - p_rohc_info->rnd = p_pdcp_info->rnd; - p_rohc_info->udp_checkum_present = p_pdcp_info->udp_checkum_present; - p_rohc_info->profile = p_pdcp_info->profile; - p_rohc_info->last_created_item = NULL; - - /*offset = dissect_pdcp_irdyn_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo);*/ - offset = dissect_rohc_ir_dyn_packet(tvb, rohc_tree, pinfo, offset, cid, TRUE/* fool the ROCH dissector */, p_rohc_info); - udp_checksum_needed = FALSE; - ip_id_needed = FALSE; - } - - /* Feedback (begins with 11110) */ - else if (((base_header_byte & 0xf8) >> 3) == 0x1e) { - offset = dissect_pdcp_feedback_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - return; - } - - /* Packet type 0 (0) */ - else if ((base_header_byte & 0x80) == 0) { - - /* TODO: decide type based upon: - - mode - - 2nd bit - - length remaining (taking into account large-cid) */ - - /* R-0 begins with 00 */ - if (((base_header_byte & 0xc0) == 0) && - (p_pdcp_info->mode == RELIABLE_BIDIRECTIONAL)) { - - offset = dissect_pdcp_r_0_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } - - /* R-0-CRC begins with 01 */ - else if ((((base_header_byte & 0x40) >> 6) == 1) && - (p_pdcp_info->mode == RELIABLE_BIDIRECTIONAL)) { - - offset = dissect_pdcp_r_0_crc_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } - - else { - offset = dissect_pdcp_uo_0_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } - } - - /* Packet type 1 (10) */ - else if (((base_header_byte & 0xc0) >> 6) == 2) { - - switch (p_pdcp_info->mode) { - - case RELIABLE_BIDIRECTIONAL: - /* R-1 if !(ipv4 && rand) */ - if (!((p_pdcp_info->rohc_ip_version == 4) && - (!p_pdcp_info->rnd))) { - offset = dissect_pdcp_r_1_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - return; - } - else { - /* Whether its R-1-ID or R-1-TS depends upon T bit */ - dissect_pdcp_r_1_ts_or_id_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - return; - } - break; - - case UNIDIRECTIONAL: - case OPTIMISTIC_BIDIRECTIONAL: - /* UO-1 if !(ipv4 && rand) */ - if (!((p_pdcp_info->rohc_ip_version == 4) && - (!p_pdcp_info->rnd))) { - - dissect_pdcp_uo_1_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } else { - /* Whether its UO-1-ID or UO-1-TS depends upon T bit */ - dissect_pdcp_uo_1_ts_or_id_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } - - return; - - } - } - - /* Packet type 2 (110) */ - else if (((base_header_byte & 0xe0) >> 5) == 6) { - - /* UOR-2 if !(ipv4 && rand) */ - if (!((p_pdcp_info->rohc_ip_version == 4) && - (!p_pdcp_info->rnd))) { - - dissect_pdcp_uor_2_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - } - else { - /* Whether its UOR-2-ID or UOR-2-TS depends upon T bit */ - dissect_pdcp_uor_2_ts_or_id_packet(rohc_tree, rohc_ti, tvb, offset, p_pdcp_info, pinfo); - return; - } - } - - /* Segment (1111111) */ - else if ((base_header_byte & 0xfe) == 0xfe) { - /* TODO: */ - return; - } - - - /* Fields beyond base header */ - - /* These 2 fields not present for IR, IR-DYN frames */ - - /* IP-ID */ - if (p_pdcp_info->rnd && ip_id_needed) { - proto_tree_add_item(rohc_tree, hf_pdcp_lte_rohc_ip_id, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - } - - /* UDP Checksum */ - if (p_pdcp_info->udp_checkum_present && udp_checksum_needed) { - proto_tree_add_item(rohc_tree, hf_pdcp_lte_rohc_udp_checksum, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - } - - /* Payload */ - if (tvb_reported_length_remaining(tvb, offset) > 0) { - proto_tree_add_item(rohc_tree, hf_pdcp_lte_rohc_payload, tvb, offset, -1, ENC_NA); - } -#endif } /* Initializes the hash tables each time a new @@ -2829,414 +1579,6 @@ void proto_register_pdcp(void) } }, -#if 0 - { &hf_pdcp_lte_rohc, - { "ROHC Message", - "pdcp-lte.rohc", FT_NONE, BASE_NONE, NULL, 0, - NULL, HFILL - } - }, - - { &hf_pdcp_lte_rohc_padding, - { "Padding", - "pdcp-lte.rohc.padding", FT_NONE, BASE_NONE, NULL, 0, - "ROHC Padding", HFILL - } - }, - { &hf_pdcp_lte_rohc_r_0_crc, - { "R-0-CRC Packet", - "pdcp-lte.r-0-crc", FT_NONE, BASE_NONE, NULL, 0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback, - { "Feedback", - "pdcp-lte.rohc.feedback", FT_NONE, BASE_NONE, NULL, 0, - "Feedback Packet", HFILL - } - }, - { &hf_pdcp_lte_rohc_type0_t, - { "T", - "pdcp-lte.rohc.t0.t", FT_UINT8, BASE_HEX, VALS(t_vals), 0x20, - "Indicates whether frame type is TS (1) or ID (0)", HFILL - } - }, - { &hf_pdcp_lte_rohc_type1_t, - { "T", - "pdcp-lte.rohc.t1.t", FT_UINT8, BASE_HEX, VALS(t_vals), 0x80, - "Indicates whether frame type is TS (1) or ID (0)", HFILL - } - }, - { &hf_pdcp_lte_rohc_type2_t, - { "T", - "pdcp-lte.rohc.t2.t", FT_UINT8, BASE_HEX, VALS(t_vals), 0x80, - "Indicates whether frame type is TS (1) or ID (0)", HFILL - } - }, - { &hf_pdcp_lte_rohc_d, - { "D", - "pdcp-lte.rohc.d", FT_UINT8, BASE_HEX, NULL, 0x01, - "Indicates whether Dynamic chain is present", HFILL - } - }, - { &hf_pdcp_lte_rohc_ir_crc, - { "CRC", - "pdcp-lte.rohc.ir.crc", FT_UINT8, BASE_HEX, NULL, 0x0, - "8-bit CRC", HFILL - } - }, - - { &hf_pdcp_lte_rohc_static_ipv4, - { "Static IPv4 chain", - "pdcp-lte.rohc.static.ipv4", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_ip_version, - { "IP Version", - "pdcp-lte.rohc.ip-version", FT_UINT8, BASE_HEX, NULL, 0xf0, - NULL, HFILL - } - }, - /* TODO: create/use value_string */ - { &hf_pdcp_lte_rohc_ip_protocol, - { "IP Protocol", - "pdcp-lte.rohc.ip-protocol", FT_UINT8, BASE_DEC, VALS(ip_protocol_vals), 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_ip_src, - { "IP Source address", - "pdcp-lte.rohc.ip-src", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_ip_dst, - { "IP Destination address", - "pdcp-lte.rohc.ip-dst", FT_IPv4, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - - { &hf_pdcp_lte_rohc_static_udp, - { "Static UDP chain", - "pdcp-lte.rohc.static.udp", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_static_udp_src_port, - { "Static UDP source port", - "pdcp-lte.rohc.static.udp.src-port", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_static_udp_dst_port, - { "Static UDP destination port", - "pdcp-lte.rohc.static.udp.dst-port", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_static_rtp, - { "Static RTP chain", - "pdcp-lte.rohc.static.rtp", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_static_rtp_ssrc, - { "SSRC", - "pdcp-lte.rohc.static.rtp.ssrc", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, - "Static RTP chain SSRC", HFILL - } - }, - - { &hf_pdcp_lte_rohc_dynamic_ipv4, - { "Dynamic IPv4 chain", - "pdcp-lte.rohc.dynamic.ipv4", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_tos, - { "ToS", - "pdcp-lte.rohc.ip.tos", FT_UINT8, BASE_HEX, NULL, 0x0, - "IP Type of Service", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_ttl, - { "TTL", - "pdcp-lte.rohc.ip.ttl", FT_UINT8, BASE_HEX, NULL, 0x0, - "IP Time To Live", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_id, - { "IP-ID", - "pdcp-lte.rohc.ip.id", FT_UINT16, BASE_HEX, NULL, 0x0, - "IP ID", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_df, - { "Don't Fragment", - "pdcp-lte.rohc.ip.df", FT_UINT8, BASE_HEX, NULL, 0x80, - "IP Don't Fragment flag", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_rnd, - { "Random IP-ID field", - "pdcp-lte.rohc.ip.rnd", FT_UINT8, BASE_HEX, NULL, 0x40, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_ipv4_nbo, - { "Network Byte Order IP-ID field", - "pdcp-lte.rohc.ip.nbo", FT_UINT8, BASE_HEX, NULL, 0x20, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_udp, - { "Dynamic UDP chain", - "pdcp-lte.rohc.dynamic.udp", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_udp_checksum, - { "UDP Checksum", - "pdcp-lte.rohc.dynamic.udp.checksum", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_udp_seqnum, - { "UDP Sequence Number", - "pdcp-lte.rohc.dynamic.udp.seqnum", FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL - } - }, - - { &hf_pdcp_lte_rohc_dynamic_rtp, - { "Dynamic RTP chain", - "pdcp-lte.rohc.dynamic.rtp", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_rx, - { "RX", - "pdcp-lte.rohc.dynamic.rtp.rx", FT_UINT8, BASE_DEC, NULL, 0x10, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_cc, - { "Contributing CSRCs", - "pdcp-lte.rohc.dynamic.rtp.cc", FT_UINT8, BASE_DEC, NULL, 0x0f, - "Dynamic RTP chain CCs", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_seqnum, - { "RTP Sequence Number", - "pdcp-lte.rohc.dynamic.rtp.seqnum", FT_UINT16, BASE_DEC, NULL, 0x0, - "Dynamic RTP chain Sequence Number", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_timestamp, - { "RTP Timestamp", - "pdcp-lte.rohc.dynamic.rtp.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, - "Dynamic RTP chain Timestamp", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_reserved3, - { "Reserved", - "pdcp-lte.rohc.dynamic.rtp.reserved3", FT_UINT8, BASE_HEX, NULL, 0xc0, - "Reserved bits", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_x, - { "X", - "pdcp-lte.rohc.dynamic.rtp.x", FT_UINT8, BASE_DEC, NULL, 0x10, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_mode, - { "Mode", - "pdcp-lte.rohc.dynamic.rtp.mode", FT_UINT8, BASE_HEX, VALS(rohc_mode_vals), 0x0c, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_tis, - { "TIS", - "pdcp-lte.rohc.dynamic.rtp.tis", FT_UINT8, BASE_HEX, NULL, 0x02, - "Dynamic RTP chain TIS (indicates time_stride present)", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_tss, - { "TSS", - "pdcp-lte.rohc.dynamic.rtp.tss", FT_UINT8, BASE_HEX, NULL, 0x01, - "Dynamic RTP chain TSS (indicates TS_stride present)", HFILL - } - }, - { &hf_pdcp_lte_rohc_dynamic_rtp_ts_stride, - { "TS Stride", - "pdcp-lte.rohc.dynamic.rtp.ts-stride", FT_UINT32, BASE_DEC, NULL, 0x0, - "Dynamic RTP chain TS Stride", HFILL - } - }, - { &hf_pdcp_lte_rohc_ts, - { "TS", - "pdcp-lte.rohc.ts", FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_m, - { "M", - "pdcp-lte.rohc.m", FT_UINT8, BASE_DEC, NULL, 0x40, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_uor2_sn, - { "SN", - "pdcp-lte.rohc.uor2.sn", FT_UINT8, BASE_DEC, NULL, 0x3f, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_uor2_x, - { "X", - "pdcp-lte.rohc.uor2.x", FT_UINT8, BASE_DEC, NULL, 0x80, - NULL, HFILL - } - }, - - { &hf_pdcp_lte_rohc_add_cid, - { "Add-CID", - "pdcp-lte.rohc.add-cid", FT_UINT8, BASE_DEC, NULL, 0x0f, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_large_cid, - { "Large-CID", - "pdcp-lte.rohc.large-cid", FT_UINT16, BASE_DEC, NULL, 0x07ff, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_uo0_sn, - { "SN", - "pdcp-lte.rohc.uo0.sn", FT_UINT8, BASE_DEC, NULL, 0x78, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_uo0_crc, - { "CRC", - "pdcp-lte.rohc.uo0.crc", FT_UINT8, BASE_DEC, NULL, 0x07, - "3-bit CRC", HFILL - } - }, - { &hf_pdcp_lte_rohc_r0_sn, - { "SN", - "pdcp-lte.rohc.r0.sn", FT_UINT8, BASE_DEC, NULL, 0x3f, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_r0_crc_sn, - { "SN", - "pdcp-lte.rohc.r0-crc.sn", FT_UINT16, BASE_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_r0_crc_crc, - { "CRC7", - "pdcp-lte.rohc.r0-crc.crc", FT_UINT8, BASE_DEC, NULL, 0x7f, - "CRC 7", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_code, - { "Code", - "pdcp-lte.rohc.feedback-code", FT_UINT8, BASE_DEC, NULL, 0x07, - "Feedback options length (if > 0)", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_size, - { "Size", - "pdcp-lte.rohc.feedback-size", FT_UINT8, BASE_DEC, NULL, 0x0, - "Feedback options length", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_feedback1, - { "FEEDBACK-1 (SN)", - "pdcp-lte.rohc.feedback.feedback1", FT_UINT8, BASE_DEC, NULL, 0x0, - "Feedback-1", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_feedback2, - { "FEEDBACK-2", - "pdcp-lte.rohc.feedback.feedback2", FT_NONE, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, - - { &hf_pdcp_lte_rohc_feedback_ack_type, - { "Acktype", - "pdcp-lte.rohc.feedback-acktype", FT_UINT8, BASE_DEC, VALS(feedback_ack_vals), 0xc0, - "Feedback-2 ack type", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_mode, - { "mode", - "pdcp-lte.rohc.feedback-mode", FT_UINT8, BASE_DEC, VALS(rohc_mode_vals), 0x30, - "Feedback mode", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_sn, - { "SN", - "pdcp-lte.rohc.feedback-sn", FT_UINT16, BASE_DEC, NULL, 0x0fff, - "Feedback sequence number", HFILL - } - }, - - { &hf_pdcp_lte_rohc_feedback_option, - { "Option", - "pdcp-lte.rohc.feedback-option", FT_UINT8, BASE_DEC, VALS(feedback_option_vals), 0xf0, - "Feedback option", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_length, - { "Length", - "pdcp-lte.rohc.feedback-length", FT_UINT8, BASE_DEC, NULL, 0x0f, - "Feedback length", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_crc, - { "CRC", - "pdcp-lte.rohc.feedback-crc", FT_UINT8, BASE_HEX_DEC, NULL, 0x0, - "Feedback CRC", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_option_sn, - { "SN", - "pdcp-lte.rohc.feedback-option-sn", FT_UINT8, BASE_DEC, NULL, 0x0, - "Feedback Option SN", HFILL - } - }, - { &hf_pdcp_lte_rohc_feedback_option_clock, - { "Clock", - "pdcp-lte.rohc.feedback-option-clock", FT_UINT8, BASE_DEC, NULL, 0x0, - "Feedback Option Clock", HFILL - } - }, - - { &hf_pdcp_lte_rohc_ip_id, - { "IP-ID", - "pdcp-lte.rohc.ip-id", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_udp_checksum, - { "UDP Checksum", - "pdcp-lte.rohc.udp-checksum", FT_UINT16, BASE_HEX_DEC, NULL, 0x0, - NULL, HFILL - } - }, - { &hf_pdcp_lte_rohc_payload, - { "Payload", - "pdcp-lte.rohc.payload", FT_BYTES, BASE_NONE, NULL, 0x0, - NULL, HFILL - } - }, -#endif /* rohc fields that aren't used anymore */ }; @@ -3246,14 +1588,7 @@ void proto_register_pdcp(void) &ett_pdcp_configuration, &ett_pdcp_packet, &ett_pdcp_lte_sequence_analysis, - &ett_pdcp_rohc, - &ett_pdcp_rohc_static_ipv4, - &ett_pdcp_rohc_static_udp, - &ett_pdcp_rohc_static_rtp, - &ett_pdcp_rohc_dynamic_ipv4, - &ett_pdcp_rohc_dynamic_udp, - &ett_pdcp_rohc_dynamic_rtp, - &ett_pdcp_rohc_report_bitmap + &ett_pdcp_report_bitmap }; static enum_val_t sequence_analysis_vals[] = { @@ -3304,7 +1639,7 @@ void proto_register_pdcp(void) "Do sequence number analysis", &global_pdcp_check_sequence_numbers, sequence_analysis_vals, FALSE); - /* Attempt to dissect ROHC headers */ + /* Attempt to dissect ROHC messages */ prefs_register_bool_preference(pdcp_lte_module, "dissect_rohc", "Attempt to decode ROHC data", "Attempt to decode ROHC data", |