summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-16 16:18:01 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-10-23 22:31:01 +0000
commitea66852a62319901dc198ea1dc8cbfbf77217347 (patch)
treebb0ef5177a70719139edd6352c73050d448fd32a /include/osmocom
parent1fa8dfbaf42a4341255b3bbef3c8a3c574e8c477 (diff)
ctrl: allow more nodes than those in enum ctrl_node_type
Add ctrl_interface_setup_dynip2() to add a node_count parameter, which can be used to define more ctrl nodes without having to merge a patch to libosmocore. In consequence, also add ctrl_handle_alloc2(), since ctrl_interface_setup_dynip() uses ctrl_handle_alloc() to allocate the node slots, and add node_count param to static ctrl_init(). Passing zero as node_count indicates to use the default of _LAST_CTRL_NODE as before, i.e. to not define more ctrl nodes. Assert that we never allocate less than _LAST_CTRL_NODE slots. The current ctrl_interface_setup_dynip() and ctrl_handle_alloc() become simple wrappers that pass zero as node_count. Their use is still valid and they do not need to be deprecated. The API comment to ctrl_interface_setup_dynip2() explains how to define more node IDs. This patch was verified to work by osmo-hlr.git change I98ee6a06b3aa6a67adb868e0b63b0e04eb42eb50 which adds two node IDs for use by osmo-hlr only. Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/ctrl/control_if.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/osmocom/ctrl/control_if.h b/include/osmocom/ctrl/control_if.h
index 6e49742d..d4443287 100644
--- a/include/osmocom/ctrl/control_if.h
+++ b/include/osmocom/ctrl/control_if.h
@@ -24,12 +24,20 @@ struct ctrl_handle {
int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
int ctrl_cmd_send_trap(struct ctrl_handle *ctrl, const char *name, char *value);
struct ctrl_handle *ctrl_handle_alloc(void *ctx, void *data, ctrl_cmd_lookup lookup);
+struct ctrl_handle *ctrl_handle_alloc2(void *ctx, void *data,
+ ctrl_cmd_lookup lookup,
+ unsigned int node_count);
struct ctrl_handle *ctrl_interface_setup(void *data, uint16_t port,
ctrl_cmd_lookup lookup);
struct ctrl_handle *ctrl_interface_setup_dynip(void *data,
const char *bind_addr,
uint16_t port,
ctrl_cmd_lookup lookup);
+struct ctrl_handle *ctrl_interface_setup_dynip2(void *data,
+ const char *bind_addr,
+ uint16_t port,
+ ctrl_cmd_lookup lookup,
+ unsigned int node_count);
struct ctrl_connection *osmo_ctrl_conn_alloc(void *ctx, void *data);
int ctrl_cmd_handle(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd, void *data);
struct ctrl_cmd *ctrl_cmd_exec_from_string(struct ctrl_handle *ch, const char *cmdstr);