diff options
author | David Lamparter <equinox@diac24.net> | 2010-02-04 02:24:09 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-04 02:24:09 +0100 |
commit | 77f990188b526ea9ad3521980aee1d6faca8bb57 (patch) | |
tree | c4cce46d78f9c5d7ba7060a66682222966a656f2 /zebra/interface.c | |
parent | 8f8f4dec2e41b217a0651a2f33112447ae04f73b (diff) | |
parent | 472870f49a5c1eb18bfd30f1b06c1bff08ecd233 (diff) | |
download | quagga-77f990188b526ea9ad3521980aee1d6faca8bb57.tar.bz2 quagga-77f990188b526ea9ad3521980aee1d6faca8bb57.tar.xz |
Merge branch 'patches/jt_unnumbered' into ospf-merge-3
Conflicts:
ospfd/ospfd.c
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index ba4cf25f..7a98f649 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1002,6 +1002,53 @@ DEFUN (no_multicast, return CMD_SUCCESS; } +DEFUN (unnumbered, + unnumbered_cmd, + "unnumbered", + "Set interface to IP Unnumbered mode\n") +{ + int ret; + struct interface *ifp; + struct zebra_if *if_data; + + ifp = (struct interface *) vty->index; + + zlog_debug("VTY: interface %s, Setting ifp->status |= ZEBRA_INTERFACE_UNNUMBERED", + ifp->name); + + SET_FLAG(ifp->status, ZEBRA_INTERFACE_UNNUMBERED); + + /* force protocols to recalculate routes due to IP change */ + if (if_is_operative (ifp)) + zebra_interface_up_update (ifp); + + return CMD_SUCCESS; +} + +DEFUN (no_unnumbered, + no_unnumbered_cmd, + "no unnumbered", + NO_STR + "Set interface to IP Numbered mode\n") +{ + int ret; + struct interface *ifp; + struct zebra_if *if_data; + + ifp = (struct interface *) vty->index; + + zlog_debug("VTY: interface %s, Setting ifp->status &= ~ZEBRA_INTERFACE_UNNUMBERED;", + ifp->name); + + UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_UNNUMBERED); + + /* force protocols to recalculate routes due to IP change */ + if (if_is_operative (ifp)) + zebra_interface_up_update (ifp); + + return CMD_SUCCESS; +} + DEFUN (linkdetect, linkdetect_cmd, "link-detect", @@ -1531,6 +1578,9 @@ if_config_write (struct vty *vty) if (ifp->bandwidth != 0) vty_out(vty, " bandwidth %u%s", ifp->bandwidth, VTY_NEWLINE); + if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_UNNUMBERED)) + vty_out (vty, " unnumbered%s", VTY_NEWLINE); + if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) vty_out(vty, " link-detect%s", VTY_NEWLINE); @@ -1598,6 +1648,8 @@ zebra_if_init (void) install_element (INTERFACE_NODE, &no_interface_desc_cmd); install_element (INTERFACE_NODE, &multicast_cmd); install_element (INTERFACE_NODE, &no_multicast_cmd); + install_element (INTERFACE_NODE, &unnumbered_cmd); + install_element (INTERFACE_NODE, &no_unnumbered_cmd); install_element (INTERFACE_NODE, &linkdetect_cmd); install_element (INTERFACE_NODE, &no_linkdetect_cmd); install_element (INTERFACE_NODE, &shutdown_if_cmd); |