static char rtcp_proto[] = "RTCP";
+static gboolean dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree );
+
void rtcp_add_address( const unsigned char* ip_addr, int prt )
{
address src_addr;
* Check if the ip address and port combination is not
* already registered
*/
- pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0 );
+ pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0, 0 );
/*
* If not, add
*/
if ( ! pconv ) {
- conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt, (guint32) 0, (void*) rtcp_proto );
+ conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt,
+ (guint32) 0, (void*) rtcp_proto, 0 );
}
}
}
#endif
-gboolean
+static gboolean
dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
+ conversation_t* pconv;
+
+ if (!proto_is_protocol_enabled(proto_rtcp))
+ return FALSE; /* RTCP has been disabled */
+
/* This is a heuristic dissector, which means we get all the UDP
* traffic not sent to a known dissector and not claimed by
* a heuristic dissector called before us!
* So we first check if the frame is really meant for us.
*/
- conversation_t* pconv;
- if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype, pi.srcport, 0 ) ) == NULL ) {
+ if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype,
+ pi.srcport, 0, 0 ) ) == NULL ) {
/*
- * The source ip:port combination was not what we were looking for, check the destination
+ * The source ip:port combination was not what we were
+ * looking for, check the destination
*/
- if ( ( pconv = find_conversation( &pi.dst, &fake_addr, pi.ptype, pi.destport, 0 ) ) == NULL ) {
+ if ( ( pconv = find_conversation( &pi.dst, &fake_addr,
+ pi.ptype, pi.destport, 0, 0 ) ) == NULL ) {
return FALSE;
}
}
unsigned int offset = 0;
guint16 packet_length = 0;
+ CHECK_DISPLAY_AS_DATA(proto_rtcp, tvb, pinfo, tree);
+
pinfo->current_proto = "RTCP";
if ( check_col( pinfo->fd, COL_PROTOCOL ) ) {
- col_add_str( pinfo->fd, COL_PROTOCOL, "RTCP" );
+ col_set_str( pinfo->fd, COL_PROTOCOL, "RTCP" );
}
if ( check_col( pinfo->fd, COL_INFO) ) {
/* switch ( pd[ offset + 1 ] ) { */
switch ( tvb_get_guint8( tvb, 1 ) ) {
case RTCP_SR:
- col_add_str( pinfo->fd, COL_INFO, "Sender Report");
+ col_set_str( pinfo->fd, COL_INFO, "Sender Report");
break;
case RTCP_RR:
- col_add_str( pinfo->fd, COL_INFO, "Receiver Report");
+ col_set_str( pinfo->fd, COL_INFO, "Receiver Report");
break;
case RTCP_SDES:
- col_add_str( pinfo->fd, COL_INFO, "Source Description");
+ col_set_str( pinfo->fd, COL_INFO, "Source Description");
break;
case RTCP_BYE:
- col_add_str( pinfo->fd, COL_INFO, "Goodbye");
+ col_set_str( pinfo->fd, COL_INFO, "Goodbye");
break;
case RTCP_APP:
- col_add_str( pinfo->fd, COL_INFO, "Application defined");
+ col_set_str( pinfo->fd, COL_INFO, "Application defined");
break;
case RTCP_FIR:
- col_add_str( pinfo->fd, COL_INFO, "Full Intra-frame Request (H.261)");
+ col_set_str( pinfo->fd, COL_INFO, "Full Intra-frame Request (H.261)");
break;
case RTCP_NACK:
- col_add_str( pinfo->fd, COL_INFO, "Negative Acknowledgement (H.261)");
+ col_set_str( pinfo->fd, COL_INFO, "Negative Acknowledgement (H.261)");
break;
default:
- col_add_str( pinfo->fd, COL_INFO, "Unknown packet type");
+ col_set_str( pinfo->fd, COL_INFO, "Unknown packet type");
break;
}
}
};
- proto_rtcp = proto_register_protocol("Real-time Transport Control Protocol", "rtcp");
+ proto_rtcp = proto_register_protocol("Real-time Transport Control Protocol",
+ "RTCP", "rtcp");
proto_register_field_array(proto_rtcp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &rtcp_init );
#endif
}
+
+void
+proto_reg_handoff_rtcp(void)
+{
+ /*
+ * Register this dissector as one that can be assigned to a
+ * UDP conversation.
+ */
+ conv_dissector_add("udp", dissect_rtcp);
+}