blob: b4b3b02fe9e88ec2f3fac5c39b611ac311b6dfc5 [file] [log] [blame]
Neels Hofmeyre9920f22017-07-10 15:07:22 +02001#pragma once
2
Neels Hofmeyrd95ab1e2017-09-22 00:52:54 +02003#include <osmocom/core/write_queue.h>
4
Neels Hofmeyre9920f22017-07-10 15:07:22 +02005#define MSGB_CB_MGCP_TRANS_ID 0
6
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +02007struct mgcp_client {
8 struct mgcp_client_conf actual;
Neels Hofmeyre9920f22017-07-10 15:07:22 +02009 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
15struct mgcp_inuse_endpoint {
16 struct llist_head entry;
17 uint16_t id;
18};
19
20struct 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 Hofmeyr3a8e7232017-09-04 01:02:56 +020028int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg);
Neels Hofmeyre9920f22017-07-10 15:07:22 +020029
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020030struct mgcp_response_pending * mgcp_client_pending_add(
31 struct mgcp_client *mgcp,
Neels Hofmeyre9920f22017-07-10 15:07:22 +020032 mgcp_trans_id_t trans_id,
33 mgcp_response_cb_t response_cb,
34 void *priv);