blob: df9040401f021ce99b70277fb8f4aabbf37f2620 [file] [log] [blame]
Harald Welte24173fb2018-08-24 20:37:28 +02001#pragma once
2
3#include <osmocom/core/fsm.h>
4#include <osmocom/abis/ipa.h>
5
6#include "rspro_util.h"
Harald Weltea4e0a232018-10-14 17:44:25 +02007#include "debug.h"
Harald Welte24173fb2018-08-24 20:37:28 +02008
9/* fsm.c */
10
11enum bankd_conn_fsm_event {
12 BDC_E_TCP_UP,
13 BDC_E_TCP_DOWN,
14 BDC_E_CLIENT_CONN_RES,
15};
16
17
18enum server_conn_fsm_event {
19 SRVC_E_TCP_UP,
20 SRVC_E_TCP_DOWN,
21 SRVC_E_CLIENT_CONN_RES,
22};
23
24extern struct osmo_fsm remsim_client_bankd_fsm;
25extern struct osmo_fsm remsim_client_server_fsm;
26
27/* main.c */
28
29struct bankd_client {
30 /* connection to the remsim-server (control) */
31 struct ipa_client_conn *srv_conn;
32 struct osmo_fsm_inst *srv_fi;
33
34 /* our own component ID */
35 struct app_comp_id own_comp_id;
36
37 /* connection to the remsim-bankd */
38 char *bankd_host;
39 uint16_t bankd_port;
40 struct ipa_client_conn *bankd_conn;
41 struct osmo_fsm_inst *bankd_fi;
Kévin Redon38cd4f72018-10-10 00:36:46 +020042
43 /* client id and slot number */
44 ClientSlot_t *clslot;
Harald Welte24173fb2018-08-24 20:37:28 +020045};
46
Harald Weltef29e0d02018-08-24 21:42:22 +020047void ipa_client_conn_send_rspro(struct ipa_client_conn *ipa, RsproPDU_t *rspro);
Harald Welte24173fb2018-08-24 20:37:28 +020048int bankd_read_cb(struct ipa_client_conn *conn, struct msgb *msg);
49int bankd_conn_fsm_alloc(struct bankd_client *bc);