#ifndef RTP_H #define RTP_H #include /* Payload is 31 for H261 */ typedef struct { u_short version:2; /* protocol version */ u_short p:1; /* padding flag */ u_short x:1; /* header extension flag */ u_short cc:4; /* CSRC count */ u_short m:1; /* marker bit */ u_short pt:7; /* payload type */ u_short seq; /* sequence number */ u_int ts; /* timestamp */ u_int ssrc; /* synchronization source */ } rtp_hdr_t; typedef struct { u_int sbit:3; u_int ebit:3; u_int i:1; u_int v:1; u_int gobn:4; u_int mbap:5; u_int quant:5; u_int hmvd:5; u_int vmvd:5; } h261_hdr_t; struct pkt_hdr { rtp_hdr_t rtphdr; h261_hdr_t h261hdr; }; const int H261HDR_OFFSET = sizeof(rtp_hdr_t); void put_rtphdr(u_char *buf, rtp_hdr_t *hdr); void put_h261hdr(u_char *buf, h261_hdr_t *hdr); void get_rtphdr(u_char *buf, rtp_hdr_t *hdr); void get_h261hdr(u_char *buf, h261_hdr_t *hdr); void create_hdr(rtp_hdr_t *hdr, u_int marker, u_int payload); void get_hdr(rtp_hdr_t *hdr, u_int& marker, u_int& payload); void set_sbit(h261_hdr_t *hdr, int val); void set_ebit(h261_hdr_t *hdr, int val); int get_sbit(h261_hdr_t *hdr); int get_ebit(h261_hdr_t *hdr); #endif