diff options
-rw-r--r-- | include/osmocom/ctrl/control_if.h | 7 | ||||
-rw-r--r-- | src/ctrl/control_if.c | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h index 76f825e5..318e181f 100644 --- a/include/osmocom/ctrl/control_if.h +++ b/include/osmocom/ctrl/control_if.h @@ -4,14 +4,11 @@ #include <osmocom/core/write_queue.h> #include <osmocom/ctrl/control_cmd.h> -/* FIXME: this must go */ -struct gsm_network; - typedef int (*ctrl_cmd_handler)(struct ctrl_cmd *, void *); struct ctrl_handle { struct osmo_fd listen_fd; - struct gsm_network *gsmnet; + void *data; ctrl_cmd_handler handler; @@ -21,7 +18,7 @@ struct ctrl_handle { int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); -struct ctrl_handle *controlif_setup(struct gsm_network *, uint16_t port, +struct ctrl_handle *controlif_setup(void *data, uint16_t port, ctrl_cmd_handler handler); int bsc_ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data); diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 325caff9..5db2eead 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -167,7 +167,7 @@ static int handle_control_read(struct osmo_fd * bfd) if (cmd) { cmd->ccon = ccon; - if (ctrl->handler(cmd, ctrl->gsmnet) != CTRL_CMD_HANDLED) { + if (ctrl->handler(cmd, ctrl->data) != CTRL_CMD_HANDLED) { ctrl_cmd_send(queue, cmd); talloc_free(cmd); } @@ -522,19 +522,19 @@ static int verify_counter(struct ctrl_cmd *cmd, const char *value, void *data) return 0; } -struct ctrl_handle *controlif_setup(struct gsm_network *gsmnet, uint16_t port, +struct ctrl_handle *controlif_setup(void *data, uint16_t port, ctrl_cmd_handler handler) { int ret; struct ctrl_handle *ctrl; - ctrl = talloc_zero(gsmnet, struct ctrl_handle); + ctrl = talloc_zero(data, struct ctrl_handle); if (!ctrl) return NULL; INIT_LLIST_HEAD(&ctrl->ccon_list); - ctrl->gsmnet = gsmnet; + ctrl->data = data; ctrl->handler = handler; ctrl_node_vec = vector_init(5); |