/* packet-rtcp.c
*
- * $Id: packet-rtcp.c,v 1.37 2003/05/28 22:40:19 guy Exp $
+ * $Id: packet-rtcp.c,v 1.38 2003/11/09 22:55:34 guy Exp $
*
* Routines for RTCP dissection
* RTCP = Real-time Transport Control Protocol
dissect_rtcp_nack( tvbuff_t *tvb, int offset, proto_tree *tree )
{
/* Packet type = FIR (H261) */
- proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 31 );
+ proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) );
offset++;
/* Packet type, 8 bits = APP */
proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
dissect_rtcp_fir( tvbuff_t *tvb, int offset, proto_tree *tree )
{
/* Packet type = FIR (H261) */
- proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 31 );
+ proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) );
offset++;
/* Packet type, 8 bits = APP */
proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
temp_byte = tvb_get_guint8( tvb, offset );
proto_tree_add_uint( rtcp_tree, hf_rtcp_version, tvb,
- offset, 1, RTCP_VERSION( temp_byte ) );
+ offset, 1, temp_byte);
padding_set = RTCP_PADDING( temp_byte );
proto_tree_add_boolean( rtcp_tree, hf_rtcp_padding, tvb,
- offset, 1, padding_set );
+ offset, 1, temp_byte );
elem_count = RTCP_COUNT( temp_byte );
switch ( packet_type ) {
case RTCP_SR:
case RTCP_RR:
/* Receiver report count, 5 bits */
- proto_tree_add_uint( rtcp_tree, hf_rtcp_rc, tvb, offset, 1, elem_count );
+ proto_tree_add_uint( rtcp_tree, hf_rtcp_rc, tvb, offset, 1, temp_byte );
offset++;
/* Packet type, 8 bits */
proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
break;
case RTCP_SDES:
/* Source count, 5 bits */
- proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, elem_count );
+ proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte );
offset++;
/* Packet type, 8 bits */
proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
break;
case RTCP_BYE:
/* Source count, 5 bits */
- proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, elem_count );
+ proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte );
offset++;
/* Packet type, 8 bits */
proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
FT_UINT8,
BASE_DEC,
VALS(rtcp_version_vals),
- 0x0,
+ 0xC0,
"", HFILL
}
},
"Padding",
"rtcp.padding",
FT_BOOLEAN,
- BASE_NONE,
+ 8,
NULL,
- 0x0,
+ 0x20,
"", HFILL
}
},
FT_UINT8,
BASE_DEC,
NULL,
- 0x0,
+ 0x1F,
"", HFILL
}
},
FT_UINT8,
BASE_DEC,
NULL,
- 0x0,
+ 0x1F,
"", HFILL
}
},
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
*
- * $Id: packet-rtp.c,v 1.41 2003/08/23 06:36:46 guy Exp $
+ * $Id: packet-rtp.c,v 1.42 2003/11/09 22:55:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_item *ti = NULL;
proto_tree *rtp_tree = NULL;
proto_tree *rtp_csrc_tree = NULL;
- guint8 octet;
+ guint8 octet1, octet2;
unsigned int version;
gboolean padding_set;
gboolean extension_set;
static struct _rtp_info rtp_info;
/* Get the fields in the first octet */
- octet = tvb_get_guint8( tvb, offset );
- version = RTP_VERSION( octet );
+ octet1 = tvb_get_guint8( tvb, offset );
+ version = RTP_VERSION( octet1 );
if (version != 2) {
/*
rtp_tree = proto_item_add_subtree( ti, ett_rtp );
proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
- offset, 1, version );
+ offset, 1, octet1);
}
return;
}
- padding_set = RTP_PADDING( octet );
- extension_set = RTP_EXTENSION( octet );
- csrc_count = RTP_CSRC_COUNT( octet );
+ padding_set = RTP_PADDING( octet1 );
+ extension_set = RTP_EXTENSION( octet1 );
+ csrc_count = RTP_CSRC_COUNT( octet1 );
/* Get the fields in the second octet */
- octet = tvb_get_guint8( tvb, offset + 1 );
- marker_set = RTP_MARKER( octet );
- payload_type = RTP_PAYLOAD_TYPE( octet );
+ octet2 = tvb_get_guint8( tvb, offset + 1 );
+ marker_set = RTP_MARKER( octet2 );
+ payload_type = RTP_PAYLOAD_TYPE( octet2 );
/* Get the subsequent fields */
seq_num = tvb_get_ntohs( tvb, offset + 2 );
rtp_tree = proto_item_add_subtree( ti, ett_rtp );
proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
- offset, 1, version );
+ offset, 1, octet1 );
proto_tree_add_boolean( rtp_tree, hf_rtp_padding, tvb,
- offset, 1, padding_set );
+ offset, 1, octet1 );
proto_tree_add_boolean( rtp_tree, hf_rtp_extension, tvb,
- offset, 1, extension_set );
+ offset, 1, octet1 );
proto_tree_add_uint( rtp_tree, hf_rtp_csrc_count, tvb,
- offset, 1, csrc_count );
+ offset, 1, octet1 );
offset++;
proto_tree_add_boolean( rtp_tree, hf_rtp_marker, tvb, offset,
- 1, marker_set );
+ 1, octet2 );
proto_tree_add_uint( rtp_tree, hf_rtp_payload_type, tvb,
- offset, 1, payload_type );
+ offset, 1, octet2 );
offset++;
/* Sequence number 16 bits (2 octets) */
FT_UINT8,
BASE_DEC,
VALS(rtp_version_vals),
- 0x0,
+ 0xC0,
"", HFILL
}
},
"Padding",
"rtp.padding",
FT_BOOLEAN,
- BASE_NONE,
+ 8,
NULL,
- 0x0,
+ 0x20,
"", HFILL
}
},
"Extension",
"rtp.ext",
FT_BOOLEAN,
- BASE_NONE,
+ 8,
NULL,
- 0x0,
+ 0x10,
"", HFILL
}
},
FT_UINT8,
BASE_DEC,
NULL,
- 0x0,
+ 0x0F,
"", HFILL
}
},
"Marker",
"rtp.marker",
FT_BOOLEAN,
- BASE_NONE,
+ 8,
NULL,
- 0x0,
+ 0x80,
"", HFILL
}
},
FT_UINT8,
BASE_DEC,
VALS(rtp_payload_type_vals),
- 0x0,
+ 0x7F,
"", HFILL
}
},