summaryrefslogtreecommitdiffstats
path: root/include/osmocom/ctrl
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-21 15:13:08 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-21 15:34:18 +0200
commit528134b01cd731d861b8e3c00554fdedf1e0b58f (patch)
tree0bf13a3e50f381c7f7c2d43d4996e97f5e6f1cc2 /include/osmocom/ctrl
parentc78e74e3d022400c66da05015e716ccb7fa18a63 (diff)
libctrl: Move bulk of control node lookup inti libosmoctrl
The control interface user now only has to register a very short node lookup function callback. This function is optional, and only required if hierarchical command lookup should be supported.
Diffstat (limited to 'include/osmocom/ctrl')
-rw-r--r--include/osmocom/ctrl/control_if.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h
index 318e181f..5e10a039 100644
--- a/include/osmocom/ctrl/control_if.h
+++ b/include/osmocom/ctrl/control_if.h
@@ -4,13 +4,16 @@
#include <osmocom/core/write_queue.h>
#include <osmocom/ctrl/control_cmd.h>
-typedef int (*ctrl_cmd_handler)(struct ctrl_cmd *, void *);
+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);
struct ctrl_handle {
struct osmo_fd listen_fd;
void *data;
- ctrl_cmd_handler handler;
+ ctrl_cmd_lookup lookup;
/* List of control connections */
struct llist_head ccon_list;
@@ -19,9 +22,9 @@ struct ctrl_handle {
int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
struct ctrl_handle *controlif_setup(void *data, uint16_t port,
- ctrl_cmd_handler handler);
+ ctrl_cmd_lookup lookup);
-int bsc_ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data);
+int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data);
#endif /* _CONTROL_IF_H */