pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-cbc/+/28713 )
Change subject: cbc_vty: write peer config nodes at the end
......................................................................
cbc_vty: write peer config nodes at the end
This way we end up with more "global" configs at the start of the file,
which are read/applied first, and later all the per-peer information,
which is a list of variable length.
Change-Id: I7623ea5874552e57764327e94a9c3a4de7b71d67
---
M src/cbc_vty.c
1 file changed, 13 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-cbc refs/changes/13/28713/1
diff --git a/src/cbc_vty.c b/src/cbc_vty.c
index ddf2891..9f2c073 100644
--- a/src/cbc_vty.c
+++ b/src/cbc_vty.c
@@ -321,11 +321,20 @@
return CMD_SUCCESS;
}
+static int config_write_ecbe(struct vty *vty);
+static int config_write_cbsp(struct vty *vty);
+static int config_write_sbcap(struct vty *vty);
+static int config_write_peer(struct vty *vty);
+
static int config_write_cbc(struct vty *vty)
{
vty_out(vty, "cbc%s", VTY_NEWLINE);
vty_out(vty, " unknown-peers %s%s",
g_cbc->config.permit_unknown_peers ? "accept" : "reject",
VTY_NEWLINE);
+ config_write_ecbe(vty);
+ config_write_cbsp(vty);
+ config_write_sbcap(vty);
+ config_write_peer(vty);
return CMD_SUCCESS;
}
@@ -672,24 +681,24 @@
install_lib_element(CBC_NODE, &cfg_permit_unknown_peers_cmd);
install_lib_element(CBC_NODE, &cfg_cbsp_cmd);
- install_node(&cbsp_node, config_write_cbsp);
+ install_node(&cbsp_node, NULL);
install_lib_element(CBSP_NODE, &cfg_cbsp_local_ip_cmd);
install_lib_element(CBSP_NODE, &cfg_cbsp_local_port_cmd);
install_lib_element(CBC_NODE, &cfg_ecbe_cmd);
- install_node(&ecbe_node, config_write_ecbe);
+ install_node(&ecbe_node, NULL);
install_lib_element(ECBE_NODE, &cfg_ecbe_local_ip_cmd);
install_lib_element(ECBE_NODE, &cfg_ecbe_local_port_cmd);
install_lib_element(CBC_NODE, &cfg_sbcap_cmd);
- install_node(&sbcap_node, config_write_sbcap);
+ install_node(&sbcap_node, NULL);
install_lib_element(SBcAP_NODE, &cfg_sbcap_local_ip_cmd);
install_lib_element(SBcAP_NODE, &cfg_sbcap_no_local_ip_cmd);
install_lib_element(SBcAP_NODE, &cfg_sbcap_local_port_cmd);
install_lib_element(CBC_NODE, &cfg_cbc_peer_cmd);
install_lib_element(CBC_NODE, &cfg_cbc_no_peer_cmd);
- install_node(&peer_node, config_write_peer);
+ install_node(&peer_node, NULL);
install_lib_element(PEER_NODE, &cfg_peer_proto_cmd);
install_lib_element(PEER_NODE, &cfg_peer_remote_port_cmd);
install_lib_element(PEER_NODE, &cfg_peer_no_remote_port_cmd);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-cbc/+/28713
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I7623ea5874552e57764327e94a9c3a4de7b71d67
Gerrit-Change-Number: 28713
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange