paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 22 | #include <zebra.h> |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 23 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 24 | #include "memory.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 25 | #include "if.h" |
| 26 | #include "log.h" |
| 27 | #include "command.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 28 | #include "thread.h" |
| 29 | #include "prefix.h" |
| 30 | #include "plist.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 31 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 32 | #include "ospf6_lsa.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 33 | #include "ospf6_lsdb.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 34 | #include "ospf6_network.h" |
| 35 | #include "ospf6_message.h" |
| 36 | #include "ospf6_route.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 37 | #include "ospf6_top.h" |
| 38 | #include "ospf6_area.h" |
| 39 | #include "ospf6_interface.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 40 | #include "ospf6_neighbor.h" |
| 41 | #include "ospf6_intra.h" |
| 42 | #include "ospf6_spf.h" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 43 | #include "ospf6d.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 44 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 45 | unsigned char conf_debug_ospf6_interface = 0; |
| 46 | |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 47 | const char *ospf6_interface_state_str[] = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 48 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 49 | "None", |
| 50 | "Down", |
| 51 | "Loopback", |
| 52 | "Waiting", |
| 53 | "PointToPoint", |
| 54 | "DROther", |
| 55 | "BDR", |
| 56 | "DR", |
| 57 | NULL |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 60 | struct ospf6_interface * |
| 61 | ospf6_interface_lookup_by_ifindex (int ifindex) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 62 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 63 | struct ospf6_interface *oi; |
| 64 | struct interface *ifp; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 65 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 66 | ifp = if_lookup_by_index (ifindex); |
| 67 | if (ifp == NULL) |
| 68 | return (struct ospf6_interface *) NULL; |
| 69 | |
| 70 | oi = (struct ospf6_interface *) ifp->info; |
| 71 | return oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 72 | } |
| 73 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 74 | /* schedule routing table recalculation */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 75 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 76 | ospf6_interface_lsdb_hook (struct ospf6_lsa *lsa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 77 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 78 | switch (ntohs (lsa->header->type)) |
| 79 | { |
| 80 | case OSPF6_LSTYPE_LINK: |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 81 | if (OSPF6_INTERFACE (lsa->lsdb->data)->state == OSPF6_INTERFACE_DR) |
| 82 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (OSPF6_INTERFACE (lsa->lsdb->data)); |
| 83 | ospf6_spf_schedule (OSPF6_INTERFACE (lsa->lsdb->data)->area); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 84 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 85 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 86 | default: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 87 | break; |
| 88 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | /* Create new ospf6 interface structure */ |
| 92 | struct ospf6_interface * |
| 93 | ospf6_interface_create (struct interface *ifp) |
| 94 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 95 | struct ospf6_interface *oi; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 96 | unsigned int iobuflen; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 97 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 98 | oi = (struct ospf6_interface *) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 99 | XMALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface)); |
| 100 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 101 | if (oi) |
| 102 | memset (oi, 0, sizeof (struct ospf6_interface)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 103 | else |
| 104 | { |
| 105 | zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp->ifindex); |
| 106 | return (struct ospf6_interface *) NULL; |
| 107 | } |
| 108 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 109 | oi->area = (struct ospf6_area *) NULL; |
| 110 | oi->neighbor_list = list_new (); |
| 111 | oi->neighbor_list->cmp = ospf6_neighbor_cmp; |
| 112 | oi->linklocal_addr = (struct in6_addr *) NULL; |
| 113 | oi->instance_id = 0; |
| 114 | oi->transdelay = 1; |
| 115 | oi->priority = 1; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 116 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 117 | oi->hello_interval = 10; |
| 118 | oi->dead_interval = 40; |
| 119 | oi->rxmt_interval = 5; |
| 120 | oi->cost = 1; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 121 | oi->state = OSPF6_INTERFACE_DOWN; |
| 122 | oi->flag = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 123 | |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 124 | /* Try to adjust I/O buffer size with IfMtu */ |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 125 | oi->ifmtu = ifp->mtu6; |
| 126 | iobuflen = ospf6_iobuf_size (ifp->mtu6); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 127 | if (oi->ifmtu > iobuflen) |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 128 | { |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 129 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 130 | zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.", |
| 131 | ifp->name, iobuflen); |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 132 | oi->ifmtu = iobuflen; |
| 133 | } |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 134 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 135 | oi->lsupdate_list = ospf6_lsdb_create (oi); |
| 136 | oi->lsack_list = ospf6_lsdb_create (oi); |
| 137 | oi->lsdb = ospf6_lsdb_create (oi); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 138 | oi->lsdb->hook_add = ospf6_interface_lsdb_hook; |
| 139 | oi->lsdb->hook_remove = ospf6_interface_lsdb_hook; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 140 | oi->lsdb_self = ospf6_lsdb_create (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 141 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 142 | oi->route_connected = ospf6_route_table_create (); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 143 | |
| 144 | /* link both */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 145 | oi->interface = ifp; |
| 146 | ifp->info = oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 147 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 148 | return oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 152 | ospf6_interface_delete (struct ospf6_interface *oi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 153 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 154 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 155 | struct ospf6_neighbor *on; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 156 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 157 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 158 | ospf6_neighbor_delete (on); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 159 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 160 | list_delete (oi->neighbor_list); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 161 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 162 | THREAD_OFF (oi->thread_send_hello); |
| 163 | THREAD_OFF (oi->thread_send_lsupdate); |
| 164 | THREAD_OFF (oi->thread_send_lsack); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 165 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 166 | ospf6_lsdb_remove_all (oi->lsdb); |
| 167 | ospf6_lsdb_remove_all (oi->lsupdate_list); |
| 168 | ospf6_lsdb_remove_all (oi->lsack_list); |
| 169 | |
| 170 | ospf6_lsdb_delete (oi->lsdb); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 171 | ospf6_lsdb_delete (oi->lsdb_self); |
| 172 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 173 | ospf6_lsdb_delete (oi->lsupdate_list); |
| 174 | ospf6_lsdb_delete (oi->lsack_list); |
| 175 | |
| 176 | ospf6_route_table_delete (oi->route_connected); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 177 | |
| 178 | /* cut link */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 179 | oi->interface->info = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 180 | |
| 181 | /* plist_name */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 182 | if (oi->plist_name) |
| 183 | XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 185 | XFREE (MTYPE_OSPF6_IF, oi); |
| 186 | } |
| 187 | |
| 188 | void |
| 189 | ospf6_interface_enable (struct ospf6_interface *oi) |
| 190 | { |
| 191 | UNSET_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE); |
| 192 | |
| 193 | oi->thread_send_hello = |
| 194 | thread_add_event (master, ospf6_hello_send, oi, 0); |
| 195 | } |
| 196 | |
| 197 | void |
| 198 | ospf6_interface_disable (struct ospf6_interface *oi) |
| 199 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 200 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 201 | struct ospf6_neighbor *on; |
| 202 | |
| 203 | SET_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE); |
| 204 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 205 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 206 | ospf6_neighbor_delete (on); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 207 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 208 | list_delete_all_node (oi->neighbor_list); |
| 209 | |
| 210 | ospf6_lsdb_remove_all (oi->lsdb); |
| 211 | ospf6_lsdb_remove_all (oi->lsupdate_list); |
| 212 | ospf6_lsdb_remove_all (oi->lsack_list); |
| 213 | |
| 214 | THREAD_OFF (oi->thread_send_hello); |
| 215 | THREAD_OFF (oi->thread_send_lsupdate); |
| 216 | THREAD_OFF (oi->thread_send_lsack); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | static struct in6_addr * |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 220 | ospf6_interface_get_linklocal_address (struct interface *ifp) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 221 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 222 | struct listnode *n; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 223 | struct connected *c; |
| 224 | struct in6_addr *l = (struct in6_addr *) NULL; |
| 225 | |
| 226 | /* for each connected address */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 227 | for (ALL_LIST_ELEMENTS_RO (ifp->connected, n, c)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 228 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 229 | /* if family not AF_INET6, ignore */ |
| 230 | if (c->address->family != AF_INET6) |
| 231 | continue; |
| 232 | |
| 233 | /* linklocal scope check */ |
| 234 | if (IN6_IS_ADDR_LINKLOCAL (&c->address->u.prefix6)) |
| 235 | l = &c->address->u.prefix6; |
| 236 | } |
| 237 | return l; |
| 238 | } |
| 239 | |
| 240 | void |
| 241 | ospf6_interface_if_add (struct interface *ifp) |
| 242 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 243 | struct ospf6_interface *oi; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 244 | unsigned int iobuflen; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 245 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 246 | oi = (struct ospf6_interface *) ifp->info; |
| 247 | if (oi == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 248 | return; |
| 249 | |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 250 | /* Try to adjust I/O buffer size with IfMtu */ |
| 251 | if (oi->ifmtu == 0) |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 252 | oi->ifmtu = ifp->mtu6; |
| 253 | iobuflen = ospf6_iobuf_size (ifp->mtu6); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 254 | if (oi->ifmtu > iobuflen) |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 255 | { |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 256 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 257 | zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.", |
| 258 | ifp->name, iobuflen); |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 259 | oi->ifmtu = iobuflen; |
| 260 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 261 | |
| 262 | /* interface start */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 263 | if (oi->area) |
| 264 | thread_add_event (master, interface_up, oi, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | void |
| 268 | ospf6_interface_if_del (struct interface *ifp) |
| 269 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 270 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 271 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 272 | oi = (struct ospf6_interface *) ifp->info; |
| 273 | if (oi == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 274 | return; |
| 275 | |
| 276 | /* interface stop */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 277 | if (oi->area) |
| 278 | thread_execute (master, interface_down, oi, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 279 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 280 | listnode_delete (oi->area->if_list, oi); |
| 281 | oi->area = (struct ospf6_area *) NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 282 | |
| 283 | /* cut link */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 284 | oi->interface = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 285 | ifp->info = NULL; |
| 286 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 287 | ospf6_interface_delete (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | void |
| 291 | ospf6_interface_state_update (struct interface *ifp) |
| 292 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 293 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 294 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 295 | oi = (struct ospf6_interface *) ifp->info; |
| 296 | if (oi == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 297 | return; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 298 | if (oi->area == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 299 | return; |
| 300 | |
| 301 | if (if_is_up (ifp)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 302 | thread_add_event (master, interface_up, oi, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 303 | else |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 304 | thread_add_event (master, interface_down, oi, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 305 | |
| 306 | return; |
| 307 | } |
| 308 | |
| 309 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 310 | ospf6_interface_connected_route_update (struct interface *ifp) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 311 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 312 | struct ospf6_interface *oi; |
| 313 | struct ospf6_route *route; |
| 314 | struct connected *c; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 315 | struct listnode *node, *nnode; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 316 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 317 | oi = (struct ospf6_interface *) ifp->info; |
| 318 | if (oi == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 319 | return; |
| 320 | |
| 321 | /* reset linklocal pointer */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 322 | oi->linklocal_addr = ospf6_interface_get_linklocal_address (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 323 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 324 | /* if area is null, do not make connected-route list */ |
| 325 | if (oi->area == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 326 | return; |
| 327 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 328 | /* update "route to advertise" interface route table */ |
| 329 | ospf6_route_remove_all (oi->route_connected); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 330 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 331 | for (ALL_LIST_ELEMENTS (oi->interface->connected, node, nnode, c)) |
| 332 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 333 | if (c->address->family != AF_INET6) |
| 334 | continue; |
| 335 | |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 336 | CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE, c->address); |
| 337 | CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE, c->address); |
| 338 | CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE, c->address); |
| 339 | CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE, c->address); |
| 340 | CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE, c->address); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 341 | |
| 342 | /* apply filter */ |
| 343 | if (oi->plist_name) |
| 344 | { |
| 345 | struct prefix_list *plist; |
| 346 | enum prefix_list_type ret; |
| 347 | char buf[128]; |
| 348 | |
| 349 | prefix2str (c->address, buf, sizeof (buf)); |
| 350 | plist = prefix_list_lookup (AFI_IP6, oi->plist_name); |
| 351 | ret = prefix_list_apply (plist, (void *) c->address); |
| 352 | if (ret == PREFIX_DENY) |
| 353 | { |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 354 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 355 | zlog_debug ("%s on %s filtered by prefix-list %s ", |
| 356 | buf, oi->interface->name, oi->plist_name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 357 | continue; |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | route = ospf6_route_create (); |
| 362 | memcpy (&route->prefix, c->address, sizeof (struct prefix)); |
| 363 | apply_mask (&route->prefix); |
| 364 | route->type = OSPF6_DEST_TYPE_NETWORK; |
| 365 | route->path.area_id = oi->area->area_id; |
| 366 | route->path.type = OSPF6_PATH_TYPE_INTRA; |
| 367 | route->path.cost = oi->cost; |
| 368 | route->nexthop[0].ifindex = oi->interface->ifindex; |
| 369 | inet_pton (AF_INET6, "::1", &route->nexthop[0].address); |
| 370 | ospf6_route_add (route, oi->route_connected); |
| 371 | } |
| 372 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 373 | /* create new Link-LSA */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 374 | OSPF6_LINK_LSA_SCHEDULE (oi); |
| 375 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi); |
| 376 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 377 | } |
| 378 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 379 | static void |
| 380 | ospf6_interface_state_change (u_char next_state, struct ospf6_interface *oi) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 381 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 382 | u_char prev_state; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 383 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 384 | prev_state = oi->state; |
| 385 | oi->state = next_state; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 386 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 387 | if (prev_state == next_state) |
| 388 | return; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 389 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 390 | /* log */ |
| 391 | if (IS_OSPF6_DEBUG_INTERFACE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 392 | { |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 393 | zlog_debug ("Interface state change %s: %s -> %s", oi->interface->name, |
| 394 | ospf6_interface_state_str[prev_state], |
| 395 | ospf6_interface_state_str[next_state]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 396 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 397 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 398 | if ((prev_state == OSPF6_INTERFACE_DR || |
| 399 | prev_state == OSPF6_INTERFACE_BDR) && |
| 400 | (next_state != OSPF6_INTERFACE_DR && |
| 401 | next_state != OSPF6_INTERFACE_BDR)) |
| 402 | ospf6_leave_alldrouters (oi->interface->ifindex); |
| 403 | if ((prev_state != OSPF6_INTERFACE_DR && |
| 404 | prev_state != OSPF6_INTERFACE_BDR) && |
| 405 | (next_state == OSPF6_INTERFACE_DR || |
| 406 | next_state == OSPF6_INTERFACE_BDR)) |
| 407 | ospf6_join_alldrouters (oi->interface->ifindex); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 408 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 409 | OSPF6_ROUTER_LSA_SCHEDULE (oi->area); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 410 | if (next_state == OSPF6_INTERFACE_DOWN) |
| 411 | { |
| 412 | OSPF6_NETWORK_LSA_EXECUTE (oi); |
| 413 | OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT (oi); |
| 414 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
| 415 | } |
| 416 | else if (prev_state == OSPF6_INTERFACE_DR || |
| 417 | next_state == OSPF6_INTERFACE_DR) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 418 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 419 | OSPF6_NETWORK_LSA_SCHEDULE (oi); |
| 420 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi); |
| 421 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 422 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 423 | } |
| 424 | |
| 425 | |
| 426 | /* DR Election, RFC2328 section 9.4 */ |
| 427 | |
| 428 | #define IS_ELIGIBLE(n) \ |
| 429 | ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0) |
| 430 | |
| 431 | static struct ospf6_neighbor * |
| 432 | better_bdrouter (struct ospf6_neighbor *a, struct ospf6_neighbor *b) |
| 433 | { |
| 434 | if ((a == NULL || ! IS_ELIGIBLE (a) || a->drouter == a->router_id) && |
| 435 | (b == NULL || ! IS_ELIGIBLE (b) || b->drouter == b->router_id)) |
| 436 | return NULL; |
| 437 | else if (a == NULL || ! IS_ELIGIBLE (a) || a->drouter == a->router_id) |
| 438 | return b; |
| 439 | else if (b == NULL || ! IS_ELIGIBLE (b) || b->drouter == b->router_id) |
| 440 | return a; |
| 441 | |
| 442 | if (a->bdrouter == a->router_id && b->bdrouter != b->router_id) |
| 443 | return a; |
| 444 | if (a->bdrouter != a->router_id && b->bdrouter == b->router_id) |
| 445 | return b; |
| 446 | |
| 447 | if (a->priority > b->priority) |
| 448 | return a; |
| 449 | if (a->priority < b->priority) |
| 450 | return b; |
| 451 | |
| 452 | if (ntohl (a->router_id) > ntohl (b->router_id)) |
| 453 | return a; |
| 454 | if (ntohl (a->router_id) < ntohl (b->router_id)) |
| 455 | return b; |
| 456 | |
| 457 | zlog_warn ("Router-ID duplicate ?"); |
| 458 | return a; |
| 459 | } |
| 460 | |
| 461 | static struct ospf6_neighbor * |
| 462 | better_drouter (struct ospf6_neighbor *a, struct ospf6_neighbor *b) |
| 463 | { |
| 464 | if ((a == NULL || ! IS_ELIGIBLE (a) || a->drouter != a->router_id) && |
| 465 | (b == NULL || ! IS_ELIGIBLE (b) || b->drouter != b->router_id)) |
| 466 | return NULL; |
| 467 | else if (a == NULL || ! IS_ELIGIBLE (a) || a->drouter != a->router_id) |
| 468 | return b; |
| 469 | else if (b == NULL || ! IS_ELIGIBLE (b) || b->drouter != b->router_id) |
| 470 | return a; |
| 471 | |
| 472 | if (a->drouter == a->router_id && b->drouter != b->router_id) |
| 473 | return a; |
| 474 | if (a->drouter != a->router_id && b->drouter == b->router_id) |
| 475 | return b; |
| 476 | |
| 477 | if (a->priority > b->priority) |
| 478 | return a; |
| 479 | if (a->priority < b->priority) |
| 480 | return b; |
| 481 | |
| 482 | if (ntohl (a->router_id) > ntohl (b->router_id)) |
| 483 | return a; |
| 484 | if (ntohl (a->router_id) < ntohl (b->router_id)) |
| 485 | return b; |
| 486 | |
| 487 | zlog_warn ("Router-ID duplicate ?"); |
| 488 | return a; |
| 489 | } |
| 490 | |
| 491 | static u_char |
| 492 | dr_election (struct ospf6_interface *oi) |
| 493 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 494 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 495 | struct ospf6_neighbor *on, *drouter, *bdrouter, myself; |
| 496 | struct ospf6_neighbor *best_drouter, *best_bdrouter; |
| 497 | u_char next_state = 0; |
| 498 | |
| 499 | drouter = bdrouter = NULL; |
| 500 | best_drouter = best_bdrouter = NULL; |
| 501 | |
| 502 | /* pseudo neighbor myself, including noting current DR/BDR (1) */ |
| 503 | memset (&myself, 0, sizeof (myself)); |
| 504 | inet_ntop (AF_INET, &oi->area->ospf6->router_id, myself.name, |
| 505 | sizeof (myself.name)); |
| 506 | myself.state = OSPF6_NEIGHBOR_TWOWAY; |
| 507 | myself.drouter = oi->drouter; |
| 508 | myself.bdrouter = oi->bdrouter; |
| 509 | myself.priority = oi->priority; |
| 510 | myself.router_id = oi->area->ospf6->router_id; |
| 511 | |
| 512 | /* Electing BDR (2) */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 513 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
| 514 | bdrouter = better_bdrouter (bdrouter, on); |
| 515 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 516 | best_bdrouter = bdrouter; |
| 517 | bdrouter = better_bdrouter (best_bdrouter, &myself); |
| 518 | |
| 519 | /* Electing DR (3) */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 520 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
| 521 | drouter = better_drouter (drouter, on); |
| 522 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 523 | best_drouter = drouter; |
| 524 | drouter = better_drouter (best_drouter, &myself); |
| 525 | if (drouter == NULL) |
| 526 | drouter = bdrouter; |
| 527 | |
| 528 | /* the router itself is newly/no longer DR/BDR (4) */ |
| 529 | if ((drouter == &myself && myself.drouter != myself.router_id) || |
| 530 | (drouter != &myself && myself.drouter == myself.router_id) || |
| 531 | (bdrouter == &myself && myself.bdrouter != myself.router_id) || |
| 532 | (bdrouter != &myself && myself.bdrouter == myself.router_id)) |
| 533 | { |
| 534 | myself.drouter = (drouter ? drouter->router_id : htonl (0)); |
| 535 | myself.bdrouter = (bdrouter ? bdrouter->router_id : htonl (0)); |
| 536 | |
| 537 | /* compatible to Electing BDR (2) */ |
| 538 | bdrouter = better_bdrouter (best_bdrouter, &myself); |
| 539 | |
| 540 | /* compatible to Electing DR (3) */ |
| 541 | drouter = better_drouter (best_drouter, &myself); |
| 542 | if (drouter == NULL) |
| 543 | drouter = bdrouter; |
| 544 | } |
| 545 | |
| 546 | /* Set interface state accordingly (5) */ |
| 547 | if (drouter && drouter == &myself) |
| 548 | next_state = OSPF6_INTERFACE_DR; |
| 549 | else if (bdrouter && bdrouter == &myself) |
| 550 | next_state = OSPF6_INTERFACE_BDR; |
| 551 | else |
| 552 | next_state = OSPF6_INTERFACE_DROTHER; |
| 553 | |
| 554 | /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */ |
| 555 | /* XXX */ |
| 556 | |
| 557 | /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */ |
| 558 | /* RFC 2328 section 12.4. Originating LSAs (3) will be handled |
| 559 | accordingly after AdjOK */ |
| 560 | if (oi->drouter != (drouter ? drouter->router_id : htonl (0)) || |
| 561 | oi->bdrouter != (bdrouter ? bdrouter->router_id : htonl (0))) |
| 562 | { |
| 563 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 564 | zlog_debug ("DR Election on %s: DR: %s BDR: %s", oi->interface->name, |
| 565 | (drouter ? drouter->name : "0.0.0.0"), |
| 566 | (bdrouter ? bdrouter->name : "0.0.0.0")); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 567 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 568 | for (ALL_LIST_ELEMENTS_RO (oi->neighbor_list, node, on)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 569 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 570 | if (on->state < OSPF6_NEIGHBOR_TWOWAY) |
| 571 | continue; |
| 572 | /* Schedule AdjOK. */ |
| 573 | thread_add_event (master, adj_ok, on, 0); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | oi->drouter = (drouter ? drouter->router_id : htonl (0)); |
| 578 | oi->bdrouter = (bdrouter ? bdrouter->router_id : htonl (0)); |
| 579 | return next_state; |
| 580 | } |
| 581 | |
| 582 | |
| 583 | /* Interface State Machine */ |
| 584 | int |
| 585 | interface_up (struct thread *thread) |
| 586 | { |
| 587 | struct ospf6_interface *oi; |
| 588 | |
| 589 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 590 | assert (oi && oi->interface); |
| 591 | |
| 592 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 593 | zlog_debug ("Interface Event %s: [InterfaceUp]", |
| 594 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 595 | |
| 596 | /* check physical interface is up */ |
| 597 | if (! if_is_up (oi->interface)) |
| 598 | { |
| 599 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 600 | zlog_debug ("Interface %s is down, can't execute [InterfaceUp]", |
| 601 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 602 | return 0; |
| 603 | } |
| 604 | |
| 605 | /* if already enabled, do nothing */ |
| 606 | if (oi->state > OSPF6_INTERFACE_DOWN) |
| 607 | { |
| 608 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 609 | zlog_debug ("Interface %s already enabled", |
| 610 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 611 | return 0; |
| 612 | } |
| 613 | |
| 614 | /* Join AllSPFRouters */ |
| 615 | ospf6_join_allspfrouters (oi->interface->ifindex); |
| 616 | |
| 617 | /* Update interface route */ |
| 618 | ospf6_interface_connected_route_update (oi->interface); |
| 619 | |
| 620 | /* Schedule Hello */ |
| 621 | if (! CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) |
| 622 | thread_add_event (master, ospf6_hello_send, oi, 0); |
| 623 | |
| 624 | /* decide next interface state */ |
| 625 | if (if_is_pointopoint (oi->interface)) |
| 626 | ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT, oi); |
| 627 | else if (oi->priority == 0) |
| 628 | ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER, oi); |
| 629 | else |
| 630 | { |
| 631 | ospf6_interface_state_change (OSPF6_INTERFACE_WAITING, oi); |
| 632 | thread_add_timer (master, wait_timer, oi, oi->dead_interval); |
| 633 | } |
| 634 | |
| 635 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | int |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 639 | wait_timer (struct thread *thread) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 640 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 641 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 642 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 643 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 644 | assert (oi && oi->interface); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 645 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 646 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 647 | zlog_debug ("Interface Event %s: [WaitTimer]", |
| 648 | oi->interface->name); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 649 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 650 | if (oi->state == OSPF6_INTERFACE_WAITING) |
| 651 | ospf6_interface_state_change (dr_election (oi), oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 652 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 653 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 654 | } |
| 655 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 656 | int |
| 657 | backup_seen (struct thread *thread) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 658 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 659 | struct ospf6_interface *oi; |
| 660 | |
| 661 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 662 | assert (oi && oi->interface); |
| 663 | |
| 664 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 665 | zlog_debug ("Interface Event %s: [BackupSeen]", |
| 666 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 667 | |
| 668 | if (oi->state == OSPF6_INTERFACE_WAITING) |
| 669 | ospf6_interface_state_change (dr_election (oi), oi); |
| 670 | |
| 671 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 672 | } |
| 673 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 674 | int |
| 675 | neighbor_change (struct thread *thread) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 676 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 677 | struct ospf6_interface *oi; |
| 678 | |
| 679 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 680 | assert (oi && oi->interface); |
| 681 | |
| 682 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 683 | zlog_debug ("Interface Event %s: [NeighborChange]", |
| 684 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 685 | |
| 686 | if (oi->state == OSPF6_INTERFACE_DROTHER || |
| 687 | oi->state == OSPF6_INTERFACE_BDR || |
| 688 | oi->state == OSPF6_INTERFACE_DR) |
| 689 | ospf6_interface_state_change (dr_election (oi), oi); |
| 690 | |
| 691 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 692 | } |
| 693 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 694 | int |
| 695 | loopind (struct thread *thread) |
| 696 | { |
| 697 | struct ospf6_interface *oi; |
| 698 | |
| 699 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 700 | assert (oi && oi->interface); |
| 701 | |
| 702 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 703 | zlog_debug ("Interface Event %s: [LoopInd]", |
| 704 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 705 | |
| 706 | /* XXX not yet */ |
| 707 | |
| 708 | return 0; |
| 709 | } |
| 710 | |
| 711 | int |
| 712 | interface_down (struct thread *thread) |
| 713 | { |
| 714 | struct ospf6_interface *oi; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 715 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 716 | struct ospf6_neighbor *on; |
| 717 | |
| 718 | oi = (struct ospf6_interface *) THREAD_ARG (thread); |
| 719 | assert (oi && oi->interface); |
| 720 | |
| 721 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 722 | zlog_debug ("Interface Event %s: [InterfaceDown]", |
| 723 | oi->interface->name); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 724 | |
| 725 | /* Leave AllSPFRouters */ |
| 726 | if (oi->state > OSPF6_INTERFACE_DOWN) |
| 727 | ospf6_leave_allspfrouters (oi->interface->ifindex); |
| 728 | |
| 729 | ospf6_interface_state_change (OSPF6_INTERFACE_DOWN, oi); |
| 730 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 731 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
| 732 | ospf6_neighbor_delete (on); |
| 733 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 734 | list_delete_all_node (oi->neighbor_list); |
| 735 | |
| 736 | return 0; |
| 737 | } |
| 738 | |
| 739 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 740 | /* show specified interface structure */ |
| 741 | int |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 742 | ospf6_interface_show (struct vty *vty, struct interface *ifp) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 743 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 744 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 745 | struct connected *c; |
| 746 | struct prefix *p; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 747 | struct listnode *i; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 748 | char strbuf[64], drouter[32], bdrouter[32]; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 749 | const char *updown[3] = {"down", "up", NULL}; |
| 750 | const char *type; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 751 | struct timeval res, now; |
| 752 | char duration[32]; |
| 753 | struct ospf6_lsa *lsa; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 754 | |
| 755 | /* check physical interface type */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 756 | if (if_is_loopback (ifp)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 757 | type = "LOOPBACK"; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 758 | else if (if_is_broadcast (ifp)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 759 | type = "BROADCAST"; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 760 | else if (if_is_pointopoint (ifp)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 761 | type = "POINTOPOINT"; |
| 762 | else |
| 763 | type = "UNKNOWN"; |
| 764 | |
| 765 | vty_out (vty, "%s is %s, type %s%s", |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 766 | ifp->name, updown[if_is_up (ifp)], type, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 767 | VNL); |
| 768 | vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 769 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 770 | if (ifp->info == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 771 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 772 | vty_out (vty, " OSPF not enabled on this interface%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 773 | return 0; |
| 774 | } |
| 775 | else |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 776 | oi = (struct ospf6_interface *) ifp->info; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 777 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 778 | vty_out (vty, " Internet Address:%s", VNL); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 779 | |
| 780 | for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 781 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 782 | p = c->address; |
| 783 | prefix2str (p, strbuf, sizeof (strbuf)); |
| 784 | switch (p->family) |
| 785 | { |
| 786 | case AF_INET: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 787 | vty_out (vty, " inet : %s%s", strbuf, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 788 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 789 | break; |
| 790 | case AF_INET6: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 791 | vty_out (vty, " inet6: %s%s", strbuf, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 792 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 793 | break; |
| 794 | default: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 795 | vty_out (vty, " ??? : %s%s", strbuf, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 796 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 797 | break; |
| 798 | } |
| 799 | } |
| 800 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 801 | if (oi->area) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 802 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 803 | vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 804 | oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 805 | inet_ntop (AF_INET, &oi->area->area_id, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 806 | strbuf, sizeof (strbuf)); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 807 | vty_out (vty, " Area ID %s, Cost %hu%s", strbuf, oi->cost, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 808 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 809 | } |
| 810 | else |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 811 | vty_out (vty, " Not Attached to Area%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 812 | |
| 813 | vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 814 | ospf6_interface_state_str[oi->state], |
| 815 | oi->transdelay, oi->priority, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 816 | VNL); |
| 817 | vty_out (vty, " Timer intervals configured:%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 818 | vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 819 | oi->hello_interval, oi->dead_interval, oi->rxmt_interval, |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 820 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 821 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 822 | inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter)); |
| 823 | inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter)); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 824 | vty_out (vty, " DR: %s BDR: %s%s", drouter, bdrouter, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 825 | |
| 826 | vty_out (vty, " Number of I/F scoped LSAs is %u%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 827 | oi->lsdb->count, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 828 | |
| 829 | gettimeofday (&now, (struct timezone *) NULL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 830 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 831 | timerclear (&res); |
| 832 | if (oi->thread_send_lsupdate) |
| 833 | timersub (&oi->thread_send_lsupdate->u.sands, &now, &res); |
| 834 | timerstring (&res, duration, sizeof (duration)); |
| 835 | vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", |
| 836 | oi->lsupdate_list->count, duration, |
| 837 | (oi->thread_send_lsupdate ? "on" : "off"), |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 838 | VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 839 | for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa; |
| 840 | lsa = ospf6_lsdb_next (lsa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 841 | vty_out (vty, " %s%s", lsa->name, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 842 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 843 | timerclear (&res); |
| 844 | if (oi->thread_send_lsack) |
| 845 | timersub (&oi->thread_send_lsack->u.sands, &now, &res); |
| 846 | timerstring (&res, duration, sizeof (duration)); |
| 847 | vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", |
| 848 | oi->lsack_list->count, duration, |
| 849 | (oi->thread_send_lsack ? "on" : "off"), |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 850 | VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 851 | for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa; |
| 852 | lsa = ospf6_lsdb_next (lsa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 853 | vty_out (vty, " %s%s", lsa->name, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 854 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 855 | return 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 856 | } |
| 857 | |
| 858 | /* show interface */ |
| 859 | DEFUN (show_ipv6_ospf6_interface, |
| 860 | show_ipv6_ospf6_interface_ifname_cmd, |
| 861 | "show ipv6 ospf6 interface IFNAME", |
| 862 | SHOW_STR |
| 863 | IP6_STR |
| 864 | OSPF6_STR |
| 865 | INTERFACE_STR |
| 866 | IFNAME_STR |
| 867 | ) |
| 868 | { |
| 869 | struct interface *ifp; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 870 | struct listnode *i; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 871 | |
| 872 | if (argc) |
| 873 | { |
| 874 | ifp = if_lookup_by_name (argv[0]); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 875 | if (ifp == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 876 | { |
| 877 | vty_out (vty, "No such Interface: %s%s", argv[0], |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 878 | VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 879 | return CMD_WARNING; |
| 880 | } |
| 881 | ospf6_interface_show (vty, ifp); |
| 882 | } |
| 883 | else |
| 884 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 885 | for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp)) |
| 886 | ospf6_interface_show (vty, ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 887 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 888 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 889 | return CMD_SUCCESS; |
| 890 | } |
| 891 | |
| 892 | ALIAS (show_ipv6_ospf6_interface, |
| 893 | show_ipv6_ospf6_interface_cmd, |
| 894 | "show ipv6 ospf6 interface", |
| 895 | SHOW_STR |
| 896 | IP6_STR |
| 897 | OSPF6_STR |
| 898 | INTERFACE_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 899 | ); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 900 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 901 | DEFUN (show_ipv6_ospf6_interface_ifname_prefix, |
| 902 | show_ipv6_ospf6_interface_ifname_prefix_cmd, |
| 903 | "show ipv6 ospf6 interface IFNAME prefix", |
| 904 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 905 | IP6_STR |
| 906 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 907 | INTERFACE_STR |
| 908 | IFNAME_STR |
| 909 | "Display connected prefixes to advertise\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 910 | ) |
| 911 | { |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 912 | struct interface *ifp; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 913 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 914 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 915 | ifp = if_lookup_by_name (argv[0]); |
| 916 | if (ifp == NULL) |
| 917 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 918 | vty_out (vty, "No such Interface: %s%s", argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 919 | return CMD_WARNING; |
| 920 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 921 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 922 | oi = ifp->info; |
| 923 | if (oi == NULL) |
| 924 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 925 | vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 926 | return CMD_WARNING; |
| 927 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 928 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 929 | argc--; |
| 930 | argv++; |
| 931 | ospf6_route_table_show (vty, argc, argv, oi->route_connected); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 932 | |
| 933 | return CMD_SUCCESS; |
| 934 | } |
| 935 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 936 | ALIAS (show_ipv6_ospf6_interface_ifname_prefix, |
| 937 | show_ipv6_ospf6_interface_ifname_prefix_detail_cmd, |
| 938 | "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)", |
| 939 | SHOW_STR |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 940 | IP6_STR |
| 941 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 942 | INTERFACE_STR |
| 943 | IFNAME_STR |
| 944 | "Display connected prefixes to advertise\n" |
| 945 | OSPF6_ROUTE_ADDRESS_STR |
| 946 | OSPF6_ROUTE_PREFIX_STR |
| 947 | "Dispaly details of the prefixes\n" |
| 948 | ); |
| 949 | |
| 950 | ALIAS (show_ipv6_ospf6_interface_ifname_prefix, |
| 951 | show_ipv6_ospf6_interface_ifname_prefix_match_cmd, |
| 952 | "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)", |
| 953 | SHOW_STR |
| 954 | IP6_STR |
| 955 | OSPF6_STR |
| 956 | INTERFACE_STR |
| 957 | IFNAME_STR |
| 958 | "Display connected prefixes to advertise\n" |
| 959 | OSPF6_ROUTE_PREFIX_STR |
| 960 | OSPF6_ROUTE_MATCH_STR |
| 961 | "Dispaly details of the prefixes\n" |
| 962 | ); |
| 963 | |
| 964 | DEFUN (show_ipv6_ospf6_interface_prefix, |
| 965 | show_ipv6_ospf6_interface_prefix_cmd, |
| 966 | "show ipv6 ospf6 interface prefix", |
| 967 | SHOW_STR |
| 968 | IP6_STR |
| 969 | OSPF6_STR |
| 970 | INTERFACE_STR |
| 971 | "Display connected prefixes to advertise\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 972 | ) |
| 973 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 974 | struct listnode *i; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 975 | struct ospf6_interface *oi; |
| 976 | struct interface *ifp; |
| 977 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 978 | for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 979 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 980 | oi = (struct ospf6_interface *) ifp->info; |
| 981 | if (oi == NULL) |
| 982 | continue; |
| 983 | |
| 984 | ospf6_route_table_show (vty, argc, argv, oi->route_connected); |
| 985 | } |
| 986 | |
| 987 | return CMD_SUCCESS; |
| 988 | } |
| 989 | |
| 990 | ALIAS (show_ipv6_ospf6_interface_prefix, |
| 991 | show_ipv6_ospf6_interface_prefix_detail_cmd, |
| 992 | "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)", |
| 993 | SHOW_STR |
| 994 | IP6_STR |
| 995 | OSPF6_STR |
| 996 | INTERFACE_STR |
| 997 | "Display connected prefixes to advertise\n" |
| 998 | OSPF6_ROUTE_ADDRESS_STR |
| 999 | OSPF6_ROUTE_PREFIX_STR |
| 1000 | "Dispaly details of the prefixes\n" |
| 1001 | ); |
| 1002 | |
| 1003 | ALIAS (show_ipv6_ospf6_interface_prefix, |
| 1004 | show_ipv6_ospf6_interface_prefix_match_cmd, |
| 1005 | "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)", |
| 1006 | SHOW_STR |
| 1007 | IP6_STR |
| 1008 | OSPF6_STR |
| 1009 | INTERFACE_STR |
| 1010 | "Display connected prefixes to advertise\n" |
| 1011 | OSPF6_ROUTE_PREFIX_STR |
| 1012 | OSPF6_ROUTE_MATCH_STR |
| 1013 | "Dispaly details of the prefixes\n" |
| 1014 | ); |
| 1015 | |
| 1016 | |
| 1017 | /* interface variable set command */ |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1018 | DEFUN (ipv6_ospf6_ifmtu, |
| 1019 | ipv6_ospf6_ifmtu_cmd, |
| 1020 | "ipv6 ospf6 ifmtu <1-65535>", |
| 1021 | IP6_STR |
| 1022 | OSPF6_STR |
| 1023 | "Interface MTU\n" |
| 1024 | "OSPFv3 Interface MTU\n" |
| 1025 | ) |
| 1026 | { |
| 1027 | struct ospf6_interface *oi; |
| 1028 | struct interface *ifp; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1029 | unsigned int ifmtu, iobuflen; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1030 | struct listnode *node, *nnode; |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1031 | struct ospf6_neighbor *on; |
| 1032 | |
| 1033 | ifp = (struct interface *) vty->index; |
| 1034 | assert (ifp); |
| 1035 | |
| 1036 | oi = (struct ospf6_interface *) ifp->info; |
| 1037 | if (oi == NULL) |
| 1038 | oi = ospf6_interface_create (ifp); |
| 1039 | assert (oi); |
| 1040 | |
| 1041 | ifmtu = strtol (argv[0], NULL, 10); |
| 1042 | |
| 1043 | if (oi->ifmtu == ifmtu) |
| 1044 | return CMD_SUCCESS; |
| 1045 | |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 1046 | if (ifp->mtu6 != 0 && ifp->mtu6 < ifmtu) |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1047 | { |
| 1048 | vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1049 | ifp->name, ifp->mtu6, VNL); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1050 | return CMD_WARNING; |
| 1051 | } |
| 1052 | |
| 1053 | if (oi->ifmtu < ifmtu) |
| 1054 | { |
| 1055 | iobuflen = ospf6_iobuf_size (ifmtu); |
| 1056 | if (iobuflen < ifmtu) |
| 1057 | { |
| 1058 | vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1059 | ifp->name, iobuflen, VNL); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1060 | oi->ifmtu = iobuflen; |
| 1061 | } |
| 1062 | else |
| 1063 | oi->ifmtu = ifmtu; |
| 1064 | } |
| 1065 | else |
| 1066 | oi->ifmtu = ifmtu; |
| 1067 | |
| 1068 | /* re-establish adjacencies */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1069 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1070 | { |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1071 | THREAD_OFF (on->inactivity_timer); |
hasso | 3e834b1 | 2005-06-24 07:50:12 +0000 | [diff] [blame] | 1072 | thread_add_event (master, inactivity_timer, on, 0); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1073 | } |
| 1074 | |
| 1075 | return CMD_SUCCESS; |
| 1076 | } |
| 1077 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1078 | DEFUN (no_ipv6_ospf6_ifmtu, |
| 1079 | no_ipv6_ospf6_ifmtu_cmd, |
| 1080 | "no ipv6 ospf6 ifmtu", |
| 1081 | NO_STR |
| 1082 | IP6_STR |
| 1083 | OSPF6_STR |
| 1084 | "Interface MTU\n" |
| 1085 | ) |
| 1086 | { |
| 1087 | struct ospf6_interface *oi; |
| 1088 | struct interface *ifp; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1089 | unsigned int iobuflen; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1090 | struct listnode *node, *nnode; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1091 | struct ospf6_neighbor *on; |
| 1092 | |
| 1093 | ifp = (struct interface *) vty->index; |
| 1094 | assert (ifp); |
| 1095 | |
| 1096 | oi = (struct ospf6_interface *) ifp->info; |
| 1097 | if (oi == NULL) |
| 1098 | oi = ospf6_interface_create (ifp); |
| 1099 | assert (oi); |
| 1100 | |
| 1101 | if (oi->ifmtu < ifp->mtu) |
| 1102 | { |
| 1103 | iobuflen = ospf6_iobuf_size (ifp->mtu); |
| 1104 | if (iobuflen < ifp->mtu) |
| 1105 | { |
| 1106 | vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", |
| 1107 | ifp->name, iobuflen, VNL); |
| 1108 | oi->ifmtu = iobuflen; |
| 1109 | } |
| 1110 | else |
| 1111 | oi->ifmtu = ifp->mtu; |
| 1112 | } |
| 1113 | else |
| 1114 | oi->ifmtu = ifp->mtu; |
| 1115 | |
| 1116 | /* re-establish adjacencies */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1117 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1118 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1119 | THREAD_OFF (on->inactivity_timer); |
hasso | 3e834b1 | 2005-06-24 07:50:12 +0000 | [diff] [blame] | 1120 | thread_add_event (master, inactivity_timer, on, 0); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1121 | } |
| 1122 | |
| 1123 | return CMD_SUCCESS; |
| 1124 | } |
| 1125 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1126 | DEFUN (ipv6_ospf6_cost, |
| 1127 | ipv6_ospf6_cost_cmd, |
| 1128 | "ipv6 ospf6 cost <1-65535>", |
| 1129 | IP6_STR |
| 1130 | OSPF6_STR |
| 1131 | "Interface cost\n" |
| 1132 | "Outgoing metric of this interface\n" |
| 1133 | ) |
| 1134 | { |
| 1135 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1136 | struct interface *ifp; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1137 | unsigned long int lcost; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1138 | |
| 1139 | ifp = (struct interface *) vty->index; |
| 1140 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1141 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1142 | oi = (struct ospf6_interface *) ifp->info; |
| 1143 | if (oi == NULL) |
| 1144 | oi = ospf6_interface_create (ifp); |
| 1145 | assert (oi); |
| 1146 | |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1147 | lcost = strtol (argv[0], NULL, 10); |
| 1148 | |
| 1149 | if (lcost > UINT32_MAX) |
| 1150 | { |
| 1151 | vty_out (vty, "Cost %ld is out of range%s", lcost, VNL); |
| 1152 | return CMD_WARNING; |
| 1153 | } |
| 1154 | |
| 1155 | if (oi->cost == lcost) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1156 | return CMD_SUCCESS; |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1157 | |
| 1158 | oi->cost = lcost; |
| 1159 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1160 | /* update cost held in route_connected list in ospf6_interface */ |
| 1161 | ospf6_interface_connected_route_update (oi->interface); |
| 1162 | |
| 1163 | /* execute LSA hooks */ |
| 1164 | if (oi->area) |
| 1165 | { |
| 1166 | OSPF6_LINK_LSA_SCHEDULE (oi); |
| 1167 | OSPF6_ROUTER_LSA_SCHEDULE (oi->area); |
| 1168 | OSPF6_NETWORK_LSA_SCHEDULE (oi); |
| 1169 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi); |
| 1170 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
| 1171 | } |
| 1172 | |
| 1173 | return CMD_SUCCESS; |
| 1174 | } |
| 1175 | |
| 1176 | DEFUN (ipv6_ospf6_hellointerval, |
| 1177 | ipv6_ospf6_hellointerval_cmd, |
| 1178 | "ipv6 ospf6 hello-interval <1-65535>", |
| 1179 | IP6_STR |
| 1180 | OSPF6_STR |
| 1181 | "Interval time of Hello packets\n" |
| 1182 | SECONDS_STR |
| 1183 | ) |
| 1184 | { |
| 1185 | struct ospf6_interface *oi; |
| 1186 | struct interface *ifp; |
| 1187 | |
| 1188 | ifp = (struct interface *) vty->index; |
| 1189 | assert (ifp); |
| 1190 | |
| 1191 | oi = (struct ospf6_interface *) ifp->info; |
| 1192 | if (oi == NULL) |
| 1193 | oi = ospf6_interface_create (ifp); |
| 1194 | assert (oi); |
| 1195 | |
| 1196 | oi->hello_interval = strtol (argv[0], NULL, 10); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1197 | return CMD_SUCCESS; |
| 1198 | } |
| 1199 | |
| 1200 | /* interface variable set command */ |
| 1201 | DEFUN (ipv6_ospf6_deadinterval, |
| 1202 | ipv6_ospf6_deadinterval_cmd, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1203 | "ipv6 ospf6 dead-interval <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1204 | IP6_STR |
| 1205 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1206 | "Interval time after which a neighbor is declared down\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1207 | SECONDS_STR |
| 1208 | ) |
| 1209 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1210 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1211 | struct interface *ifp; |
| 1212 | |
| 1213 | ifp = (struct interface *) vty->index; |
| 1214 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1215 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1216 | oi = (struct ospf6_interface *) ifp->info; |
| 1217 | if (oi == NULL) |
| 1218 | oi = ospf6_interface_create (ifp); |
| 1219 | assert (oi); |
| 1220 | |
| 1221 | oi->dead_interval = strtol (argv[0], NULL, 10); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1222 | return CMD_SUCCESS; |
| 1223 | } |
| 1224 | |
| 1225 | /* interface variable set command */ |
| 1226 | DEFUN (ipv6_ospf6_transmitdelay, |
| 1227 | ipv6_ospf6_transmitdelay_cmd, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1228 | "ipv6 ospf6 transmit-delay <1-3600>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1229 | IP6_STR |
| 1230 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1231 | "Transmit delay of this interface\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1232 | SECONDS_STR |
| 1233 | ) |
| 1234 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1235 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1236 | struct interface *ifp; |
| 1237 | |
| 1238 | ifp = (struct interface *) vty->index; |
| 1239 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1240 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1241 | oi = (struct ospf6_interface *) ifp->info; |
| 1242 | if (oi == NULL) |
| 1243 | oi = ospf6_interface_create (ifp); |
| 1244 | assert (oi); |
| 1245 | |
| 1246 | oi->transdelay = strtol (argv[0], NULL, 10); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1247 | return CMD_SUCCESS; |
| 1248 | } |
| 1249 | |
| 1250 | /* interface variable set command */ |
| 1251 | DEFUN (ipv6_ospf6_retransmitinterval, |
| 1252 | ipv6_ospf6_retransmitinterval_cmd, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1253 | "ipv6 ospf6 retransmit-interval <1-65535>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1254 | IP6_STR |
| 1255 | OSPF6_STR |
| 1256 | "Time between retransmitting lost link state advertisements\n" |
| 1257 | SECONDS_STR |
| 1258 | ) |
| 1259 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1260 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1261 | struct interface *ifp; |
| 1262 | |
| 1263 | ifp = (struct interface *) vty->index; |
| 1264 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1265 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1266 | oi = (struct ospf6_interface *) ifp->info; |
| 1267 | if (oi == NULL) |
| 1268 | oi = ospf6_interface_create (ifp); |
| 1269 | assert (oi); |
| 1270 | |
| 1271 | oi->rxmt_interval = strtol (argv[0], NULL, 10); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1272 | return CMD_SUCCESS; |
| 1273 | } |
| 1274 | |
| 1275 | /* interface variable set command */ |
| 1276 | DEFUN (ipv6_ospf6_priority, |
| 1277 | ipv6_ospf6_priority_cmd, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1278 | "ipv6 ospf6 priority <0-255>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1279 | IP6_STR |
| 1280 | OSPF6_STR |
| 1281 | "Router priority\n" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1282 | "Priority value\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1283 | ) |
| 1284 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1285 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1286 | struct interface *ifp; |
| 1287 | |
| 1288 | ifp = (struct interface *) vty->index; |
| 1289 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1290 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1291 | oi = (struct ospf6_interface *) ifp->info; |
| 1292 | if (oi == NULL) |
| 1293 | oi = ospf6_interface_create (ifp); |
| 1294 | assert (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1295 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1296 | oi->priority = strtol (argv[0], NULL, 10); |
| 1297 | |
| 1298 | if (oi->area) |
| 1299 | ospf6_interface_state_change (dr_election (oi), oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1300 | |
| 1301 | return CMD_SUCCESS; |
| 1302 | } |
| 1303 | |
| 1304 | DEFUN (ipv6_ospf6_instance, |
| 1305 | ipv6_ospf6_instance_cmd, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1306 | "ipv6 ospf6 instance-id <0-255>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1307 | IP6_STR |
| 1308 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1309 | "Instance ID for this interface\n" |
| 1310 | "Instance ID value\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1311 | ) |
| 1312 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1313 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1314 | struct interface *ifp; |
| 1315 | |
| 1316 | ifp = (struct interface *)vty->index; |
| 1317 | assert (ifp); |
| 1318 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1319 | oi = (struct ospf6_interface *)ifp->info; |
| 1320 | if (oi == NULL) |
| 1321 | oi = ospf6_interface_create (ifp); |
| 1322 | assert (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1323 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1324 | oi->instance_id = strtol (argv[0], NULL, 10); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1325 | return CMD_SUCCESS; |
| 1326 | } |
| 1327 | |
| 1328 | DEFUN (ipv6_ospf6_passive, |
| 1329 | ipv6_ospf6_passive_cmd, |
| 1330 | "ipv6 ospf6 passive", |
| 1331 | IP6_STR |
| 1332 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1333 | "passive interface, No adjacency will be formed on this interface\n" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1334 | ) |
| 1335 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1336 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1337 | struct interface *ifp; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1338 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1339 | struct ospf6_neighbor *on; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1340 | |
| 1341 | ifp = (struct interface *) vty->index; |
| 1342 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1343 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1344 | oi = (struct ospf6_interface *) ifp->info; |
| 1345 | if (oi == NULL) |
| 1346 | oi = ospf6_interface_create (ifp); |
| 1347 | assert (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1348 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1349 | SET_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE); |
| 1350 | THREAD_OFF (oi->thread_send_hello); |
| 1351 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1352 | for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1353 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1354 | THREAD_OFF (on->inactivity_timer); |
hasso | 3e834b1 | 2005-06-24 07:50:12 +0000 | [diff] [blame] | 1355 | thread_add_event (master, inactivity_timer, on, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1356 | } |
| 1357 | |
| 1358 | return CMD_SUCCESS; |
| 1359 | } |
| 1360 | |
| 1361 | DEFUN (no_ipv6_ospf6_passive, |
| 1362 | no_ipv6_ospf6_passive_cmd, |
| 1363 | "no ipv6 ospf6 passive", |
| 1364 | NO_STR |
| 1365 | IP6_STR |
| 1366 | OSPF6_STR |
| 1367 | "passive interface: No Adjacency will be formed on this I/F\n" |
| 1368 | ) |
| 1369 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1370 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1371 | struct interface *ifp; |
| 1372 | |
| 1373 | ifp = (struct interface *) vty->index; |
| 1374 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1375 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1376 | oi = (struct ospf6_interface *) ifp->info; |
| 1377 | if (oi == NULL) |
| 1378 | oi = ospf6_interface_create (ifp); |
| 1379 | assert (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1380 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1381 | UNSET_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE); |
| 1382 | THREAD_OFF (oi->thread_send_hello); |
| 1383 | oi->thread_send_hello = |
| 1384 | thread_add_event (master, ospf6_hello_send, oi, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1385 | |
| 1386 | return CMD_SUCCESS; |
| 1387 | } |
| 1388 | |
| 1389 | DEFUN (ipv6_ospf6_advertise_prefix_list, |
| 1390 | ipv6_ospf6_advertise_prefix_list_cmd, |
| 1391 | "ipv6 ospf6 advertise prefix-list WORD", |
| 1392 | IP6_STR |
| 1393 | OSPF6_STR |
| 1394 | "Advertising options\n" |
| 1395 | "Filter prefix using prefix-list\n" |
| 1396 | "Prefix list name\n" |
| 1397 | ) |
| 1398 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1399 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1400 | struct interface *ifp; |
| 1401 | |
| 1402 | ifp = (struct interface *) vty->index; |
| 1403 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1404 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1405 | oi = (struct ospf6_interface *) ifp->info; |
| 1406 | if (oi == NULL) |
| 1407 | oi = ospf6_interface_create (ifp); |
| 1408 | assert (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1409 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1410 | if (oi->plist_name) |
| 1411 | XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name); |
| 1412 | oi->plist_name = XSTRDUP (MTYPE_PREFIX_LIST_STR, argv[0]); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1413 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1414 | ospf6_interface_connected_route_update (oi->interface); |
| 1415 | OSPF6_LINK_LSA_SCHEDULE (oi); |
| 1416 | if (oi->state == OSPF6_INTERFACE_DR) |
| 1417 | { |
| 1418 | OSPF6_NETWORK_LSA_SCHEDULE (oi); |
| 1419 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi); |
| 1420 | } |
| 1421 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1422 | |
| 1423 | return CMD_SUCCESS; |
| 1424 | } |
| 1425 | |
| 1426 | DEFUN (no_ipv6_ospf6_advertise_prefix_list, |
| 1427 | no_ipv6_ospf6_advertise_prefix_list_cmd, |
| 1428 | "no ipv6 ospf6 advertise prefix-list", |
| 1429 | NO_STR |
| 1430 | IP6_STR |
| 1431 | OSPF6_STR |
| 1432 | "Advertising options\n" |
| 1433 | "Filter prefix using prefix-list\n" |
| 1434 | ) |
| 1435 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1436 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1437 | struct interface *ifp; |
| 1438 | |
| 1439 | ifp = (struct interface *) vty->index; |
| 1440 | assert (ifp); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1441 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1442 | oi = (struct ospf6_interface *) ifp->info; |
| 1443 | if (oi == NULL) |
| 1444 | oi = ospf6_interface_create (ifp); |
| 1445 | assert (oi); |
| 1446 | |
| 1447 | if (oi->plist_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1448 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1449 | XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name); |
| 1450 | oi->plist_name = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1451 | } |
| 1452 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1453 | ospf6_interface_connected_route_update (oi->interface); |
| 1454 | OSPF6_LINK_LSA_SCHEDULE (oi); |
| 1455 | if (oi->state == OSPF6_INTERFACE_DR) |
| 1456 | { |
| 1457 | OSPF6_NETWORK_LSA_SCHEDULE (oi); |
| 1458 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi); |
| 1459 | } |
| 1460 | OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1461 | |
| 1462 | return CMD_SUCCESS; |
| 1463 | } |
| 1464 | |
| 1465 | int |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1466 | config_write_ospf6_interface (struct vty *vty) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1467 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1468 | struct listnode *i; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1469 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1470 | struct interface *ifp; |
| 1471 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1472 | for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1473 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1474 | oi = (struct ospf6_interface *) ifp->info; |
| 1475 | if (oi == NULL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1476 | continue; |
| 1477 | |
| 1478 | vty_out (vty, "interface %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1479 | oi->interface->name, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1480 | |
| 1481 | if (ifp->desc) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1482 | vty_out (vty, " description %s%s", ifp->desc, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1483 | |
hasso | 1203e1c | 2004-07-23 21:34:27 +0000 | [diff] [blame] | 1484 | if (ifp->mtu6 != oi->ifmtu) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1485 | vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->ifmtu, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1486 | vty_out (vty, " ipv6 ospf6 cost %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1487 | oi->cost, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1488 | vty_out (vty, " ipv6 ospf6 hello-interval %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1489 | oi->hello_interval, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1490 | vty_out (vty, " ipv6 ospf6 dead-interval %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1491 | oi->dead_interval, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1492 | vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1493 | oi->rxmt_interval, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1494 | vty_out (vty, " ipv6 ospf6 priority %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1495 | oi->priority, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1496 | vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1497 | oi->transdelay, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1498 | vty_out (vty, " ipv6 ospf6 instance-id %d%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1499 | oi->instance_id, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1500 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1501 | if (oi->plist_name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1502 | vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1503 | oi->plist_name, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1504 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1505 | if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1506 | vty_out (vty, " ipv6 ospf6 passive%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1507 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1508 | vty_out (vty, "!%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1509 | } |
| 1510 | return 0; |
| 1511 | } |
| 1512 | |
| 1513 | struct cmd_node interface_node = |
| 1514 | { |
| 1515 | INTERFACE_NODE, |
| 1516 | "%s(config-if)# ", |
hasso | 69b4a81 | 2004-08-26 18:10:36 +0000 | [diff] [blame] | 1517 | 1 /* VTYSH */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1518 | }; |
| 1519 | |
| 1520 | void |
| 1521 | ospf6_interface_init () |
| 1522 | { |
| 1523 | /* Install interface node. */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1524 | install_node (&interface_node, config_write_ospf6_interface); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1525 | |
| 1526 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1527 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_cmd); |
| 1528 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd); |
| 1529 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1530 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1531 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd); |
| 1532 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); |
| 1533 | install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1534 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1535 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_cmd); |
| 1536 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd); |
| 1537 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1538 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1539 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd); |
| 1540 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); |
| 1541 | install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1542 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1543 | install_element (CONFIG_NODE, &interface_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1544 | install_default (INTERFACE_NODE); |
| 1545 | install_element (INTERFACE_NODE, &interface_desc_cmd); |
| 1546 | install_element (INTERFACE_NODE, &no_interface_desc_cmd); |
| 1547 | install_element (INTERFACE_NODE, &ipv6_ospf6_cost_cmd); |
hasso | b596c71 | 2004-07-09 18:33:43 +0000 | [diff] [blame] | 1548 | install_element (INTERFACE_NODE, &ipv6_ospf6_ifmtu_cmd); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1549 | install_element (INTERFACE_NODE, &no_ipv6_ospf6_ifmtu_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1550 | install_element (INTERFACE_NODE, &ipv6_ospf6_deadinterval_cmd); |
| 1551 | install_element (INTERFACE_NODE, &ipv6_ospf6_hellointerval_cmd); |
| 1552 | install_element (INTERFACE_NODE, &ipv6_ospf6_priority_cmd); |
| 1553 | install_element (INTERFACE_NODE, &ipv6_ospf6_retransmitinterval_cmd); |
| 1554 | install_element (INTERFACE_NODE, &ipv6_ospf6_transmitdelay_cmd); |
| 1555 | install_element (INTERFACE_NODE, &ipv6_ospf6_instance_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1556 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1557 | install_element (INTERFACE_NODE, &ipv6_ospf6_passive_cmd); |
| 1558 | install_element (INTERFACE_NODE, &no_ipv6_ospf6_passive_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1559 | |
| 1560 | install_element (INTERFACE_NODE, &ipv6_ospf6_advertise_prefix_list_cmd); |
| 1561 | install_element (INTERFACE_NODE, &no_ipv6_ospf6_advertise_prefix_list_cmd); |
| 1562 | } |
| 1563 | |
| 1564 | DEFUN (debug_ospf6_interface, |
| 1565 | debug_ospf6_interface_cmd, |
| 1566 | "debug ospf6 interface", |
| 1567 | DEBUG_STR |
| 1568 | OSPF6_STR |
| 1569 | "Debug OSPFv3 Interface\n" |
| 1570 | ) |
| 1571 | { |
| 1572 | OSPF6_DEBUG_INTERFACE_ON (); |
| 1573 | return CMD_SUCCESS; |
| 1574 | } |
| 1575 | |
| 1576 | DEFUN (no_debug_ospf6_interface, |
| 1577 | no_debug_ospf6_interface_cmd, |
| 1578 | "no debug ospf6 interface", |
| 1579 | NO_STR |
| 1580 | DEBUG_STR |
| 1581 | OSPF6_STR |
| 1582 | "Debug OSPFv3 Interface\n" |
| 1583 | ) |
| 1584 | { |
hasso | 3b68735 | 2004-08-19 06:56:53 +0000 | [diff] [blame] | 1585 | OSPF6_DEBUG_INTERFACE_OFF (); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1586 | return CMD_SUCCESS; |
| 1587 | } |
| 1588 | |
| 1589 | int |
| 1590 | config_write_ospf6_debug_interface (struct vty *vty) |
| 1591 | { |
| 1592 | if (IS_OSPF6_DEBUG_INTERFACE) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1593 | vty_out (vty, "debug ospf6 interface%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1594 | return 0; |
| 1595 | } |
| 1596 | |
| 1597 | void |
| 1598 | install_element_ospf6_debug_interface () |
| 1599 | { |
| 1600 | install_element (ENABLE_NODE, &debug_ospf6_interface_cmd); |
| 1601 | install_element (ENABLE_NODE, &no_debug_ospf6_interface_cmd); |
| 1602 | install_element (CONFIG_NODE, &debug_ospf6_interface_cmd); |
| 1603 | install_element (CONFIG_NODE, &no_debug_ospf6_interface_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1604 | } |
| 1605 | |
| 1606 | |