add f_vty_config3(), to run N commands on a sub-node
f_vty_config2() makes it convenient to enter a specific vty node without needing to send 'exit'/'end' explicitly. However, to pass multiple commands on the same node, the VTY would enter and exit the node for each call of f_vty_config2(). The new f_vty_config3() also allows multiple commands to be run on that same node without intermediate exiting. Change-Id: If969ac645aa82e5a36245d974de2a251633de111
This commit is contained in:
parent
8b326412a4
commit
1a1f854ed2
|
@ -149,19 +149,25 @@ module Osmocom_VTY_Functions {
|
||||||
}
|
}
|
||||||
|
|
||||||
type record of charstring rof_charstring;
|
type record of charstring rof_charstring;
|
||||||
function f_vty_config2(TELNETasp_PT pt, rof_charstring config_nodes, charstring cmd)
|
function f_vty_config3(TELNETasp_PT pt, rof_charstring config_nodes, rof_charstring cmds)
|
||||||
{
|
{
|
||||||
/* enter config mode; enter node */
|
/* enter config mode; enter node */
|
||||||
f_vty_enter_config(pt);
|
f_vty_enter_config(pt);
|
||||||
for (var integer i := 0; i < sizeof(config_nodes); i := i+1) {
|
for (var integer i := 0; i < sizeof(config_nodes); i := i+1) {
|
||||||
f_vty_transceive(pt, config_nodes[i]);
|
f_vty_transceive(pt, config_nodes[i]);
|
||||||
}
|
}
|
||||||
/* execute command */
|
/* execute commands */
|
||||||
f_vty_transceive(pt, cmd);
|
for (var integer i := 0; i < sizeof(cmds); i := i+1) {
|
||||||
|
f_vty_transceive(pt, cmds[i]);
|
||||||
|
}
|
||||||
/* leave config mode */
|
/* leave config mode */
|
||||||
f_vty_transceive(pt, "end");
|
f_vty_transceive(pt, "end");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_vty_config2(TELNETasp_PT pt, rof_charstring config_nodes, charstring cmd)
|
||||||
|
{
|
||||||
|
f_vty_config3(pt, config_nodes, { cmd });
|
||||||
|
}
|
||||||
|
|
||||||
function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
|
function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue