blob: 03f7ad6cb657437bb1351a4ac33427dbbb3bd221 [file] [log] [blame]
Harald Welte707c85a2019-03-09 12:56:35 +01001#pragma once
2
3#include <osmocom/core/fsm.h>
4#include <osmocom/abis/ipa.h>
5#include <osmocom/rspro/RsproPDU.h>
6
7enum server_conn_fsm_event {
8 SRVC_E_TCP_UP,
9 SRVC_E_TCP_DOWN,
10 SRVC_E_KA_TIMEOUT,
11 SRVC_E_CLIENT_CONN_RES,
12};
13
14struct rspro_server_conn;
15
16/* representing a client-side connection to a RSPRO server */
17struct rspro_server_conn {
18 /* state */
19 struct ipa_client_conn *conn;
20 struct osmo_fsm_inst *fi;
21 struct osmo_fsm_inst *keepalive_fi;
22 int (*handle_rx)(struct rspro_server_conn *conn, const RsproPDU_t *pdu);
23 /* IPA protocol identity */
24 struct ipaccess_unit ipa_dev;
25
26 /* our own component ID */
27 struct app_comp_id own_comp_id;
28 /* remote component ID */
29 struct app_comp_id peer_comp_id;
30
31 /* client id and slot number */
32 ClientSlot_t *clslot;
33
34 /* configuration */
35 char *server_host;
36 uint16_t server_port;
37};
38
39int server_conn_fsm_alloc(void *ctx, struct rspro_server_conn *srvc);