Pablo Neira Ayuso | cab6e75 | 2014-02-05 18:56:17 +0100 | [diff] [blame] | 1 | #ifndef _OPENBSC_OSMUX_H_ |
| 2 | #define _OPENBSC_OSMUX_H_ |
| 3 | |
| 4 | #include <osmocom/netif/osmux.h> |
| 5 | |
Pablo Neira Ayuso | 308d5f8 | 2014-08-29 12:20:17 +0200 | [diff] [blame] | 6 | #define OSMUX_PORT 1984 |
| 7 | |
Pablo Neira Ayuso | cab6e75 | 2014-02-05 18:56:17 +0100 | [diff] [blame] | 8 | enum { |
| 9 | OSMUX_ROLE_BSC = 0, |
| 10 | OSMUX_ROLE_BSC_NAT, |
| 11 | }; |
| 12 | |
| 13 | int osmux_init(int role, struct mgcp_config *cfg); |
Pau Espin Pedrol | a34a419 | 2017-08-11 16:48:51 +0200 | [diff] [blame] | 14 | int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); |
Pablo Neira Ayuso | b769f3c | 2014-08-27 17:02:52 +0200 | [diff] [blame] | 15 | void osmux_disable_endpoint(struct mgcp_endpoint *endp); |
Holger Hans Peter Freyther | 1afe7c7 | 2015-10-04 11:11:11 +0200 | [diff] [blame] | 16 | void osmux_allocate_cid(struct mgcp_endpoint *endp); |
| 17 | void osmux_release_cid(struct mgcp_endpoint *endp); |
Pablo Neira Ayuso | cab6e75 | 2014-02-05 18:56:17 +0100 | [diff] [blame] | 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 | |
Pablo Neira Ayuso | b769f3c | 2014-08-27 17:02:52 +0200 | [diff] [blame] | 24 | int osmux_get_cid(void); |
| 25 | void osmux_put_cid(uint8_t osmux_cid); |
Holger Hans Peter Freyther | 641d387 | 2015-10-02 15:56:35 +0200 | [diff] [blame] | 26 | int osmux_used_cid(void); |
Pablo Neira Ayuso | b769f3c | 2014-08-27 17:02:52 +0200 | [diff] [blame] | 27 | |
| 28 | enum osmux_state { |
| 29 | OSMUX_STATE_DISABLED = 0, |
Daniel Willmann | 5754206 | 2016-06-29 16:24:42 +0200 | [diff] [blame] | 30 | OSMUX_STATE_NEGOTIATING, |
Pablo Neira Ayuso | b769f3c | 2014-08-27 17:02:52 +0200 | [diff] [blame] | 31 | OSMUX_STATE_ACTIVATING, |
| 32 | OSMUX_STATE_ENABLED, |
| 33 | }; |
| 34 | |
Holger Hans Peter Freyther | 6598ded | 2015-10-02 17:38:27 +0200 | [diff] [blame] | 35 | enum osmux_usage { |
| 36 | OSMUX_USAGE_OFF = 0, |
| 37 | OSMUX_USAGE_ON = 1, |
| 38 | OSMUX_USAGE_ONLY = 2, |
| 39 | }; |
| 40 | |
Pablo Neira Ayuso | cab6e75 | 2014-02-05 18:56:17 +0100 | [diff] [blame] | 41 | #endif |