mgcp-client: Rearrange internal backpointers
Let's properly store backpointers so that it is easy to access all
relation chain (pool<->pool_member<->mgcp_client).
Related: SYS#5987
Change-Id: I5ec2465075da2e3c8eabca9df60681620a7db499
diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h
index 73e3de2..2eb9b4c 100644
--- a/include/osmocom/mgcp_client/mgcp_client_internal.h
+++ b/include/osmocom/mgcp_client/mgcp_client_internal.h
@@ -16,7 +16,7 @@
mgcp_trans_id_t next_trans_id;
struct llist_head responses_pending;
struct llist_head inuse_endpoints;
- struct mgcp_client_pool *pool;
+ struct mgcp_client_pool_member *pool_member;
};
struct mgcp_inuse_endpoint {
diff --git a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h
index 91e5a45..d71deaf 100644
--- a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h
+++ b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h
@@ -26,6 +26,9 @@
/* Entry in llist mgcp_client_pool->pool. */
struct llist_head list;
+ /* The pool managing this object: */
+ struct mgcp_client_pool *pool;
+
/* Reference number assinged by VTY. This number is used to manage the pool from the VTY and to identify it in
* the log. */
unsigned int nr;
@@ -48,5 +51,5 @@
struct mgcp_client_pool_member *mgcp_client_pool_member_alloc(struct mgcp_client_pool *pool, unsigned int nr);
void mgcp_client_pool_member_free(struct mgcp_client_pool_member *pool_member);
-int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member, struct mgcp_client_pool *pool);
+int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member);
const char *mgcp_client_pool_member_name(const struct mgcp_client_pool_member *pool_member);