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