void proto_reg_handoff_rtp(void);
void proto_reg_handoff_pkt_ccc(void);
-static gboolean dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree );
static void dissect_rtp( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree );
static void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
}
static gboolean
-dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+dissect_rtp_heur_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean check_destport )
{
- guint8 octet1;
+ guint8 octet1;
unsigned int version;
unsigned int offset = 0;
}
/* Was it sent to an even-numbered port? */
- if ((pinfo->destport % 2) != 0) {
+ if (check_destport && ((pinfo->destport % 2) != 0)) {
return FALSE;
}
return TRUE;
}
+static gboolean
+dissect_rtp_heur_udp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ return dissect_rtp_heur_common(tvb, pinfo, tree, TRUE);
+}
+
+static gboolean
+dissect_rtp_heur_stun( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ return dissect_rtp_heur_common(tvb, pinfo, tree, FALSE);
+}
+
/*
* Process the payload of the RTP packet, hand it to the subdissector
*/
#endif
{
if (rtp_tree)
- proto_tree_add_item(rtp_tree, hf_srtp_encrypted_payload, newtvb, offset, payload_len, FALSE);
+ proto_tree_add_item(rtp_tree, hf_srtp_encrypted_payload, newtvb, offset, payload_len, ENC_NA);
found_match = TRUE; /* use this flag to prevent dissection below */
}
offset += payload_len;
if (srtp_info->mki_len) {
- proto_tree_add_item(rtp_tree, hf_srtp_mki, newtvb, offset, srtp_info->mki_len, FALSE);
+ proto_tree_add_item(rtp_tree, hf_srtp_mki, newtvb, offset, srtp_info->mki_len, ENC_NA);
offset += srtp_info->mki_len;
}
if (srtp_info->auth_tag_len) {
- proto_tree_add_item(rtp_tree, hf_srtp_auth_tag, newtvb, offset, srtp_info->auth_tag_len, FALSE);
+ proto_tree_add_item(rtp_tree, hf_srtp_auth_tag, newtvb, offset, srtp_info->auth_tag_len, ENC_NA);
offset += srtp_info->auth_tag_len;
}
}
* Just add it as data.
*/
if(found_match==FALSE)
- proto_tree_add_item( rtp_tree, hf_rtp_data, newtvb, 0, -1, FALSE );
+ proto_tree_add_item( rtp_tree, hf_rtp_data, newtvb, 0, -1, ENC_NA );
return;
}
/* if we don't found, it is static OR could be set static from the preferences */
if (!found_match && !dissector_try_uint(rtp_pt_dissector_table, payload_type, newtvb, pinfo, tree))
- proto_tree_add_item( rtp_tree, hf_rtp_data, newtvb, 0, -1, FALSE );
+ proto_tree_add_item( rtp_tree, hf_rtp_data, newtvb, 0, -1, ENC_NA );
}
/* Add a subtree for this header and add items */
ti = proto_tree_add_text(rfc2198_tree, tvb, offset, (hdr_follow)?4:1, "Header %u", cnt);
rfc2198_hdr_tree = proto_item_add_subtree(ti, ett_rtp_rfc2198_hdr);
- proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_follow, tvb, offset, 1, FALSE );
+ proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_follow, tvb, offset, 1, ENC_BIG_ENDIAN );
proto_tree_add_uint_format(rfc2198_hdr_tree, hf_rtp_payload_type, tvb,
offset, 1, octet1, "Payload type: %s (%u)",
payload_type_str ? payload_type_str : val_to_str_ext(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown"),
/* Timestamp offset and block length don't apply to last header */
if (hdr_follow) {
- proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_tm_off, tvb, offset, 2, FALSE );
- proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_bl_len, tvb, offset + 1, 2, FALSE );
+ proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_tm_off, tvb, offset, 2, ENC_BIG_ENDIAN );
+ proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_bl_len, tvb, offset + 1, 2, ENC_BIG_ENDIAN );
hdr_new->len = tvb_get_ntohs(tvb, offset + 1) & 0x03FF;
proto_item_append_text(ti, ", len=%u", hdr_new->len);
offset += 3;
"Unknown RTP version %u", version);
if ( tree ) {
- ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, -1, FALSE );
+ ti = proto_tree_add_item( tree, proto_rtp, tvb, offset, -1, ENC_NA );
rtp_tree = proto_item_add_subtree( ti, ett_rtp );
proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
if ( tree ) {
proto_tree *item;
/* Create RTP protocol tree */
- ti = proto_tree_add_item(tree, proto_rtp, tvb, offset, -1, FALSE );
+ ti = proto_tree_add_item(tree, proto_rtp, tvb, offset, -1, ENC_NA );
rtp_tree = proto_item_add_subtree(ti, ett_rtp );
/* Conversation setup info */
if ( csrc_count > 0 ) {
if ( tree ) {
ti = proto_tree_add_item(rtp_tree, hf_rtp_csrc_items, tvb, offset,
- csrc_count * 4, FALSE);
+ csrc_count * 4, ENC_NA);
proto_item_append_text(ti, " (%u items)", csrc_count);
rtp_csrc_tree = proto_item_add_subtree( ti, ett_csrc_list );
}
offset += 2;
if ( hdr_extension > 0 ) {
if ( tree ) {
- ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension * 4, FALSE);
+ ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension * 4, ENC_NA);
rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext );
}
* data.
*/
if ( tree ) proto_tree_add_item( rtp_tree, hf_rtp_padding_data,
- tvb, offset, padding_count - 1, FALSE );
+ tvb, offset, padding_count - 1, ENC_NA );
offset += padding_count - 1;
}
/*
* count.
*/
if ( tree ) proto_tree_add_item( rtp_tree, hf_rtp_padding_count,
- tvb, offset, 1, FALSE );
+ tvb, offset, 1, ENC_BIG_ENDIAN );
}
else {
/*
proto_tree *pkt_ccc_tree = NULL;
if ( tree ) {
- ti = proto_tree_add_item(tree, proto_pkt_ccc, tvb, 0, 12, FALSE);
+ ti = proto_tree_add_item(tree, proto_pkt_ccc, tvb, 0, 12, ENC_NA);
pkt_ccc_tree = proto_item_add_subtree(ti, ett_pkt_ccc);
- proto_tree_add_item(pkt_ccc_tree, hf_pkt_ccc_id, tvb, 0, 4, FALSE);
+ proto_tree_add_item(pkt_ccc_tree, hf_pkt_ccc_id, tvb, 0, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(pkt_ccc_tree, hf_pkt_ccc_ts, tvb, 4, 8,
ENC_TIME_NTP|ENC_BIG_ENDIAN);
}
dissector_add_handle("udp.port", rtp_handle); /* for 'decode-as' */
dissector_add_string("rtp_dyn_payload_type", "red", rtp_rfc2198_handle);
- heur_dissector_add( "udp", dissect_rtp_heur, proto_rtp);
- heur_dissector_add("stun", dissect_rtp_heur, proto_rtp);
+ heur_dissector_add( "udp", dissect_rtp_heur_udp, proto_rtp);
+ heur_dissector_add("stun", dissect_rtp_heur_stun, proto_rtp);
data_handle = find_dissector("data");
classicstun_handle = find_dissector("classicstun");