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