2018-08-24 18:37:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <osmocom/core/fsm.h>
|
|
|
|
#include <osmocom/abis/ipa.h>
|
2018-10-14 18:40:05 +00:00
|
|
|
#include <osmocom/rspro/RsproPDU.h>
|
2018-08-24 18:37:28 +00:00
|
|
|
|
|
|
|
#include "rspro_util.h"
|
2019-03-09 11:59:41 +00:00
|
|
|
#include "rspro_client_fsm.h"
|
2019-03-11 21:19:19 +00:00
|
|
|
#include "slotmap.h"
|
2018-10-14 15:44:25 +00:00
|
|
|
#include "debug.h"
|
2018-08-24 18:37:28 +00:00
|
|
|
|
|
|
|
/* main.c */
|
|
|
|
|
2019-12-16 23:02:36 +00:00
|
|
|
struct cardem_inst;
|
|
|
|
|
2019-12-17 00:11:24 +00:00
|
|
|
#define ATR_SIZE_MAX 55
|
|
|
|
struct client_config {
|
|
|
|
char *server_host;
|
|
|
|
int server_port;
|
|
|
|
|
|
|
|
int client_id;
|
|
|
|
int client_slot;
|
|
|
|
|
|
|
|
char *gsmtap_host;
|
|
|
|
bool keep_running;
|
|
|
|
|
|
|
|
char *event_script;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint8_t data[ATR_SIZE_MAX];
|
|
|
|
uint8_t len;
|
|
|
|
} atr;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int vendor_id;
|
|
|
|
int product_id;
|
|
|
|
int config_id;
|
|
|
|
int if_num;
|
|
|
|
int altsetting;
|
|
|
|
int addr;
|
|
|
|
char *path;
|
|
|
|
} usb;
|
|
|
|
};
|
|
|
|
|
2018-08-24 18:37:28 +00:00
|
|
|
struct bankd_client {
|
|
|
|
/* connection to the remsim-server (control) */
|
2019-03-02 16:02:13 +00:00
|
|
|
struct rspro_server_conn srv_conn;
|
2019-12-02 22:04:54 +00:00
|
|
|
/* connection to the remsim-bankd (data) */
|
|
|
|
struct rspro_server_conn bankd_conn;
|
2018-08-24 18:37:28 +00:00
|
|
|
|
2019-03-02 16:02:13 +00:00
|
|
|
/* remote component ID */
|
|
|
|
struct app_comp_id peer_comp_id;
|
2018-08-24 18:37:28 +00:00
|
|
|
|
2019-03-11 21:19:19 +00:00
|
|
|
struct bank_slot bankd_slot;
|
2019-12-16 23:02:36 +00:00
|
|
|
|
2019-12-17 00:11:24 +00:00
|
|
|
struct client_config *cfg;
|
2019-12-16 23:02:36 +00:00
|
|
|
struct cardem_inst *cardem;
|
2018-08-24 18:37:28 +00:00
|
|
|
};
|
2020-02-13 19:43:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern struct bankd_client *g_client;
|
|
|
|
|
|
|
|
extern int client_user_bankd_handle_rx(struct rspro_server_conn *bankdc, const RsproPDU_t *pdu);
|
|
|
|
|
|
|
|
extern int client_user_main(struct bankd_client *g_client);
|