aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorEric Wild <ewild@sysmocom.de>2019-07-09 13:48:06 +0200
committerlaforge <laforge@gnumonks.org>2019-07-21 19:27:40 +0000
commit51b610095d95c525e6882a6361eb4abfc8c6c789 (patch)
tree6cd44f7b3ac4f2747ca20c63c960e7525bd6ac40 /include/osmocom
parentb4a7db0f3675fe2a13d0486cb19a3438fb03e730 (diff)
extend the ipa keepalive fsm
The new and improved fsm supports multipe use cases: 1) plain old ipa server/client operation 2) ipa client/server operation with custom send callback (i.e. to bypass the tx queue) 3) all of the above + custom timeout callback 4) fully generic operation that will pass opaque data to the callbacks The current code will always kill the fsm and deallocate it upon timeout, so the timeout callback will now return a value: 1 means the fsm will be automatically terminated, 0 means no action, which allows manually stopping/starting the fsm to reuse it. Change-Id: Ie453fdee8bfd7fc1a3f1ed67ef0331f0abb1d59b
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/abis/ipa.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index 4f6081f..ff00697 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -113,7 +113,9 @@ struct ipa_keepalive_params {
unsigned int wait_for_resp;
};
-typedef void ipa_keepalive_timeout_cb_t(struct osmo_fsm_inst *fi, void *conn);
+typedef int ipa_keepalive_timeout_cb_t(struct osmo_fsm_inst *fi, void *conn);
+
+typedef void ipa_keepalive_send_cb_t(struct osmo_fsm_inst *fi, void *conn, struct msgb *msg);
struct osmo_fsm_inst *ipa_client_conn_alloc_keepalive_fsm(struct ipa_client_conn *client,
const struct ipa_keepalive_params *params,
@@ -123,12 +125,14 @@ struct osmo_fsm_inst *ipa_server_conn_alloc_keepalive_fsm(struct ipa_server_conn
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);
+struct osmo_fsm_inst *ipa_generic_conn_alloc_keepalive_fsm(void *ctx, void* data,
+ 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_set_send_cb(struct osmo_fsm_inst *fi, ipa_keepalive_send_cb_t *fn);
+
void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi);
void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi);