*: 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:
David Lamparter 2010-02-05 09:48:45 +01:00 committed by David Lamparter
parent 2071aa0ebb
commit a8b828f3c3
10 changed files with 24 additions and 22 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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++;
}

View File

@ -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;
}