aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-03-08 15:10:30 +0100
committerHarald Welte <laforge@gnumonks.org>2019-03-19 17:19:02 +0100
commit3d60dbd0214ad4125bfce8fa869d39be8376c8f1 (patch)
tree4967c0b06b601e69aa88c9fe5655fd51bce0f3e8 /include/osmocom
parentbab7ae7e884cd460f64d18ca703ae1ea238fa054 (diff)
Add IPA keep-alive FSM implementation
The IPA keep-alive FSM code takes care of periodically transmitting and IPA CCM PING and expecting an IPA CCM PONG in return. Change-Id: I2763da49a74de85046ac07d53592c89973314ca6
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/abis/ipa.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index a738156..4f6081f 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -5,6 +5,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
+#include <osmocom/core/fsm.h>
#include <osmocom/gsm/ipa.h>
struct e1inp_line;
@@ -99,4 +100,39 @@ int ipaccess_bts_handle_ccm(struct ipa_client_conn *link,
void ipa_msg_push_header(struct msgb *msg, uint8_t proto);
+
+/***********************************************************************
+ * IPA Keep-Alive FSM
+ ***********************************************************************/
+
+/*! parameters describing the keep-alive FSM (timeouts). */
+struct ipa_keepalive_params {
+ /*! interval in which to send IPA CCM PING requests to the peer. */
+ unsigned int interval;
+ /*! time to wait for an IPA CCM PONG in response to a IPA CCM PING before giving up. */
+ unsigned int wait_for_resp;
+};
+
+typedef void ipa_keepalive_timeout_cb_t(struct osmo_fsm_inst *fi, void *conn);
+
+struct osmo_fsm_inst *ipa_client_conn_alloc_keepalive_fsm(struct ipa_client_conn *client,
+ const struct ipa_keepalive_params *params,
+ const char *id);
+
+struct osmo_fsm_inst *ipa_server_conn_alloc_keepalive_fsm(struct ipa_server_conn *server,
+ const struct ipa_keepalive_params *params,
+ const char *id);
+
+struct osmo_fsm_inst *ipa_keepalive_alloc_server(struct ipa_server_conn *server,
+ const struct ipa_keepalive_params *params,
+ const char *id);
+
+void ipa_keepalive_fsm_set_timeout_cb(struct osmo_fsm_inst *fi, ipa_keepalive_timeout_cb_t *cb);
+
+void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi);
+
+void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi);
+
+void ipa_keepalive_fsm_pong_received(struct osmo_fsm_inst *fi);
+
#endif