blob: 690a4af0869392eb86f149dcade3b19edfdc4d77 [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 uint32_t remote_addr;
10 struct osmo_wqueue wq;
11 mgcp_trans_id_t next_trans_id;
12 struct llist_head responses_pending;
13 struct llist_head inuse_endpoints;
14};
15
16struct mgcp_inuse_endpoint {
17 struct llist_head entry;
18 uint16_t id;
19};
20
21struct mgcp_response_pending {
22 struct llist_head entry;
23
24 mgcp_trans_id_t trans_id;
25 mgcp_response_cb_t response_cb;
26 void *priv;
27};
28
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020029int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg);
Neels Hofmeyre9920f22017-07-10 15:07:22 +020030
Neels Hofmeyr3a8e7232017-09-04 01:02:56 +020031struct mgcp_response_pending * mgcp_client_pending_add(
32 struct mgcp_client *mgcp,
Neels Hofmeyre9920f22017-07-10 15:07:22 +020033 mgcp_trans_id_t trans_id,
34 mgcp_response_cb_t response_cb,
35 void *priv);