Harald Welte | 24173fb | 2018-08-24 20:37:28 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/fsm.h> |
| 4 | #include <osmocom/abis/ipa.h> |
| 5 | |
| 6 | #include "rspro_util.h" |
| 7 | |
| 8 | enum { |
| 9 | DMAIN, |
| 10 | }; |
| 11 | |
| 12 | /* fsm.c */ |
| 13 | |
| 14 | enum bankd_conn_fsm_event { |
| 15 | BDC_E_TCP_UP, |
| 16 | BDC_E_TCP_DOWN, |
| 17 | BDC_E_CLIENT_CONN_RES, |
| 18 | }; |
| 19 | |
| 20 | |
| 21 | enum server_conn_fsm_event { |
| 22 | SRVC_E_TCP_UP, |
| 23 | SRVC_E_TCP_DOWN, |
| 24 | SRVC_E_CLIENT_CONN_RES, |
| 25 | }; |
| 26 | |
| 27 | extern struct osmo_fsm remsim_client_bankd_fsm; |
| 28 | extern struct osmo_fsm remsim_client_server_fsm; |
| 29 | |
| 30 | /* main.c */ |
| 31 | |
| 32 | struct 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 Redon | c3a9a0e | 2018-10-10 00:36:46 +0200 | [diff] [blame] | 45 | |
| 46 | /* client id and slot number */ |
| 47 | ClientSlot_t *clslot; |
Harald Welte | 24173fb | 2018-08-24 20:37:28 +0200 | [diff] [blame] | 48 | }; |
| 49 | |
Harald Welte | f29e0d0 | 2018-08-24 21:42:22 +0200 | [diff] [blame] | 50 | void ipa_client_conn_send_rspro(struct ipa_client_conn *ipa, RsproPDU_t *rspro); |
Harald Welte | 24173fb | 2018-08-24 20:37:28 +0200 | [diff] [blame] | 51 | int bankd_read_cb(struct ipa_client_conn *conn, struct msgb *msg); |
| 52 | int bankd_conn_fsm_alloc(struct bankd_client *bc); |