blob: 7cc7ec134a96df2f382d590c7dad0477a88dd23b [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>
Harald Weltef9995a32018-10-14 20:40:05 +02005#include <osmocom/rspro/RsproPDU.h>
Harald Welte24173fb2018-08-24 20:37:28 +02006
7#include "rspro_util.h"
Harald Welte3cded632019-03-09 12:59:41 +01008#include "rspro_client_fsm.h"
Harald Welte9cf013a2019-03-11 22:19:19 +01009#include "slotmap.h"
Harald Weltea4e0a232018-10-14 17:44:25 +020010#include "debug.h"
Harald Welte24173fb2018-08-24 20:37:28 +020011
Harald Welte24173fb2018-08-24 20:37:28 +020012/* main.c */
13
Harald Welte5ed46932019-12-17 00:02:36 +010014struct cardem_inst;
15
Harald Welte6a0248b2019-12-17 01:11:24 +010016#define ATR_SIZE_MAX 55
17struct client_config {
18 char *server_host;
19 int server_port;
20
21 int client_id;
22 int client_slot;
23
24 char *gsmtap_host;
25 bool keep_running;
26
27 char *event_script;
28
29 struct {
30 uint8_t data[ATR_SIZE_MAX];
31 uint8_t len;
32 } atr;
33
34 struct {
35 int vendor_id;
36 int product_id;
37 int config_id;
38 int if_num;
39 int altsetting;
40 int addr;
41 char *path;
42 } usb;
43};
44
Harald Welte24173fb2018-08-24 20:37:28 +020045struct bankd_client {
46 /* connection to the remsim-server (control) */
Harald Weltee56f2b92019-03-02 17:02:13 +010047 struct rspro_server_conn srv_conn;
Harald Welte3e9860b2019-12-02 23:04:54 +010048 /* connection to the remsim-bankd (data) */
49 struct rspro_server_conn bankd_conn;
Harald Welte24173fb2018-08-24 20:37:28 +020050
Harald Weltee56f2b92019-03-02 17:02:13 +010051 /* remote component ID */
52 struct app_comp_id peer_comp_id;
Harald Welte24173fb2018-08-24 20:37:28 +020053
Harald Welte9cf013a2019-03-11 22:19:19 +010054 struct bank_slot bankd_slot;
Harald Welte5ed46932019-12-17 00:02:36 +010055
Harald Welte6a0248b2019-12-17 01:11:24 +010056 struct client_config *cfg;
Harald Welte5ed46932019-12-17 00:02:36 +010057 struct cardem_inst *cardem;
Harald Welte24173fb2018-08-24 20:37:28 +020058};