blob: f3ea72a856c942ef509515ab0b773c1f65dca32c [file] [log] [blame]
Neels Hofmeyrf83ec562017-09-07 19:18:40 +02001#ifndef _OPENBSC_OSMUX_H_
2#define _OPENBSC_OSMUX_H_
3
4#include <osmocom/netif/osmux.h>
5
6#define OSMUX_PORT 1984
7
8enum {
9 OSMUX_ROLE_BSC = 0,
10 OSMUX_ROLE_BSC_NAT,
11};
12
13int osmux_init(int role, struct mgcp_config *cfg);
14int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port);
15void osmux_disable_endpoint(struct mgcp_endpoint *endp);
16void osmux_allocate_cid(struct mgcp_endpoint *endp);
17void osmux_release_cid(struct mgcp_endpoint *endp);
18
19int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc);
20int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp);
21
22int osmux_send_dummy(struct mgcp_endpoint *endp);
23
24int osmux_get_cid(void);
25void osmux_put_cid(uint8_t osmux_cid);
26int osmux_used_cid(void);
27
28enum osmux_state {
29 OSMUX_STATE_DISABLED = 0,
30 OSMUX_STATE_NEGOTIATING,
31 OSMUX_STATE_ACTIVATING,
32 OSMUX_STATE_ENABLED,
33};
34
35enum osmux_usage {
36 OSMUX_USAGE_OFF = 0,
37 OSMUX_USAGE_ON = 1,
38 OSMUX_USAGE_ONLY = 2,
39};
40
41#endif