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