mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 12:52:49 +00:00
*: remove empty "interface XYZ" config blocks
Using the previously-added vty_frame() support, this gets rid of all the pointless empty "interface XYZ" blocks that get added for any interface that shows up in the system (e.g. dummys, tunnels, etc.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
2071aa0ebb
commit
a8b828f3c3
@ -1321,7 +1321,7 @@ interface_config_write (struct vty *vty)
|
||||
int write = 0;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO (vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
vty_out (vty, "interface %s\n",ifp->name);
|
||||
vty_frame (vty, "interface %s\n",ifp->name);
|
||||
if (ifp->desc)
|
||||
vty_out (vty, " description %s\n",ifp->desc);
|
||||
babel_interface_nfo *babel_ifp = babel_get_if_nfo (ifp);
|
||||
@ -1377,7 +1377,7 @@ interface_config_write (struct vty *vty)
|
||||
write++;
|
||||
}
|
||||
}
|
||||
vty_out (vty, "!\n");
|
||||
vty_endframe (vty, "!\n");
|
||||
write++;
|
||||
}
|
||||
return write;
|
||||
|
@ -93,7 +93,7 @@ static int config_write_interfaces(struct vty *vty, struct eigrp *eigrp)
|
||||
struct listnode *node;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, ei)) {
|
||||
vty_out(vty, "interface %s\n", ei->ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ei->ifp->name);
|
||||
|
||||
if ((IF_DEF_PARAMS(ei->ifp)->auth_type)
|
||||
== EIGRP_AUTH_TYPE_MD5) {
|
||||
@ -128,7 +128,7 @@ static int config_write_interfaces(struct vty *vty, struct eigrp *eigrp)
|
||||
}
|
||||
|
||||
/*Separate this EIGRP interface configuration from the others*/
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -140,7 +140,7 @@ static int eigrp_write_interface(struct vty *vty)
|
||||
struct interface *ifp;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
|
||||
if (ifp->desc)
|
||||
vty_out(vty, " description %s\n", ifp->desc);
|
||||
@ -157,7 +157,7 @@ static int eigrp_write_interface(struct vty *vty)
|
||||
vty_out(vty, " ip hold-time eigrp %u\n",
|
||||
IF_DEF_PARAMS(ifp)->v_wait);
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -948,7 +948,7 @@ int isis_interface_config_write(struct vty *vty)
|
||||
continue;
|
||||
|
||||
/* IF name */
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
write++;
|
||||
/* IF desc */
|
||||
if (ifp->desc) {
|
||||
@ -1145,7 +1145,7 @@ int isis_interface_config_write(struct vty *vty)
|
||||
}
|
||||
write += circuit_write_mt_settings(circuit, vty);
|
||||
}
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
|
||||
return write;
|
||||
|
@ -854,7 +854,7 @@ static int interface_config_write(struct vty *vty)
|
||||
int i;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
|
||||
vty_out (vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
if (ifp->desc)
|
||||
vty_out (vty, " description %s\n", ifp->desc);
|
||||
|
||||
@ -913,7 +913,7 @@ static int interface_config_write(struct vty *vty)
|
||||
}
|
||||
}
|
||||
|
||||
vty_out (vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1755,7 +1755,7 @@ static int config_write_ospf6_interface(struct vty *vty)
|
||||
if (oi == NULL)
|
||||
continue;
|
||||
|
||||
vty_out(vty, "interface %s\n", oi->interface->name);
|
||||
vty_frame(vty, "interface %s\n", oi->interface->name);
|
||||
|
||||
if (ifp->desc)
|
||||
vty_out(vty, " description %s\n", ifp->desc);
|
||||
@ -1808,7 +1808,7 @@ static int config_write_ospf6_interface(struct vty *vty)
|
||||
|
||||
ospf6_bfd_write_config(vty, oi);
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -8152,8 +8152,8 @@ static int config_write_interface(struct vty *vty)
|
||||
if (ifp->ifindex == IFINDEX_DELETED)
|
||||
continue;
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "!\n");
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
if (ifp->desc)
|
||||
vty_out(vty, " description %s\n", ifp->desc);
|
||||
|
||||
@ -8367,6 +8367,8 @@ static int config_write_interface(struct vty *vty)
|
||||
} while (rn);
|
||||
|
||||
ospf_opaque_config_write_if(vty, ifp);
|
||||
|
||||
vty_endframe(vty, NULL);
|
||||
}
|
||||
|
||||
return write;
|
||||
|
@ -255,7 +255,7 @@ int pim_interface_config_write(struct vty *vty)
|
||||
|
||||
/* IF name */
|
||||
if (vrf->vrf_id == VRF_DEFAULT)
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
else
|
||||
vty_out(vty, "interface %s vrf %s\n", ifp->name,
|
||||
vrf->name);
|
||||
@ -363,7 +363,7 @@ int pim_interface_config_write(struct vty *vty)
|
||||
pim_static_write_mroute(pim, vty, ifp);
|
||||
pim_bfd_write_config(vty, ifp);
|
||||
}
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
++writes;
|
||||
}
|
||||
}
|
||||
|
@ -1751,7 +1751,7 @@ static int rip_interface_config_write(struct vty *vty)
|
||||
&& (!ri->auth_str) && (!ri->key_chain))
|
||||
continue;
|
||||
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
|
||||
if (ifp->desc)
|
||||
vty_out(vty, " description %s\n", ifp->desc);
|
||||
@ -1807,7 +1807,7 @@ static int rip_interface_config_write(struct vty *vty)
|
||||
vty_out(vty, " ip rip authentication key-chain %s\n",
|
||||
ri->key_chain);
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1084,7 +1084,7 @@ static int interface_config_write(struct vty *vty)
|
||||
&& (ri->split_horizon == ri->split_horizon_default))
|
||||
continue;
|
||||
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
if (ifp->desc)
|
||||
vty_out(vty, " description %s\n", ifp->desc);
|
||||
|
||||
@ -1105,7 +1105,7 @@ static int interface_config_write(struct vty *vty)
|
||||
}
|
||||
}
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
|
||||
write++;
|
||||
}
|
||||
|
@ -2791,7 +2791,7 @@ static int if_config_write(struct vty *vty)
|
||||
vrf = vrf_lookup_by_id(ifp->vrf_id);
|
||||
|
||||
if (ifp->vrf_id == VRF_DEFAULT)
|
||||
vty_out(vty, "interface %s\n", ifp->name);
|
||||
vty_frame(vty, "interface %s\n", ifp->name);
|
||||
else
|
||||
vty_out(vty, "interface %s vrf %s\n", ifp->name,
|
||||
vrf->name);
|
||||
@ -2842,7 +2842,7 @@ static int if_config_write(struct vty *vty)
|
||||
|
||||
link_params_config_write(vty, ifp);
|
||||
|
||||
vty_out(vty, "!\n");
|
||||
vty_endframe(vty, "!\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user