aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/Makefile.am3
-rw-r--r--openbsc/include/openbsc/bsc_nat.h5
-rw-r--r--openbsc/include/openbsc/mgcp.h13
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h15
-rw-r--r--openbsc/include/openbsc/osmux.h19
5 files changed, 53 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 8f7c1c423..d902315b5 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -13,7 +13,8 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
bss.h gsm_data_shared.h control_cmd.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
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
openbscdir = $(includedir)/openbsc
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 7bd582cf6..7a161ff27 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -176,6 +176,9 @@ struct bsc_config {
struct bsc_config_stats stats;
struct llist_head lac_list;
+
+ /* Osmux is enabled/disabled per BSC */
+ int osmux;
};
struct bsc_lac_entry {
@@ -418,7 +421,7 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat);
struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *, int endpoint_number);
struct msgb *bsc_mgcp_rewrite(char *input, int length, int endp, const char *ip,
- int port, int *payload_type);
+ int port, int osmux, int *payload_type);
void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg);
void bsc_mgcp_clear_endpoints_for(struct bsc_connection *bsc);
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 1d7407820..939e7eed1 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -181,6 +181,15 @@ struct mgcp_config {
int last_bts_port;
enum mgcp_role role;
+
+ /* osmux translator: 0 means disabled, 1 means enabled */
+ int osmux;
+ /* The BSC-NAT may ask for enabling osmux on demand. This tells us if
+ * the osmux socket is already initialized.
+ */
+ int osmux_init;
+ /* osmux batch factor: from 1 to 4 maximum */
+ int osmux_batch;
};
/* config management */
@@ -222,4 +231,8 @@ int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint);
int mgcp_send_reset_all(struct mgcp_config *cfg);
+int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port);
+int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp, struct sockaddr_in *addr, char *buf, int rc);
+int mgcp_udp_send(int fd, struct in_addr *addr, int port, char *buf, int len);
+
#endif
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index 9b9716539..8fe9f8182 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -126,8 +126,12 @@ struct mgcp_lco {
enum mgcp_type {
MGCP_RTP_DEFAULT = 0,
MGCP_RTP_TRANSCODED,
+ MGCP_OSMUX_BSC,
+ MGCP_OSMUX_BSC_NAT,
};
+#include <openbsc/osmux.h>
+
struct mgcp_endpoint {
int allocated;
uint32_t ci;
@@ -163,6 +167,11 @@ struct mgcp_endpoint {
/* tap for the endpoint */
struct mgcp_rtp_tap taps[MGCP_TAP_COUNT];
+
+ /* osmux is enabled/disabled */
+ int osmux;
+ /* osmux internal to unbatch messages for this endpoint */
+ struct osmux_out_handle osmux_out;
};
#define ENDPOINT_NUMBER(endp) abs(endp - endp->tcfg->endpoints)
@@ -197,5 +206,11 @@ void mgcp_state_calc_loss(struct mgcp_rtp_state *s, struct mgcp_rtp_end *,
uint32_t *expected, int *loss);
uint32_t mgcp_state_calc_jitter(struct mgcp_rtp_state *);
+enum {
+ MGCP_DEST_NET = 0,
+ MGCP_DEST_BTS,
+};
+
+#define MGCP_DUMMY_LOAD 0x23
#endif
diff --git a/openbsc/include/openbsc/osmux.h b/openbsc/include/openbsc/osmux.h
new file mode 100644
index 000000000..33456b76d
--- /dev/null
+++ b/openbsc/include/openbsc/osmux.h
@@ -0,0 +1,19 @@
+#ifndef _OPENBSC_OSMUX_H_
+#define _OPENBSC_OSMUX_H_
+
+#include <osmocom/netif/osmux.h>
+
+enum {
+ OSMUX_ROLE_BSC = 0,
+ OSMUX_ROLE_BSC_NAT,
+};
+
+int osmux_init(int role, struct mgcp_config *cfg);
+int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role);
+
+int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc);
+int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp);
+
+int osmux_send_dummy(struct mgcp_endpoint *endp);
+
+#endif