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
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 @@
 	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 @@
 							  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);