client: Work without global g_client variable
We may want to develop programs that include multiple instances of
a remsim_client. Let's remove the global variable 'g_client' and
instead de-reference the bankd_client using container_of() macros
Change-Id: I456fb633561b88912be2f78c3e0264794d921255
diff --git a/src/client/client.h b/src/client/client.h
index b3001ee..0239b55 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -1,5 +1,6 @@
#pragma once
+#include <osmocom/core/linuxlist.h>
#include <osmocom/core/fsm.h>
#include <osmocom/abis/ipa.h>
#include <osmocom/rspro/RsproPDU.h>
@@ -57,8 +58,9 @@
struct cardem_inst *cardem;
};
+#define srvc2bankd_client(srvc) container_of(srvc, struct bankd_client, srv_conn)
+#define bankdc2bankd_client(bdc) container_of(bdc, struct bankd_client, bankd_conn)
-extern struct bankd_client *g_client;
extern int client_user_bankd_handle_rx(struct rspro_server_conn *bankdc, const RsproPDU_t *pdu);