rtp: Use osmocom/netif/rtp.h for the rtp structure definition
We depend on libosmo-netif unconditionally. Let's use this definition of rtp and have one portability issue less.
This commit is contained in:
parent
8deba01eda
commit
d0e171a9ff
|
@ -14,7 +14,7 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
|
||||||
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
|
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
|
||||||
bss.h gsm_data_shared.h ipaccess.h mncc_int.h \
|
bss.h gsm_data_shared.h ipaccess.h mncc_int.h \
|
||||||
arfcn_range_encode.h nat_rewrite_trie.h bsc_nat_callstats.h \
|
arfcn_range_encode.h nat_rewrite_trie.h bsc_nat_callstats.h \
|
||||||
osmux.h mgcp_transcode.h rtp.h gprs_utils.h \
|
osmux.h mgcp_transcode.h gprs_utils.h \
|
||||||
gprs_gb_parse.h smpp.h meas_feed.h gprs_gsup_messages.h \
|
gprs_gb_parse.h smpp.h meas_feed.h gprs_gsup_messages.h \
|
||||||
gprs_gsup_client.h
|
gprs_gsup_client.h
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#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;
|
|
||||||
uint8_t data[0];
|
|
||||||
} __attribute__((packed));
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -32,9 +34,10 @@
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
#include <osmocom/core/select.h>
|
#include <osmocom/core/select.h>
|
||||||
|
|
||||||
|
#include <osmocom/netif/rtp.h>
|
||||||
|
|
||||||
#include <openbsc/mgcp.h>
|
#include <openbsc/mgcp.h>
|
||||||
#include <openbsc/mgcp_internal.h>
|
#include <openbsc/mgcp_internal.h>
|
||||||
#include <openbsc/rtp.h>
|
|
||||||
|
|
||||||
#include <openbsc/osmux.h>
|
#include <openbsc/osmux.h>
|
||||||
|
|
||||||
|
|
|
@ -36,22 +36,13 @@
|
||||||
#include <openbsc/rtp_proxy.h>
|
#include <openbsc/rtp_proxy.h>
|
||||||
#include <openbsc/mncc.h>
|
#include <openbsc/mncc.h>
|
||||||
#include <openbsc/trau_upqueue.h>
|
#include <openbsc/trau_upqueue.h>
|
||||||
#include <openbsc/rtp.h>
|
|
||||||
|
#include <osmocom/netif/rtp.h>
|
||||||
|
|
||||||
/* attempt to determine byte order */
|
/* attempt to determine byte order */
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <limits.h>
|
#include <limits.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
|
|
||||||
|
|
||||||
static LLIST_HEAD(rtp_sockets);
|
static LLIST_HEAD(rtp_sockets);
|
||||||
|
|
||||||
/* should we mangle the CNAME inside SDES of RTCP packets? We disable
|
/* should we mangle the CNAME inside SDES of RTCP packets? We disable
|
||||||
|
@ -66,21 +57,10 @@ enum rtp_bfd_priv {
|
||||||
|
|
||||||
#define RTP_ALLOC_SIZE 1500
|
#define RTP_ALLOC_SIZE 1500
|
||||||
|
|
||||||
/* according to RFC 1889 */
|
|
||||||
struct rtcp_hdr {
|
|
||||||
uint8_t byte0;
|
|
||||||
uint8_t type;
|
|
||||||
uint16_t length;
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
#define RTCP_TYPE_SDES 202
|
#define RTCP_TYPE_SDES 202
|
||||||
|
|
||||||
#define RTCP_IE_CNAME 1
|
#define RTCP_IE_CNAME 1
|
||||||
|
|
||||||
struct rtp_x_hdr {
|
|
||||||
uint16_t by_profile;
|
|
||||||
uint16_t length;
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
#define RTP_VERSION 2
|
#define RTP_VERSION 2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue