#include <epan/rtp_pt.h>
#include <epan/expert.h>
+#include "packet-rohc.h"
/* Initialize the protocol and registered fields */
static int proto_rohc = -1;
static guint8 g_profile = 1;
static guint8 g_version = 4;
-enum rohc_mode
-{
- UNIDIRECTIONAL = 1,
- OPTIMISTIC_BIDIRECTIONAL = 2,
- RELIABLE_BIDIRECTIONAL = 3
-};
-
-typedef struct rohc_info
-{
-
- /* RoHC settings */
- gboolean rohc_compression;
- unsigned short rohc_ip_version;
- gboolean cid_inclusion_info;
- gboolean large_cid_present;
- enum rohc_mode mode;
- gboolean rnd;
- gboolean udp_checkum_present;
- unsigned short profile;
- proto_item *last_created_item;
-} rohc_info;
-
/* ROHC Profiles */
#define ROHC_PROFILE_RTP 1
#define ROHC_PROFILE_UDP 2
break;
}
}
-static void
+int
dissect_rohc_ir_rtp_profile_dynamic(tvbuff_t *tvb, proto_tree *tree, int offset, rohc_info *p_rohc_info){
proto_item *item;
break;
case 6:
proto_tree_add_text(sub_tree, tvb, offset, -1, "Not dissected yet");
- return;
+ return offset;
break;
default:
break;
proto_tree_add_item(sub_tree, hf_rohc_rtp_checksum, tvb, offset, 2, ENC_BIG_ENDIAN);
offset+=2;
if (p_rohc_info->profile == 2) {
- proto_tree_add_item(sub_tree, hf_rohc_dynamic_udp_seqnum, tvb, offset, 2, FALSE);
+ proto_tree_add_item(sub_tree, hf_rohc_dynamic_udp_seqnum, tvb, offset, 2, ENC_BIG_ENDIAN);
offset +=2;
proto_item_set_len(item, offset - start_offset);
proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
- return;
+ return offset;
}
/* 5.7.7.6. Initialization of RTP Header
/* : Reserved | X | Mode |TIS|TSS: if RX = 1 */
if(rx==0){
proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
- return;
+ return offset;
}
proto_tree_add_item(sub_tree, hf_rohc_rtp_x, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rohc_rtp_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
}
proto_item_set_len(item, offset - start_offset);
- proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
+
+ return offset;
}
static void
offset+=2;
if(p_rohc_info->profile == ROHC_PROFILE_UDP){
if(d==TRUE){
- dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
+ offset = dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
}
proto_item_set_len(item, offset - start_offset);
proto_tree_add_text(tree, tvb, offset, -1, "UDP data");
/* D: D = 1 indicates that the dynamic chain is present. */
if(d==TRUE){
- dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
- }else{
- proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
+ offset = dissect_rohc_ir_rtp_profile_dynamic(tvb, tree, offset, p_rohc_info);
}
+ proto_tree_add_text(tree, tvb, offset, -1, "RTP data");
}
}
col_append_str(pinfo->cinfo, COL_INFO, " ");
}
/*if (tree) {*/
- ti = proto_tree_add_item(tree, proto_rohc, tvb, 0, -1, ENC_BIG_ENDIAN);
+ ti = proto_tree_add_item(tree, proto_rohc, tvb, 0, -1, ENC_NA);
rohc_tree = proto_item_add_subtree(ti, ett_rohc);
/* 1) If the first octet is a Padding Octet (11100000),
* strip away all initial Padding Octets and goto next step.