write++;
}
}
- vty_endframe (vty, "!\n");
+ vty_endframe (vty, "exit\n!\n");
write++;
}
return write;
lines += config_write_distribute (vty, babel_routing_process->distribute_ctx);
+ vty_out (vty, "exit\n");
+
return lines;
}
void bfd_cli_show_header_end(struct vty *vty,
struct lyd_node *dnode __attribute__((__unused__)))
{
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
void bfd_cli_show_peer_end(struct vty *vty,
struct lyd_node *dnode __attribute__((__unused__)))
{
+ vty_out(vty, " exit\n");
vty_out(vty, " !\n");
}
frr_each (bmp_actives, &bt->actives, ba)
vty_out(vty, " bmp connect %s port %u min-retry %u max-retry %u\n",
ba->hostname, ba->port, ba->minretry, ba->maxretry);
+
+ vty_out(vty, " exit\n");
}
return 0;
vty_out(vty, "preference %hhu\n", cache->preference);
}
- vty_out(vty, " exit\n");
+ vty_out(vty, "exit\n");
return 1;
}
bgp_rfapi_cfg_write(vty, bgp);
#endif
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
return 0;
rfg->routemap_redist_name
[ZEBRA_ROUTE_BGP_DIRECT_EXT]);
}
- vty_out(vty, " exit-vrf-policy\n");
+ vty_out(vty, " exit-vrf-policy\n");
vty_out(vty, "!\n");
}
if (hc->flags & BGP_VNC_CONFIG_ADV_UN_METHOD_ENCAP) {
vty, bgp->rfapi->rfp,
RFAPI_RFP_CFG_GROUP_L2,
rfgc->name, rfgc->rfp_cfg);
- vty_out(vty, " exit-vnc\n");
+ vty_out(vty, " exit-vnc\n");
vty_out(vty, "!\n");
}
}
vty, bgp->rfapi->rfp,
RFAPI_RFP_CFG_GROUP_DEFAULT, NULL,
bgp->rfapi_cfg->default_rfp_cfg);
- vty_out(vty, " exit-vnc\n");
+ vty_out(vty, " exit-vnc\n");
vty_out(vty, "!\n");
}
vty, bgp->rfapi->rfp,
RFAPI_RFP_CFG_GROUP_NVE,
rfg->name, rfg->rfp_cfg);
- vty_out(vty, " exit-vnc\n");
+ vty_out(vty, " exit-vnc\n");
vty_out(vty, "!\n");
}
} /* have listen ports */
void eigrp_cli_show_end_header(struct vty *vty, struct lyd_node *dnode)
{
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
write += hook_call(isis_circuit_config_write,
circuit, vty);
}
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
}
return write;
vty_out(vty, "\n");
}
+void cli_show_router_isis_end(struct vty *vty, struct lyd_node *dnode)
+{
+ vty_out(vty, "exit\n");
+}
+
/*
* XPath: /frr-interface:lib/interface/frr-isisd:isis/
* XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv4-routing
.xpath = "/frr-isisd:isis/instance",
.cbs = {
.cli_show = cli_show_router_isis,
+ .cli_show_end = cli_show_router_isis_end,
.create = isis_instance_create,
.destroy = isis_instance_destroy,
},
/* Optional 'cli_show' callbacks. */
void cli_show_router_isis(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
+void cli_show_router_isis_end(struct vty *vty, struct lyd_node *dnode);
void cli_show_ip_isis_ipv4(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
void cli_show_ip_isis_ipv6(struct vty *vty, struct lyd_node *dnode,
write += area_write_mt_settings(area, vty);
write += fabricd_write_settings(area, vty);
+
+ vty_out(vty, "exit\n");
}
}
ia->hello_interval != 0)
vty_out (vty, " discovery hello interval %u\n",
ia->hello_interval);
+
+ vty_out (vty, " exit\n");
}
}
ldp_af_config_write(vty, AF_INET, ldpd_conf, &ldpd_conf->ipv4);
ldp_af_config_write(vty, AF_INET6, ldpd_conf, &ldpd_conf->ipv6);
vty_out (vty, " !\n");
+ vty_out (vty, "exit\n");
vty_out (vty, "!\n");
return (1);
" ! Incomplete config, specify a neighbor lsr-id\n");
if (missing_pwid)
vty_out (vty," ! Incomplete config, specify a pw-id\n");
+
+ vty_out (vty, " exit\n");
}
static int
ldp_l2vpn_pw_config_write(vty, pw);
vty_out (vty, " !\n");
+ vty_out (vty, "exit\n");
vty_out (vty, "!\n");
}
vty_out(vty, "\n");
}
+static void cli_show_interface_end(struct vty *vty, struct lyd_node *dnode)
+{
+ vty_out(vty, "exit\n");
+}
+
/*
* XPath: /frr-interface:lib/interface/description
*/
.create = lib_interface_create,
.destroy = lib_interface_destroy,
.cli_show = cli_show_interface,
+ .cli_show_end = cli_show_interface_end,
.get_next = lib_interface_get_next,
.get_keys = lib_interface_get_keys,
.lookup_entry = lib_interface_lookup_entry,
vty_out(vty, " exit\n");
}
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
nexthop_group_write_nexthop_internal(vty, nh);
}
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
void route_map_instance_show_end(struct vty *vty, struct lyd_node *dnode)
{
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
/* Display current configuration. */
static int vty_config_write(struct vty *vty)
{
- vty_out(vty, "line vty\n");
+ vty_frame(vty, "line vty\n");
if (vty_accesslist_name)
vty_out(vty, " access-class %s\n", vty_accesslist_name);
if (no_password_check)
vty_out(vty, " no login\n");
+ vty_endframe(vty, "exit\n");
+
if (do_log_commands)
vty_out(vty, "log commands\n");
}
}
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
}
return 0;
ospf6_bfd_write_config(vty, oi);
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
}
return 0;
}
ospf6_distribute_config_write(vty, ospf6);
ospf6_asbr_summary_config_write(vty, ospf6);
config_write_ospf6_gr_helper(vty, ospf6);
+
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
return 0;
ospf_opaque_config_write_if(vty, ifp);
- vty_endframe(vty, NULL);
+ vty_endframe(vty, "exit\n!\n");
}
return write;
/* LDP-Sync print */
ospf_ldp_sync_write_config(vty, ospf);
+ vty_out(vty, "exit\n");
+
write++;
return write;
}
yang_dnode_get_string(dnode, "./name"));
}
+void cli_show_srte_segment_list_end(struct vty *vty, struct lyd_node *dnode)
+{
+ vty_out(vty, " exit\n");
+}
+
static int segment_list_has_src_dst(
struct vty *vty, char *xpath, long index, const char *index_str,
struct in_addr adj_src_ipv4, struct in_addr adj_dst_ipv4,
yang_dnode_get_string(dnode, "./endpoint"));
}
+void cli_show_srte_policy_end(struct vty *vty, struct lyd_node *dnode)
+{
+ vty_out(vty, " exit\n");
+}
+
/*
* XPath: /frr-pathd:pathd/srte/policy/name
*/
}
}
+void cli_show_srte_policy_candidate_path_end(struct vty *vty,
+ struct lyd_node *dnode)
+{
+ const char *type = yang_dnode_get_string(dnode, "./type");
+
+ if (strmatch(type, "dynamic"))
+ vty_out(vty, " exit\n");
+}
+
static int config_write_dnode(const struct lyd_node *dnode, void *arg)
{
struct vty *vty = arg;
hook_call(pathd_srte_config_write, vty);
+ vty_out(vty, " exit\n");
+ vty_out(vty, "exit\n");
+
return 1;
}
.cbs = {
.create = pathd_srte_segment_list_create,
.cli_show = cli_show_srte_segment_list,
+ .cli_show_end = cli_show_srte_segment_list_end,
.destroy = pathd_srte_segment_list_destroy,
.get_next = pathd_srte_segment_list_get_next,
.get_keys = pathd_srte_segment_list_get_keys,
.cbs = {
.create = pathd_srte_policy_create,
.cli_show = cli_show_srte_policy,
+ .cli_show_end = cli_show_srte_policy_end,
.destroy = pathd_srte_policy_destroy,
.get_next = pathd_srte_policy_get_next,
.get_keys = pathd_srte_policy_get_keys,
.cbs = {
.create = pathd_srte_policy_candidate_path_create,
.cli_show = cli_show_srte_policy_candidate_path,
+ .cli_show_end = cli_show_srte_policy_candidate_path_end,
.destroy = pathd_srte_policy_candidate_path_destroy,
.get_next = pathd_srte_policy_candidate_path_get_next,
.get_keys = pathd_srte_policy_candidate_path_get_keys,
/* Optional 'cli_show' callbacks. */
void cli_show_srte_segment_list(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
+void cli_show_srte_segment_list_end(struct vty *vty, struct lyd_node *dnode);
void cli_show_srte_segment_list_segment(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
void cli_show_srte_policy(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
+void cli_show_srte_policy_end(struct vty *vty, struct lyd_node *dnode);
void cli_show_srte_policy_name(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
void cli_show_srte_policy_binding_sid(struct vty *vty, struct lyd_node *dnode,
void cli_show_srte_policy_candidate_path(struct vty *vty,
struct lyd_node *dnode,
bool show_defaults);
+void cli_show_srte_policy_candidate_path_end(struct vty *vty,
+ struct lyd_node *dnode);
/* Utility functions */
typedef void (*of_pref_cp_t)(enum objfun_type type, void *arg);
pcep_cli_pcep_pce_config_write(vty);
pcep_cli_pce_config_write(vty);
pcep_cli_pcc_config_write(vty);
+ vty_out(vty, " exit\n");
return 1;
}
}
if (pce_connections_g.num_connections == 0) {
- return lines;
+ goto exit;
}
buf[0] = 0;
lines++;
buf[0] = 0;
}
+exit:
+ vty_out(vty, " exit\n");
return lines;
}
vty_out(vty, "%s", buf);
buf[0] = '\0';
+
+ vty_out(vty, " exit\n");
}
return lines;
pcep_cli_print_pce_config(group_opts, buf, sizeof(buf));
vty_out(vty, "%s", buf);
buf[0] = 0;
+
+ vty_out(vty, " exit\n");
}
return lines;
pbr_map_write_interfaces(vty, ifp);
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
}
}
pbrms_nexthop_group_write_individual_nexthop(vty, pbrms);
}
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
return 1;
}
pim_global_config_write_worker(pim, vty);
if (vrf->vrf_id != VRF_DEFAULT)
- vty_endframe(vty, " exit-vrf\n!\n");
+ vty_endframe(vty, "exit-vrf\n!\n");
}
return 0;
pim_bfd_write_config(vty, ifp);
++writes;
}
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
++writes;
}
}
/* Interface routemap configuration */
config_write_if_rmap(vty, rip->if_rmap_ctx);
+ vty_out(vty, "exit\n");
+
write = 1;
}
config_write_distribute(vty, ripng->distribute_ctx);
config_write_if_rmap(vty, ripng->if_rmap_ctx);
+ vty_out(vty, "exit\n");
+
write = 1;
}
SAFI_UNICAST, "ipv6 route");
if (vrf->vrf_id != VRF_DEFAULT)
- vty_endframe(vty, " exit-vrf\n!\n");
+ vty_endframe(vty, "exit-vrf\n!\n");
}
return 0;
!\r
!\r
!\r
-line vty\r
!\r
end\r
test# conf t\r
!\r
!\r
!\r
-line vty\r
!\r
end\r
foohost(config)#
strlen(" ip igmp query-interval")) == 0) {
config_add_line_uniq_end(config->line, line);
} else if (config->index == LINK_PARAMS_NODE
- && strncmp(line, " exit-link-params",
- strlen(" exit"))
+ && strncmp(line, " exit-link-params",
+ strlen(" exit"))
== 0) {
config_add_line(config->line, line);
config->index = INTERFACE_NODE;
- } else if (config->index == VRF_NODE
- && strncmp(line, " exit-vrf",
- strlen(" exit-vrf"))
- == 0) {
- config_add_line_uniq_end(config->line, line);
} else if (!strncmp(line, " vrrp", strlen(" vrrp"))
|| !strncmp(line, " no vrrp",
strlen(" no vrrp"))) {
config_add_line(config_top, line);
break;
default:
- if (strncmp(line, "interface", strlen("interface")) == 0)
+ if (strncmp(line, "exit", strlen("exit")) == 0) {
+ if (config)
+ config_add_line_uniq_end(config->line, line);
+ } else if (strncmp(line, "interface", strlen("interface")) == 0)
config = config_get(INTERFACE_NODE, line);
else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
config = config_get(PW_NODE, line);
* are not under the VRF node.
*/
if (config->index == INTERFACE_NODE
- && list_isempty(config->line)) {
+ && (listcount(config->line) == 1)
+ && (line = listnode_head(config->line))
+ && strmatch(line, "exit")) {
config_del(config);
continue;
}
if (IS_PARAM_SET(iflp, LP_RMT_AS))
vty_out(vty, " neighbor %pI4 as %u\n", &iflp->rmt_ip,
iflp->rmt_as);
- vty_out(vty, " exit-link-params\n");
+ vty_out(vty, " exit-link-params\n");
return 0;
}
zebra_evpn_mh_if_write(vty, ifp);
link_params_config_write(vty, ifp);
- vty_endframe(vty, "!\n");
+ vty_endframe(vty, "exit\n!\n");
}
return 0;
}
if (!(pw->flags & F_PSEUDOWIRE_CWORD))
vty_out(vty, " control-word exclude\n");
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
write = 1;
}
vty_out(vty, " locator %s\n", locator->name);
vty_out(vty, " prefix %s/%u\n", str,
locator->prefix.prefixlen);
+ vty_out(vty, " exit\n");
vty_out(vty, " !\n");
}
+ vty_out(vty, " exit\n");
vty_out(vty, " !\n");
+ vty_out(vty, " exit\n");
vty_out(vty, " !\n");
+ vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
return 0;
router_id_write(vty, zvrf);
if (zvrf_id(zvrf) != VRF_DEFAULT)
- vty_endframe(vty, " exit-vrf\n!\n");
+ vty_endframe(vty, "exit-vrf\n!\n");
else
vty_out(vty, "!\n");
}