blob: 1b149e256d7eb5fcbcacc31e2bf534894d378ef0 [file] [log] [blame]
Neels Hofmeyre9920f22017-07-10 15:07:22 +02001#pragma once
2
3#define MSGB_CB_MGCP_TRANS_ID 0
4
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +02005struct mgcp_client {
6 struct mgcp_client_conf actual;
Neels Hofmeyre9920f22017-07-10 15:07:22 +02007 uint32_t remote_addr;
8 struct osmo_wqueue wq;
9 mgcp_trans_id_t next_trans_id;
10 struct llist_head responses_pending;
11 struct llist_head inuse_endpoints;
12};
13
14struct mgcp_inuse_endpoint {
15 struct llist_head entry;
16 uint16_t id;
17};
18
19struct mgcp_response_pending {
20 struct llist_head entry;
21
22 mgcp_trans_id_t trans_id;
23 mgcp_response_cb_t response_cb;
24 void *priv;
25};
26
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020027int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg);
Neels Hofmeyre9920f22017-07-10 15:07:22 +020028
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020029struct mgcp_response_pending * mgcp_client_pending_add(
30 struct mgcp_client *mgcp,
Neels Hofmeyre9920f22017-07-10 15:07:22 +020031 mgcp_trans_id_t trans_id,
32 mgcp_response_cb_t response_cb,
33 void *priv);