blob: b772a20adc9b29382977ab60e7d4cf5e066ee007 [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"
7
8enum {
9 DMAIN,
10};
11
12/* fsm.c */
13
14enum bankd_conn_fsm_event {
15 BDC_E_TCP_UP,
16 BDC_E_TCP_DOWN,
17 BDC_E_CLIENT_CONN_RES,
18};
19
20
21enum server_conn_fsm_event {
22 SRVC_E_TCP_UP,
23 SRVC_E_TCP_DOWN,
24 SRVC_E_CLIENT_CONN_RES,
25};
26
27extern struct osmo_fsm remsim_client_bankd_fsm;
28extern struct osmo_fsm remsim_client_server_fsm;
29
30/* main.c */
31
32struct bankd_client {
33 /* connection to the remsim-server (control) */
34 struct ipa_client_conn *srv_conn;
35 struct osmo_fsm_inst *srv_fi;
36
37 /* our own component ID */
38 struct app_comp_id own_comp_id;
39
40 /* connection to the remsim-bankd */
41 char *bankd_host;
42 uint16_t bankd_port;
43 struct ipa_client_conn *bankd_conn;
44 struct osmo_fsm_inst *bankd_fi;
Kévin Redonc3a9a0e2018-10-10 00:36:46 +020045
46 /* client id and slot number */
47 ClientSlot_t *clslot;
Harald Welte24173fb2018-08-24 20:37:28 +020048};
49
Harald Weltef29e0d02018-08-24 21:42:22 +020050void ipa_client_conn_send_rspro(struct ipa_client_conn *ipa, RsproPDU_t *rspro);
Harald Welte24173fb2018-08-24 20:37:28 +020051int bankd_read_cb(struct ipa_client_conn *conn, struct msgb *msg);
52int bankd_conn_fsm_alloc(struct bankd_client *bc);