From e43b46e0188882e0dd8cee42d99b157393c04b5c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Wed, 27 Jan 2021 21:52:08 +0100 Subject: gprs_ns2: introduce gprs_ns2_vty_init_reduced() for the PCU The gprs_ns2_vty_init_reduced() call initialized the ns2 vty without configuration nodes (except timeout). The PCU can be only configured by the BTS/BSC. It should not configured by vty. Change-Id: I4437da74bd48ba64d3f16ea67afc26c45b6d3ac9 --- src/gb/gprs_ns2_vty.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gb/gprs_ns2_vty.c') diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c index b6ae5b46..9db81730 100644 --- a/src/gb/gprs_ns2_vty.c +++ b/src/gb/gprs_ns2_vty.c @@ -1617,7 +1617,12 @@ DEFUN(logging_fltr_nsvc, return CMD_SUCCESS; } -int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi) +/*! initialized a reduced vty interface which excludes the configuration nodes besides timeouts. + * This can be used by the PCU which can be only configured by the BTS/BSC and not by the vty. + * \param[in] nsi NS instance on which we operate + * \return 0 on success. + */ +int gprs_ns2_vty_init_reduced(struct gprs_ns2_inst *nsi) { vty_nsi = nsi; INIT_LLIST_HEAD(&binds); @@ -1645,6 +1650,16 @@ int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi) install_node(&ns_node, config_write_ns); /* TODO: convert into osmo timer */ install_lib_element(L_NS_NODE, &cfg_ns_timer_cmd); + + return 0; +} + +int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi) +{ + int rc = gprs_ns2_vty_init_reduced(nsi); + if (rc) + return rc; + install_lib_element(L_NS_NODE, &cfg_ns_nsei_cmd); install_lib_element(L_NS_NODE, &cfg_no_ns_nsei_cmd); install_lib_element(L_NS_NODE, &cfg_ns_bind_cmd); -- cgit v1.2.3