blob: ea849c8e770b6ac9b6c9170962e08545df59abdb [file] [log] [blame]
Philipp Maier87bd9be2017-08-22 16:35:41 +02001#pragma once
2
Neels Hofmeyrf83ec562017-09-07 19:18:40 +02003
4#include <osmocom/netif/osmux.h>
Philipp Maier87bd9be2017-08-22 16:35:41 +02005struct mgcp_conn_rtp;
Neels Hofmeyrf83ec562017-09-07 19:18:40 +02006
7#define OSMUX_PORT 1984
8
9enum {
10 OSMUX_ROLE_BSC = 0,
11 OSMUX_ROLE_BSC_NAT,
12};
13
14int osmux_init(int role, struct mgcp_config *cfg);
Philipp Maier87bd9be2017-08-22 16:35:41 +020015int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
16 struct in_addr *addr, uint16_t port);
17void osmux_disable_conn(struct mgcp_conn_rtp *conn);
18void osmux_allocate_cid(struct mgcp_conn_rtp *conn);
19void osmux_release_cid(struct mgcp_conn_rtp *conn);
20int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn);
21int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn);
Neels Hofmeyrf83ec562017-09-07 19:18:40 +020022int osmux_get_cid(void);
23void osmux_put_cid(uint8_t osmux_cid);
24int osmux_used_cid(void);
25
26enum osmux_state {
27 OSMUX_STATE_DISABLED = 0,
28 OSMUX_STATE_NEGOTIATING,
29 OSMUX_STATE_ACTIVATING,
30 OSMUX_STATE_ENABLED,
31};
32
33enum osmux_usage {
34 OSMUX_USAGE_OFF = 0,
35 OSMUX_USAGE_ON = 1,
36 OSMUX_USAGE_ONLY = 2,
37};
38