summaryrefslogtreecommitdiff
path: root/babeld
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2012-02-13 22:13:37 +0400
committerPaul Jakma <paul@quagga.net>2012-03-25 17:06:54 +0100
commitcb4b13d945a4b44282e59fa2be9ceda752420a13 (patch)
tree6ff7d9cdbe147dc57cd651b21e70bce5735b971e /babeld
parenta14ef5eeccc8c76c41830475bbe3c31c9e14faa5 (diff)
babeld: drive interface_config_write() forward
Diffstat (limited to 'babeld')
-rw-r--r--babeld/babel_interface.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 404be7a2..24f56f38 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -951,7 +951,8 @@ babel_if_delete_hook (struct interface *ifp)
return 0;
}
-/* Configuration write function for babeld. */
+/* Output an "interface" section for each of the known interfaces with
+babeld-specific statement lines where appropriate. */
static int
interface_config_write (struct vty *vty)
{
@@ -960,20 +961,27 @@ interface_config_write (struct vty *vty)
int write = 0;
for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) {
- /* Do not display the interface if there is no configuration about it */
- if (ifp->desc == NULL)
- continue;
-
vty_out (vty, "interface %s%s", ifp->name,
VTY_NEWLINE);
if (ifp->desc)
vty_out (vty, " description %s%s", ifp->desc,
VTY_NEWLINE);
-
- /* TODO: to be completed... */
-
+ if (IS_ENABLE (ifp))
+ {
+ babel_interface_nfo *babel_ifp = babel_get_if_nfo (ifp);
+ /* wireless/no split-horizon is the default */
+ if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_WIRED))
+ {
+ vty_out (vty, " babel wired%s", VTY_NEWLINE);
+ write++;
+ }
+ if (CHECK_FLAG (babel_ifp->flags, BABEL_IF_SPLIT_HORIZON))
+ {
+ vty_out (vty, " babel split-horizon%s", VTY_NEWLINE);
+ write++;
+ }
+ }
vty_out (vty, "!%s", VTY_NEWLINE);
-
write++;
}
return write;