aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorPau Espin Pedrol <>2021-01-05 18:36:17 +0100
committerlaforge <laforge@osmocom.org>2021-01-06 12:32:36 +0000
commit9584cd718a033f31bf7d8ee1b58c57dfbd5fd28e (patch)
tree2ccf7eb14cd345e0702391073c902af567cd2686 /include/osmocom
parente4cd267ab18f2d9d66351cce5b5a1aa8cc893c51 (diff)
ctrl: Allow handling CTRL get/set replies in user defined code
Prior to this patch, it was not possible to gather SET/GET reply information when implementing a CTRL client using libosmocontrol. This is specially important when using the GET command, since one wants to receive the queried value. CTRL traps can also be handled this way by extending this patch in the future if needed. Change-Id: Id3c4631cd32c13e78e11b6e8194b8c16307ec4f1
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/ctrl/control_if.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h
index 5fa9588d..b73296f6 100644
--- a/include/osmocom/ctrl/control_if.h
+++ b/include/osmocom/ctrl/control_if.h
@@ -9,6 +9,7 @@ int ctrl_parse_get_num(vector vline, int i, long *num);
typedef int (*ctrl_cmd_lookup)(void *data, vector vline, int *node_type,
void **node_data, int *i);
+typedef void (*ctrl_cmd_reply_cb)(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data);
struct ctrl_handle {
struct osmo_fd listen_fd;
@@ -18,6 +19,12 @@ struct ctrl_handle {
/* List of control connections */
struct llist_head ccon_list;
+
+ /* User defined GET/SET REPLY handler. User can set cmd->defer to 1 in
+ order to own and keep the cmd pointer and free it after the function
+ returns. "data" param is the user data pointer supplied during
+ ctrl_handle allocation */
+ ctrl_cmd_reply_cb reply_cb;
};