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
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index b6ae5b4..9db8173 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -1617,7 +1617,12 @@
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 @@
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);