aboutsummaryrefslogtreecommitdiffstats
path: root/src/ctrl/control_vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-03-20 11:39:40 +0100
committerHarald Welte <laforge@gnumonks.org>2019-07-31 11:50:27 +0200
commit6079675bdb652045eff48880b0d9938b3e7e79ad (patch)
treeaf0651e53b2cd9023ee69ea5f29cdf6603bac1e7 /src/ctrl/control_vty.c
parent7b4a05d535f0ecc070e9b506ad0a667e24b67f71 (diff)
make use of OTC_GLOBAL when allocating library-internal contextslaforge/context
As libosmcore is now managing the global talloc contexts, there's no point in having APIs where the user tells the library about which talloc contexts to use for a given sub-system. Change-Id: I48f475efd3ee0d5120b8fc30861e852d1a6920b1
Diffstat (limited to 'src/ctrl/control_vty.c')
-rw-r--r--src/ctrl/control_vty.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c
index ef988892..0dc8bfe0 100644
--- a/src/ctrl/control_vty.c
+++ b/src/ctrl/control_vty.c
@@ -79,9 +79,14 @@ static int config_write_ctrl(struct vty *vty)
return CMD_SUCCESS;
}
+/*! Initialize the VTY configuration for the CTRL interface.
+ * \param[in] ctx UNUSED, only for legacy compatibility
+ * \returns 0 on success; negative on error */
int ctrl_vty_init(void *ctx)
{
- ctrl_vty_ctx = ctx;
+ ctrl_vty_ctx = talloc_named_const(OTC_GLOBAL, 0, "ctrl-vty");
+ if (!ctrl_vty_ctx)
+ return -1;
install_element(CONFIG_NODE, &cfg_ctrl_cmd);
install_node(&ctrl_node, config_write_ctrl);