blob: 44b9022832cec7aea4e6e5f034697ffa64bd7d67 [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
Philipp Maier3f2c15f2021-07-22 11:53:07 +02007/* Struct that holds one endpoint name */
8struct reset_ep {
9 struct llist_head list;
10 char name[MGCP_ENDPOINT_MAXLEN];
11};
12
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020013struct mgcp_client {
14 struct mgcp_client_conf actual;
Neels Hofmeyre9920f22017-07-10 15:07:22 +020015 struct osmo_wqueue wq;
16 mgcp_trans_id_t next_trans_id;
17 struct llist_head responses_pending;
18 struct llist_head inuse_endpoints;
19};
20
21struct mgcp_inuse_endpoint {
22 struct llist_head entry;
23 uint16_t id;
24};
25
26struct mgcp_response_pending {
27 struct llist_head entry;
28
29 mgcp_trans_id_t trans_id;
30 mgcp_response_cb_t response_cb;
31 void *priv;
32};
33
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020034int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg);
Neels Hofmeyre9920f22017-07-10 15:07:22 +020035
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020036struct mgcp_response_pending * mgcp_client_pending_add(
37 struct mgcp_client *mgcp,
Neels Hofmeyre9920f22017-07-10 15:07:22 +020038 mgcp_trans_id_t trans_id,
39 mgcp_response_cb_t response_cb,
40 void *priv);