So heres my code:
Code:
char buf[256];
struct rtp_hdr_t *header = (struct rtp_hdr_t *) buf;
memset(buf,0,256);
header->version = 2;
header->p = 0;
header->x = 0;
header->cc = 0;
header->m = 0;
header->pt = 0;
header->seq = htons(0);
header->ts = htons(0);
Im getting the error in all the assignment lines.
Heres rtp_hdr_t:
Code:
typedef struct {
#if RTP_BIG_ENDIAN
unsigned int version:2; /* protocol version */
unsigned int p:1; /* padding flag */
unsigned int x:1; /* header extension flag */
unsigned int cc:4; /* CSRC count */
unsigned int m:1; /* marker bit */
unsigned int pt:7; /* payload type */
#elif RTP_LITTLE_ENDIAN
unsigned int cc:4; /* CSRC count */
unsigned int x:1; /* header extension flag */
unsigned int p:1; /* padding flag */
unsigned int version:2; /* protocol version */
unsigned int pt:7; /* payload type */
unsigned int m:1; /* marker bit */
#else
#error Define one of RTP_LITTLE_ENDIAN or RTP_BIG_ENDIAN
#endif
unsigned int seq:16; /* sequence number */
u_int32 ts; /* timestamp */
u_int32 ssrc; /* synchronization source */
u_int32 csrc[1]; /* optional CSRC list */
} rtp_hdr_t;
Im honestly not very good working with pointers and i cant see where the problem is here. Pls help... Thanks!