Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Neels Hofmeyr | d95ab1e | 2017-09-22 00:52:54 +0200 | [diff] [blame] | 3 | #include <osmocom/core/write_queue.h> |
| 4 | |
Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 5 | #define MSGB_CB_MGCP_TRANS_ID 0 |
| 6 | |
Neels Hofmeyr | 3a8e723 | 2017-09-04 01:02:56 +0200 | [diff] [blame] | 7 | struct mgcp_client { |
| 8 | struct mgcp_client_conf actual; |
Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 9 | struct osmo_wqueue wq; |
| 10 | mgcp_trans_id_t next_trans_id; |
| 11 | struct llist_head responses_pending; |
| 12 | struct llist_head inuse_endpoints; |
| 13 | }; |
| 14 | |
| 15 | struct mgcp_inuse_endpoint { |
| 16 | struct llist_head entry; |
| 17 | uint16_t id; |
| 18 | }; |
| 19 | |
| 20 | struct mgcp_response_pending { |
| 21 | struct llist_head entry; |
| 22 | |
| 23 | mgcp_trans_id_t trans_id; |
| 24 | mgcp_response_cb_t response_cb; |
| 25 | void *priv; |
| 26 | }; |
| 27 | |
Neels Hofmeyr | 3a8e723 | 2017-09-04 01:02:56 +0200 | [diff] [blame] | 28 | int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg); |
Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 29 | |
Neels Hofmeyr | 3a8e723 | 2017-09-04 01:02:56 +0200 | [diff] [blame] | 30 | struct mgcp_response_pending * mgcp_client_pending_add( |
| 31 | struct mgcp_client *mgcp, |
Neels Hofmeyr | e9920f2 | 2017-07-10 15:07:22 +0200 | [diff] [blame] | 32 | mgcp_trans_id_t trans_id, |
| 33 | mgcp_response_cb_t response_cb, |
| 34 | void *priv); |