Connected: An Internet Encyclopedia
A.2 RTCP Header Validity Checks

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 1889
Up: A. Algorithms
Prev: A.1 RTP Data Header Validity Checks
Next: A.3 Determining the Number of RTP Packets Expected and Lost

A.2 RTCP Header Validity Checks

A.2 RTCP Header Validity Checks

The following checks can be applied to RTCP packets.

The code fragment below performs all of these checks. The packet type is not checked for subsequent packets since unknown packet types may be present and should be ignored.

       u_int32 len;        /* length of compound RTCP packet in words */
       rtcp_t *r;          /* RTCP header */
       rtcp_t *end;        /* end of compound RTCP packet */

       if ((*(u_int16 *)r & RTCP_VALID_MASK) != RTCP_VALID_VALUE) {
           /* something wrong with packet format */
       }
       end = (rtcp_t *)((u_int32 *)r + len);

       do r = (rtcp_t *)((u_int32 *)r + r->common.length + 1);
       while (r < end && r->common.version == 2);

       if (r != end) {
           /* something wrong with packet format */
       }


Next: A.3 Determining the Number of RTP Packets Expected and Lost

Connected: An Internet Encyclopedia
A.2 RTCP Header Validity Checks