client: Connect to server before connecting to bankd
So far we skipped the client->server connection and related
configuration transfer from server to client. Now, the server
instructs the client to which bankd ip/port to connect.
Change-Id: I76c9498089515d1a6190f3e79e143b7df3a531bd
diff --git a/src/client.h b/src/client.h
index 6918560..1917cb5 100644
--- a/src/client.h
+++ b/src/client.h
@@ -10,9 +10,10 @@
/* fsm.c */
enum bankd_conn_fsm_event {
- BDC_E_TCP_UP,
- BDC_E_TCP_DOWN,
- BDC_E_CLIENT_CONN_RES,
+ BDC_E_ESTABLISH, /* instruct BDC to (re)etablish TCP connection to bankd */
+ BDC_E_TCP_UP, /* notify BDC that TCP connection is up/connected */
+ BDC_E_TCP_DOWN, /* notify BDC that TCP connection is down/disconnected */
+ BDC_E_CLIENT_CONN_RES, /* notify BDC that ClientConnectRes has been received */
};
extern struct osmo_fsm remsim_client_bankd_fsm;
@@ -31,10 +32,12 @@
/* state */
struct ipa_client_conn *conn;
struct osmo_fsm_inst *fi;
- int (*handle_rx)(struct rspro_server_conn *conn, RsproPDU_t *pdu);
+ int (*handle_rx)(struct rspro_server_conn *conn, const RsproPDU_t *pdu);
/* our own component ID */
struct app_comp_id own_comp_id;
+ /* remote component ID */
+ struct app_comp_id peer_comp_id;
/* configuration */
char *server_host;
@@ -48,11 +51,10 @@
struct bankd_client {
/* connection to the remsim-server (control) */
- struct ipa_client_conn *srv_conn;
- struct osmo_fsm_inst *srv_fi;
+ struct rspro_server_conn srv_conn;
- /* our own component ID */
- struct app_comp_id own_comp_id;
+ /* remote component ID */
+ struct app_comp_id peer_comp_id;
/* connection to the remsim-bankd */
char *bankd_host;