aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/netif/rtp.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-01-24 14:32:37 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-02-23 13:44:26 +0100
commit72cd95b3527ee45639f0445817781afc3e732f45 (patch)
treeae72c9aa167320b8c12cfbc9ab3700d2037f6d1d /include/osmocom/netif/rtp.h
parent2b5d3ce7c69e1149bb2af815ab8b8534026063ca (diff)
add RTP support
This patch adds the initial RTP support for libosmo-netif, it's based on Harald's RTP support available in openBSC. I have also added a couple of example to show how our new channel infrastructure interacts with the RTP layer. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
Diffstat (limited to 'include/osmocom/netif/rtp.h')
-rw-r--r--include/osmocom/netif/rtp.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/osmocom/netif/rtp.h b/include/osmocom/netif/rtp.h
new file mode 100644
index 0000000..7a8cc6b
--- /dev/null
+++ b/include/osmocom/netif/rtp.h
@@ -0,0 +1,27 @@
+#ifndef _OSMO_RTP_H_
+#define _OSMO_RTP_H_
+
+/* XXX: RFC specifies that MTU should used, add generic function to obtain
+ existing MTU. */
+#define RTP_MSGB_SIZE 1500
+
+struct osmo_rtp_handle *osmo_rtp_handle_create(void *ctx);
+void osmo_rtp_handle_free(struct osmo_rtp_handle *h);
+
+int osmo_rtp_handle_tx_set_sequence(struct osmo_rtp_handle *h, uint16_t seq);
+int osmo_rtp_handle_tx_set_ssrc(struct osmo_rtp_handle *h, uint32_t ssrc);
+int osmo_rtp_handle_tx_set_timestamp(struct osmo_rtp_handle *h, uint32_t timestamp);
+
+int osmo_rtp_parse(struct osmo_rtp_handle *h, struct msgb *msg);
+struct msgb *osmo_rtp_build(struct osmo_rtp_handle *h, uint8_t payload_type, uint32_t payload_len, const void *data, uint32_t duration);
+
+/* supported RTP payload types. */
+#define RTP_PT_GSM_FULL 3
+#define RTP_PT_GSM_FULL_PAYLOAD_LEN 33
+#define RTP_PT_GSM_FULL_DURATION 160 /* in samples. */
+
+#define RTP_PT_GSM_EFR 97
+#define RTP_PT_GSM_EFR_PAYLOAD_LEN 31
+#define RTP_PT_GSM_EFR_DURATION 160 /* in samples. */
+
+#endif