From ea62a38b5d770f31e3d3cc635c52d4854f585fb3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 23 Mar 2014 16:25:16 +0100 Subject: ctrl: Move the lookup into a separate file in preparation for GPRS For GPRS the look-up via bts/trx does not make any sense and would introduce bad depdencies for the SGSN. Move the look-up code to a new file and introduce new setup methods. --- openbsc/include/openbsc/control_cmd.h | 1 - openbsc/include/openbsc/control_if.h | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'openbsc/include') diff --git a/openbsc/include/openbsc/control_cmd.h b/openbsc/include/openbsc/control_cmd.h index cd7b7b6d..725dce06 100644 --- a/openbsc/include/openbsc/control_cmd.h +++ b/openbsc/include/openbsc/control_cmd.h @@ -77,7 +77,6 @@ struct ctrl_cmd_map { int ctrl_cmd_exec(vector vline, struct ctrl_cmd *command, vector node, void *data); int ctrl_cmd_install(enum ctrl_node_type node, struct ctrl_cmd_element *cmd); -int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data); int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); int ctrl_cmd_send_to_all(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd); struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg); diff --git a/openbsc/include/openbsc/control_if.h b/openbsc/include/openbsc/control_if.h index 6afc86d7..d103332a 100644 --- a/openbsc/include/openbsc/control_if.h +++ b/openbsc/include/openbsc/control_if.h @@ -5,17 +5,25 @@ #include #include +typedef int (*ctrl_cmd_handler)(struct ctrl_cmd *, void *); + struct ctrl_handle { struct osmo_fd listen_fd; struct gsm_network *gsmnet; + ctrl_cmd_handler handler; + /* List of control connections */ struct llist_head ccon_list; }; + int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); -int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data); -struct ctrl_handle *controlif_setup(struct gsm_network *gsmnet, uint16_t port); +struct ctrl_handle *controlif_setup(struct gsm_network *, uint16_t port, + ctrl_cmd_handler handler); +struct ctrl_handle *bsc_controlif_setup(struct gsm_network *gsmnet, uint16_t port); + +int bsc_ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data); #endif /* _CONTROL_IF_H */ -- cgit v1.2.3