aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/rtp.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/rtp.h')
-rw-r--r--openbsc/include/openbsc/rtp.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/rtp.h b/openbsc/include/openbsc/rtp.h
new file mode 100644
index 000000000..451d0defa
--- /dev/null
+++ b/openbsc/include/openbsc/rtp.h
@@ -0,0 +1,38 @@
+#pragma once
+
+/* attempt to determine byte order */
+#include <sys/param.h>
+#include <limits.h>
+#include <time.h>
+
+#ifndef __BYTE_ORDER
+# ifdef __APPLE__
+# define __BYTE_ORDER __DARWIN_BYTE_ORDER
+# define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
+# define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
+# else
+# error "__BYTE_ORDER should be defined by someone"
+# endif
+#endif
+
+/* according to rtp_proxy.c RFC 3550 */
+struct rtp_hdr {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ uint8_t csrc_count:4,
+ extension:1,
+ padding:1,
+ version:2;
+ uint8_t payload_type:7,
+ marker:1;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ uint8_t version:2,
+ padding:1,
+ extension:1,
+ csrc_count:4;
+ uint8_t marker:1,
+ payload_type:7;
+#endif
+ uint16_t sequence;
+ uint32_t timestamp;
+ uint32_t ssrc;
+} __attribute__((packed));