jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_circuit.h |
| 3 | * |
| 4 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 5 | * Tampere University of Technology |
| 6 | * Institute of Communications Engineering |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public Licenseas published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | #include <stdlib.h> |
| 23 | #include <stdio.h> |
| 24 | #include <ctype.h> |
| 25 | #include <zebra.h> |
hasso | 37da8c0 | 2004-05-19 11:38:40 +0000 | [diff] [blame] | 26 | #ifdef GNU_LINUX |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 27 | #include <net/ethernet.h> |
hasso | 37da8c0 | 2004-05-19 11:38:40 +0000 | [diff] [blame] | 28 | #else |
| 29 | #include <netinet/if_ether.h> |
| 30 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 31 | |
| 32 | #include "log.h" |
| 33 | #include "memory.h" |
| 34 | #include "if.h" |
| 35 | #include "linklist.h" |
| 36 | #include "command.h" |
| 37 | #include "thread.h" |
| 38 | #include "hash.h" |
| 39 | #include "prefix.h" |
| 40 | #include "stream.h" |
| 41 | |
| 42 | #include "isisd/dict.h" |
| 43 | #include "isisd/include-netbsd/iso.h" |
| 44 | #include "isisd/isis_constants.h" |
| 45 | #include "isisd/isis_common.h" |
| 46 | #include "isisd/isis_circuit.h" |
| 47 | #include "isisd/isis_tlv.h" |
| 48 | #include "isisd/isis_lsp.h" |
| 49 | #include "isisd/isis_pdu.h" |
| 50 | #include "isisd/isis_network.h" |
| 51 | #include "isisd/isis_misc.h" |
| 52 | #include "isisd/isis_constants.h" |
| 53 | #include "isisd/isis_adjacency.h" |
| 54 | #include "isisd/isis_dr.h" |
| 55 | #include "isisd/isis_flags.h" |
| 56 | #include "isisd/isisd.h" |
| 57 | #include "isisd/isis_csm.h" |
| 58 | #include "isisd/isis_events.h" |
| 59 | |
| 60 | extern struct thread_master *master; |
| 61 | extern struct isis *isis; |
| 62 | |
| 63 | struct isis_circuit * |
| 64 | isis_circuit_new () |
| 65 | { |
| 66 | struct isis_circuit *circuit; |
| 67 | int i; |
| 68 | |
| 69 | circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 70 | if (circuit) |
| 71 | { |
| 72 | memset (circuit, 0, sizeof (struct isis_circuit)); |
| 73 | /* set default metrics for circuit */ |
| 74 | for (i = 0; i < 2; i++) |
| 75 | { |
| 76 | circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 77 | circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED; |
| 78 | circuit->metrics[i].metric_error = METRICS_UNSUPPORTED; |
| 79 | circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED; |
| 80 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 81 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 82 | else |
| 83 | { |
| 84 | zlog_err ("Can't malloc isis circuit"); |
| 85 | return NULL; |
| 86 | } |
| 87 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 88 | return circuit; |
| 89 | } |
| 90 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 91 | void |
| 92 | isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area) |
| 93 | { |
| 94 | int i; |
| 95 | circuit->area = area; |
| 96 | /* |
| 97 | * The level for the circuit is same as for the area, unless configured |
| 98 | * otherwise. |
| 99 | */ |
| 100 | circuit->circuit_is_type = area->is_type; |
| 101 | /* |
| 102 | * Default values |
| 103 | */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 104 | for (i = 0; i < 2; i++) |
| 105 | { |
| 106 | circuit->hello_interval[i] = HELLO_INTERVAL; |
| 107 | circuit->hello_multiplier[i] = HELLO_MULTIPLIER; |
| 108 | circuit->csnp_interval[i] = CSNP_INTERVAL; |
| 109 | circuit->psnp_interval[i] = PSNP_INTERVAL; |
| 110 | circuit->u.bc.priority[i] = DEFAULT_PRIORITY; |
| 111 | } |
| 112 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| 113 | { |
| 114 | circuit->u.bc.adjdb[0] = list_new (); |
| 115 | circuit->u.bc.adjdb[1] = list_new (); |
| 116 | circuit->u.bc.pad_hellos = 1; |
| 117 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 118 | circuit->lsp_interval = LSP_INTERVAL; |
| 119 | |
| 120 | /* |
| 121 | * Add the circuit into area |
| 122 | */ |
| 123 | listnode_add (area->circuit_list, circuit); |
| 124 | |
| 125 | circuit->idx = flags_get_index (&area->flags); |
| 126 | circuit->lsp_queue = list_new (); |
| 127 | |
| 128 | return; |
| 129 | } |
| 130 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 131 | void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 132 | isis_circuit_deconfigure (struct isis_circuit *circuit, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 133 | struct isis_area *area) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 134 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 135 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 136 | /* Remove circuit from area */ |
| 137 | listnode_delete (area->circuit_list, circuit); |
| 138 | /* Free the index of SRM and SSN flags */ |
| 139 | flags_free_index (&area->flags, circuit->idx); |
| 140 | |
| 141 | return; |
| 142 | } |
| 143 | |
| 144 | struct isis_circuit * |
| 145 | circuit_lookup_by_ifp (struct interface *ifp, struct list *list) |
| 146 | { |
| 147 | struct isis_circuit *circuit = NULL; |
| 148 | struct listnode *node; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 149 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 150 | if (!list) |
| 151 | return NULL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 152 | |
| 153 | for (node = listhead (list); node; nextnode (node)) |
| 154 | { |
| 155 | circuit = getdata (node); |
| 156 | if (circuit->interface == ifp) |
| 157 | return circuit; |
| 158 | } |
| 159 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 160 | return NULL; |
| 161 | } |
| 162 | |
| 163 | struct isis_circuit * |
| 164 | circuit_scan_by_ifp (struct interface *ifp) |
| 165 | { |
| 166 | struct isis_area *area; |
| 167 | struct listnode *node; |
| 168 | struct isis_circuit *circuit; |
| 169 | |
| 170 | if (!isis->area_list) |
| 171 | return NULL; |
| 172 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 173 | for (node = listhead (isis->area_list); node; nextnode (node)) |
| 174 | { |
| 175 | area = getdata (node); |
| 176 | circuit = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 177 | if (circuit) |
| 178 | return circuit; |
| 179 | } |
| 180 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 181 | return circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 182 | } |
| 183 | |
| 184 | void |
| 185 | isis_circuit_del (struct isis_circuit *circuit) |
| 186 | { |
| 187 | |
| 188 | if (!circuit) |
| 189 | return; |
| 190 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 191 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| 192 | { |
| 193 | /* destroy adjacency databases */ |
| 194 | list_delete (circuit->u.bc.adjdb[0]); |
| 195 | list_delete (circuit->u.bc.adjdb[1]); |
| 196 | /* destroy neighbour lists */ |
| 197 | if (circuit->u.bc.lan_neighs[0]) |
| 198 | list_delete (circuit->u.bc.lan_neighs[0]); |
| 199 | if (circuit->u.bc.lan_neighs[1]) |
| 200 | list_delete (circuit->u.bc.lan_neighs[1]); |
| 201 | /* destroy addresses */ |
| 202 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 203 | if (circuit->ip_addrs) |
| 204 | list_delete (circuit->ip_addrs); |
| 205 | #ifdef HAVE_IPV6 |
| 206 | if (circuit->ipv6_link) |
| 207 | list_delete (circuit->ipv6_link); |
| 208 | if (circuit->ipv6_non_link) |
| 209 | list_delete (circuit->ipv6_non_link); |
| 210 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 211 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 212 | /* and lastly the circuit itself */ |
| 213 | XFREE (MTYPE_ISIS_CIRCUIT, circuit); |
| 214 | |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 219 | isis_circuit_add_addr (struct isis_circuit *circuit, struct connected *conn) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 220 | { |
| 221 | struct prefix_ipv4 *ipv4; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 222 | u_char buf[BUFSIZ]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 223 | #ifdef HAVE_IPV6 |
| 224 | struct prefix_ipv6 *ipv6; |
| 225 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 226 | if (!circuit->ip_addrs) |
| 227 | { |
| 228 | circuit->ip_addrs = list_new (); |
| 229 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 230 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 231 | if (!circuit->ipv6_link) |
| 232 | { |
| 233 | circuit->ipv6_link = list_new (); |
| 234 | } |
| 235 | if (!circuit->ipv6_non_link) |
| 236 | { |
| 237 | circuit->ipv6_non_link = list_new (); |
| 238 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 239 | #endif /* HAVE_IPV6 */ |
| 240 | |
| 241 | memset (&buf, 0, BUFSIZ); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 242 | if (conn->address->family == AF_INET) |
| 243 | { |
| 244 | ipv4 = prefix_ipv4_new (); |
| 245 | ipv4->prefixlen = conn->address->prefixlen; |
| 246 | ipv4->prefix = conn->address->u.prefix4; |
| 247 | listnode_add (circuit->ip_addrs, ipv4); |
| 248 | prefix2str (conn->address, buf, BUFSIZ); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 249 | #ifdef EXTREME_DEBUG |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 250 | zlog_info ("Added IP address %s to circuit %d", buf, |
| 251 | circuit->circuit_id); |
| 252 | #endif /* EXTREME_DEBUG */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 253 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 254 | #ifdef HAVE_IPV6 |
| 255 | if (conn->address->family == AF_INET6) |
| 256 | { |
| 257 | ipv6 = prefix_ipv6_new (); |
| 258 | ipv6->prefixlen = conn->address->prefixlen; |
| 259 | ipv6->prefix = conn->address->u.prefix6; |
| 260 | if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix)) |
| 261 | { |
| 262 | listnode_add (circuit->ipv6_link, ipv6); |
| 263 | } |
| 264 | else |
| 265 | { |
| 266 | listnode_add (circuit->ipv6_non_link, ipv6); |
| 267 | } |
| 268 | prefix2str (conn->address, buf, BUFSIZ); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 269 | #ifdef EXTREME_DEBUG |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 270 | zlog_info ("Added IPv6 address %s to circuit %d", buf, |
| 271 | circuit->circuit_id); |
| 272 | #endif /* EXTREME_DEBUG */ |
| 273 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 274 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 275 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 276 | |
| 277 | return; |
| 278 | } |
| 279 | |
| 280 | void |
| 281 | isis_circuit_del_addr (struct isis_circuit *circuit, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 282 | struct connected *connected) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 283 | { |
| 284 | |
| 285 | } |
| 286 | |
| 287 | void |
| 288 | isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp) |
| 289 | { |
| 290 | struct listnode *node; |
| 291 | struct connected *conn; |
| 292 | |
| 293 | circuit->interface = ifp; |
| 294 | ifp->info = circuit; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 295 | |
| 296 | circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 297 | |
| 298 | /* isis_circuit_update_addrs (circuit, ifp); */ |
| 299 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 300 | if (if_is_broadcast (ifp)) |
| 301 | { |
| 302 | circuit->circ_type = CIRCUIT_T_BROADCAST; |
| 303 | /* |
| 304 | * Get the Hardware Address |
| 305 | */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 306 | #ifdef HAVE_SOCKADDR_DL |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 307 | if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN) |
| 308 | zlog_warn ("unsupported link layer"); |
| 309 | else |
| 310 | memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), |
| 311 | ETH_ALEN); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 312 | #else |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 313 | if (circuit->interface->hw_addr_len != ETH_ALEN) |
| 314 | { |
| 315 | zlog_warn ("unsupported link layer"); |
| 316 | } |
| 317 | else |
| 318 | { |
| 319 | memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN); |
| 320 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 321 | #ifdef EXTREME_DEGUG |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 322 | zlog_info ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s", |
| 323 | circuit->interface->ifindex, ISO_MTU (circuit), |
| 324 | snpa_print (circuit->u.bc.snpa)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 325 | |
| 326 | #endif /* EXTREME_DEBUG */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 327 | #endif /* HAVE_SOCKADDR_DL */ |
| 328 | } |
| 329 | else if (if_is_pointopoint (ifp)) |
| 330 | { |
| 331 | circuit->circ_type = CIRCUIT_T_P2P; |
| 332 | } |
| 333 | else |
| 334 | { |
| 335 | zlog_warn ("isis_circuit_if_add: unsupported media"); |
| 336 | } |
| 337 | |
| 338 | for (node = ifp->connected ? listhead (ifp->connected) : NULL; node; |
| 339 | nextnode (node)) |
| 340 | { |
| 341 | conn = getdata (node); |
| 342 | isis_circuit_add_addr (circuit, conn); |
| 343 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 344 | |
| 345 | return; |
| 346 | } |
| 347 | |
| 348 | void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 349 | isis_circuit_update_params (struct isis_circuit *circuit, |
| 350 | struct interface *ifp) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 351 | { |
| 352 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 353 | |
| 354 | if (circuit->circuit_id != ifp->ifindex) |
| 355 | { |
| 356 | zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id, |
| 357 | ifp->ifindex); |
| 358 | circuit->circuit_id = ifp->ifindex % 255; |
| 359 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 360 | |
| 361 | /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */ |
| 362 | /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig) |
| 363 | The areas MTU is the minimum of mtu's of circuits in the area |
| 364 | now we can't catch the change |
| 365 | if (circuit->mtu != ifp->mtu) { |
| 366 | zlog_warn ("changing circuit mtu %d->%d", circuit->mtu, |
| 367 | ifp->mtu); |
| 368 | circuit->mtu = ifp->mtu; |
| 369 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 370 | */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 371 | /* |
| 372 | * Get the Hardware Address |
| 373 | */ |
| 374 | #ifdef HAVE_SOCKADDR_DL |
| 375 | if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 376 | zlog_warn ("unsupported link layer"); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 377 | else |
| 378 | memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN); |
| 379 | #else |
| 380 | if (circuit->interface->hw_addr_len != ETH_ALEN) |
| 381 | { |
| 382 | zlog_warn ("unsupported link layer"); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 383 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 384 | else |
| 385 | { |
| 386 | if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN)) |
| 387 | { |
| 388 | zlog_warn ("changing circuit snpa %s->%s", |
| 389 | snpa_print (circuit->u.bc.snpa), |
| 390 | snpa_print (circuit->interface->hw_addr)); |
| 391 | } |
| 392 | } |
| 393 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 394 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 395 | if (if_is_broadcast (ifp)) |
| 396 | { |
| 397 | circuit->circ_type = CIRCUIT_T_BROADCAST; |
| 398 | } |
| 399 | else if (if_is_pointopoint (ifp)) |
| 400 | { |
| 401 | circuit->circ_type = CIRCUIT_T_P2P; |
| 402 | } |
| 403 | else |
| 404 | { |
| 405 | zlog_warn ("isis_circuit_update_params: unsupported media"); |
| 406 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 407 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 408 | return; |
| 409 | } |
| 410 | |
| 411 | void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 412 | isis_circuit_if_del (struct isis_circuit *circuit) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 413 | { |
| 414 | circuit->interface->info = NULL; |
| 415 | circuit->interface = NULL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 416 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 417 | return; |
| 418 | } |
| 419 | |
| 420 | void |
| 421 | isis_circuit_up (struct isis_circuit *circuit) |
| 422 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 423 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 424 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| 425 | { |
| 426 | if (circuit->area->min_bcast_mtu == 0 || |
| 427 | ISO_MTU (circuit) < circuit->area->min_bcast_mtu) |
| 428 | circuit->area->min_bcast_mtu = ISO_MTU (circuit); |
| 429 | /* |
| 430 | * ISO 10589 - 8.4.1 Enabling of broadcast circuits |
| 431 | */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 432 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 433 | /* initilizing the hello sending threads |
| 434 | * for a broadcast IF |
| 435 | */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 436 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 437 | /* 8.4.1 a) commence sending of IIH PDUs */ |
| 438 | |
| 439 | if (circuit->circuit_is_type & IS_LEVEL_1) |
| 440 | { |
| 441 | thread_add_event (master, send_lan_l1_hello, circuit, 0); |
| 442 | circuit->u.bc.lan_neighs[0] = list_new (); |
| 443 | } |
| 444 | |
| 445 | if (circuit->circuit_is_type & IS_LEVEL_2) |
| 446 | { |
| 447 | thread_add_event (master, send_lan_l2_hello, circuit, 0); |
| 448 | circuit->u.bc.lan_neighs[1] = list_new (); |
| 449 | } |
| 450 | |
| 451 | /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */ |
| 452 | /* 8.4.1 c) FIXME: listen for ESH PDUs */ |
| 453 | |
| 454 | /* 8.4.1 d) */ |
| 455 | /* dr election will commence in... */ |
| 456 | if (circuit->circuit_is_type & IS_LEVEL_1) |
| 457 | THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1, |
| 458 | circuit, |
| 459 | 2 * circuit->hello_multiplier[0] * |
| 460 | circuit->hello_interval[0]); |
| 461 | if (circuit->circuit_is_type & IS_LEVEL_2) |
| 462 | THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2, |
| 463 | circuit, |
| 464 | 2 * circuit->hello_multiplier[1] * |
| 465 | circuit->hello_interval[1]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 466 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 467 | else |
| 468 | { |
| 469 | /* initializing the hello send threads |
| 470 | * for a ptp IF |
| 471 | */ |
| 472 | thread_add_event (master, send_p2p_hello, circuit, 0); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 473 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 474 | } |
| 475 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 476 | /* initializing PSNP timers */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 477 | if (circuit->circuit_is_type & IS_LEVEL_1) |
| 478 | { |
| 479 | THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit, |
| 480 | isis_jitter (circuit->psnp_interval[0], PSNP_JITTER)); |
| 481 | } |
| 482 | |
| 483 | if (circuit->circuit_is_type & IS_LEVEL_2) |
| 484 | { |
| 485 | THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit, |
| 486 | isis_jitter (circuit->psnp_interval[1], PSNP_JITTER)); |
| 487 | } |
| 488 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 489 | /* initialize the circuit streams */ |
| 490 | if (circuit->rcv_stream == NULL) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 491 | circuit->rcv_stream = stream_new (ISO_MTU (circuit)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 492 | |
| 493 | if (circuit->snd_stream == NULL) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 494 | circuit->snd_stream = stream_new (ISO_MTU (circuit)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 495 | |
| 496 | /* unified init for circuits */ |
| 497 | isis_sock_init (circuit); |
| 498 | |
| 499 | #ifdef GNU_LINUX |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 500 | THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit, |
| 501 | circuit->fd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 502 | #else |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 503 | THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit, |
| 504 | circuit->fd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 505 | #endif |
| 506 | return; |
| 507 | } |
| 508 | |
| 509 | void |
| 510 | isis_circuit_down (struct isis_circuit *circuit) |
| 511 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 512 | /* Cancel all active threads -- FIXME: wrong place */ |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 513 | /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 514 | THREAD_OFF (circuit->t_read); |
| 515 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| 516 | { |
| 517 | THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]); |
| 518 | THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]); |
| 519 | } |
| 520 | else if (circuit->circ_type == CIRCUIT_T_P2P) |
| 521 | { |
| 522 | THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello); |
| 523 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 524 | /* close the socket */ |
| 525 | close (circuit->fd); |
| 526 | |
| 527 | return; |
| 528 | } |
| 529 | |
| 530 | void |
| 531 | circuit_update_nlpids (struct isis_circuit *circuit) |
| 532 | { |
| 533 | circuit->nlpids.count = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 534 | |
| 535 | if (circuit->ip_router) |
| 536 | { |
| 537 | circuit->nlpids.nlpids[0] = NLPID_IP; |
| 538 | circuit->nlpids.count++; |
| 539 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 540 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 541 | if (circuit->ipv6_router) |
| 542 | { |
| 543 | circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6; |
| 544 | circuit->nlpids.count++; |
| 545 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 546 | #endif /* HAVE_IPV6 */ |
| 547 | return; |
| 548 | } |
| 549 | |
| 550 | int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 551 | isis_interface_config_write (struct vty *vty) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 552 | { |
| 553 | |
| 554 | int write = 0; |
| 555 | listnode node; |
| 556 | listnode node2; |
| 557 | listnode node3; |
| 558 | struct interface *ifp; |
| 559 | struct isis_area *area; |
| 560 | struct isis_circuit *c; |
| 561 | struct prefix_ipv4 *ip; |
| 562 | int i; |
| 563 | #ifdef HAVE_IPV6 |
| 564 | struct prefix_ipv6 *ipv6; |
| 565 | #endif /*HAVE_IPV6 */ |
| 566 | |
| 567 | char buf[BUFSIZ]; |
| 568 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 569 | LIST_LOOP (iflist, ifp, node) |
| 570 | { |
| 571 | /* IF name */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 572 | vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 573 | write++; |
| 574 | /* IF desc */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 575 | if (ifp->desc) |
| 576 | { |
| 577 | vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE); |
| 578 | write++; |
| 579 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 580 | /* ISIS Circuit */ |
| 581 | LIST_LOOP (isis->area_list, area, node2) |
| 582 | { |
| 583 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 584 | if (c) |
| 585 | { |
| 586 | if (c->ip_router) |
| 587 | { |
| 588 | vty_out (vty, " ip router isis %s%s", area->area_tag, |
| 589 | VTY_NEWLINE); |
| 590 | write++; |
| 591 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 592 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 593 | if (c->ipv6_router) |
| 594 | { |
| 595 | vty_out (vty, " ipv6 router isis %s%s", area->area_tag, |
| 596 | VTY_NEWLINE); |
| 597 | write++; |
| 598 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 599 | #endif /* HAVE_IPV6 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 600 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 601 | /* ISIS - circuit type */ |
| 602 | if (c->circuit_is_type == IS_LEVEL_1) |
| 603 | { |
| 604 | vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE); |
| 605 | write++; |
| 606 | } |
| 607 | else |
| 608 | { |
| 609 | if (c->circuit_is_type == IS_LEVEL_2) |
| 610 | { |
| 611 | vty_out (vty, " isis circuit-type level-2-only%s", |
| 612 | VTY_NEWLINE); |
| 613 | write++; |
| 614 | } |
| 615 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 616 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 617 | /* ISIS - CSNP interval - FIXME: compare to cisco */ |
| 618 | if (c->csnp_interval[0] == c->csnp_interval[1]) |
| 619 | { |
| 620 | if (c->csnp_interval[0] != CSNP_INTERVAL) |
| 621 | { |
| 622 | vty_out (vty, " isis csnp-interval %d%s", |
| 623 | c->csnp_interval[0], VTY_NEWLINE); |
| 624 | write++; |
| 625 | } |
| 626 | } |
| 627 | else |
| 628 | { |
| 629 | for (i = 0; i < 2; i++) |
| 630 | { |
| 631 | if (c->csnp_interval[1] != CSNP_INTERVAL) |
| 632 | { |
| 633 | vty_out (vty, " isis csnp-interval %d level-%d%s", |
| 634 | c->csnp_interval[1], i + 1, VTY_NEWLINE); |
| 635 | write++; |
| 636 | } |
| 637 | } |
| 638 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 639 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 640 | /* ISIS - Hello padding - Defaults to true so only display if false */ |
| 641 | if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos) |
| 642 | { |
| 643 | vty_out (vty, " no isis hello padding%s", VTY_NEWLINE); |
| 644 | write++; |
| 645 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 646 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 647 | /* ISIS - Hello interval - FIXME: compare to cisco */ |
| 648 | if (c->hello_interval[0] == c->hello_interval[1]) |
| 649 | { |
| 650 | if (c->hello_interval[0] != HELLO_INTERVAL) |
| 651 | { |
| 652 | vty_out (vty, " isis hello-interval %d%s", |
| 653 | c->hello_interval[0], VTY_NEWLINE); |
| 654 | write++; |
| 655 | } |
| 656 | } |
| 657 | else |
| 658 | { |
| 659 | for (i = 0; i < 2; i++) |
| 660 | { |
| 661 | if (c->hello_interval[i] != HELLO_INTERVAL) |
| 662 | { |
| 663 | if (c->hello_interval[i] == HELLO_MINIMAL) |
| 664 | { |
| 665 | vty_out (vty, |
| 666 | " isis hello-interval minimal level-%d%s", |
| 667 | i + 1, VTY_NEWLINE); |
| 668 | } |
| 669 | else |
| 670 | { |
| 671 | vty_out (vty, " isis hello-interval %d level-%d%s", |
| 672 | c->hello_interval[i], i + 1, VTY_NEWLINE); |
| 673 | } |
| 674 | write++; |
| 675 | } |
| 676 | } |
| 677 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 678 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 679 | /* ISIS - Hello Multiplier */ |
| 680 | if (c->hello_multiplier[0] == c->hello_multiplier[1]) |
| 681 | { |
| 682 | if (c->hello_multiplier[0] != HELLO_MULTIPLIER) |
| 683 | { |
| 684 | vty_out (vty, " isis hello-multiplier %d%s", |
| 685 | c->hello_multiplier[0], VTY_NEWLINE); |
| 686 | write++; |
| 687 | } |
| 688 | } |
| 689 | else |
| 690 | { |
| 691 | for (i = 0; i < 2; i++) |
| 692 | { |
| 693 | if (c->hello_multiplier[i] != HELLO_MULTIPLIER) |
| 694 | { |
| 695 | vty_out (vty, " isis hello-multiplier %d level-%d%s", |
| 696 | c->hello_multiplier[i], i + 1, VTY_NEWLINE); |
| 697 | write++; |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | /* ISIS - Priority */ |
| 702 | if (c->circ_type == CIRCUIT_T_BROADCAST) |
| 703 | { |
| 704 | if (c->u.bc.priority[0] == c->u.bc.priority[1]) |
| 705 | { |
| 706 | if (c->u.bc.priority[0] != DEFAULT_PRIORITY) |
| 707 | { |
| 708 | vty_out (vty, " isis priority %d%s", |
| 709 | c->u.bc.priority[0], VTY_NEWLINE); |
| 710 | write++; |
| 711 | } |
| 712 | } |
| 713 | else |
| 714 | { |
| 715 | for (i = 0; i < 2; i++) |
| 716 | { |
| 717 | if (c->u.bc.priority[i] != DEFAULT_PRIORITY) |
| 718 | { |
| 719 | vty_out (vty, " isis priority %d level-%d%s", |
| 720 | c->u.bc.priority[i], i + 1, VTY_NEWLINE); |
| 721 | write++; |
| 722 | } |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | /* ISIS - Metric */ |
| 727 | if (c->metrics[0].metric_default == c->metrics[1].metric_default) |
| 728 | { |
| 729 | if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS) |
| 730 | { |
| 731 | vty_out (vty, " isis metric %d%s", |
| 732 | c->metrics[0].metric_default, VTY_NEWLINE); |
| 733 | write++; |
| 734 | } |
| 735 | } |
| 736 | else |
| 737 | { |
| 738 | for (i = 0; i < 2; i++) |
| 739 | { |
| 740 | if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS) |
| 741 | { |
| 742 | vty_out (vty, " isis metric %d level-%d%s", |
| 743 | c->metrics[i].metric_default, i + 1, |
| 744 | VTY_NEWLINE); |
| 745 | write++; |
| 746 | } |
| 747 | } |
| 748 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 749 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 750 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 751 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 752 | vty_out (vty, "!%s", VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 753 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 754 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 755 | return write; |
| 756 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 757 | |
| 758 | DEFUN (ip_router_isis, |
| 759 | ip_router_isis_cmd, |
| 760 | "ip router isis WORD", |
| 761 | "Interface Internet Protocol config commands\n" |
| 762 | "IP router interface commands\n" |
| 763 | "IS-IS Routing for IP\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 764 | "Routing process tag\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 765 | { |
| 766 | struct isis_circuit *c; |
| 767 | struct interface *ifp; |
| 768 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 769 | |
| 770 | ifp = (struct interface *) vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 771 | assert (ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 772 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 773 | area = isis_area_lookup (argv[0]); |
| 774 | |
| 775 | /* Prevent more than one circuit per interface */ |
| 776 | if (area) |
| 777 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 778 | else |
| 779 | c = NULL; |
| 780 | if (c && (ifp->info != NULL)) |
| 781 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 782 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 783 | if (c->ipv6_router == 0) |
| 784 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 785 | #endif /* HAVE_IPV6 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 786 | vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); |
| 787 | return CMD_WARNING; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 788 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 789 | } |
| 790 | #endif /* HAVE_IPV6 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 791 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 792 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 793 | /* this is here for ciscopability */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 794 | if (!area) |
| 795 | { |
| 796 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 797 | return CMD_WARNING; |
| 798 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 799 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 800 | if (!c) |
| 801 | { |
| 802 | c = circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 803 | c = isis_csm_state_change (ISIS_ENABLE, c, area); |
| 804 | c->interface = ifp; /* this is automatic */ |
| 805 | ifp->info = c; /* hardly related to the FSM */ |
| 806 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 807 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 808 | if (!c) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 809 | return CMD_WARNING; |
| 810 | |
| 811 | c->ip_router = 1; |
| 812 | area->ip_circuits++; |
| 813 | circuit_update_nlpids (c); |
| 814 | |
| 815 | vty->node = INTERFACE_NODE; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 816 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 817 | return CMD_SUCCESS; |
| 818 | } |
| 819 | |
| 820 | DEFUN (no_ip_router_isis, |
| 821 | no_ip_router_isis_cmd, |
| 822 | "no ip router isis WORD", |
| 823 | NO_STR |
| 824 | "Interface Internet Protocol config commands\n" |
| 825 | "IP router interface commands\n" |
| 826 | "IS-IS Routing for IP\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 827 | "Routing process tag\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 828 | { |
| 829 | struct isis_circuit *circuit = NULL; |
| 830 | struct interface *ifp; |
| 831 | struct isis_area *area; |
| 832 | struct listnode *node; |
| 833 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 834 | ifp = (struct interface *) vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 835 | assert (ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 836 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 837 | area = isis_area_lookup (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 838 | if (!area) |
| 839 | { |
| 840 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 841 | return CMD_WARNING; |
| 842 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 843 | LIST_LOOP (area->circuit_list, circuit, node) |
| 844 | if (circuit->interface == ifp) |
| 845 | break; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 846 | if (!circuit) |
| 847 | { |
| 848 | vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE); |
| 849 | return CMD_WARNING; |
| 850 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 851 | circuit->ip_router = 0; |
| 852 | area->ip_circuits--; |
| 853 | #ifdef HAVE_IPV6 |
| 854 | if (circuit->ipv6_router == 0) |
| 855 | #endif |
| 856 | isis_csm_state_change (ISIS_DISABLE, circuit, area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 857 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 858 | return CMD_SUCCESS; |
| 859 | } |
| 860 | |
| 861 | DEFUN (isis_circuit_type, |
| 862 | isis_circuit_type_cmd, |
| 863 | "isis circuit-type (level-1|level-1-2|level-2-only)", |
| 864 | "IS-IS commands\n" |
| 865 | "Configure circuit type for interface\n" |
| 866 | "Level-1 only adjacencies are formed\n" |
| 867 | "Level-1-2 adjacencies are formed\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 868 | "Level-2 only adjacencies are formed\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 869 | { |
| 870 | struct isis_circuit *circuit; |
| 871 | struct interface *ifp; |
| 872 | int circuit_t; |
| 873 | int is_type; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 874 | |
| 875 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 876 | circuit = ifp->info; |
| 877 | /* UGLY - will remove l8r */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 878 | if (circuit == NULL) |
| 879 | { |
| 880 | return CMD_WARNING; |
| 881 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 882 | |
hasso | 13c48f7 | 2004-09-10 21:19:13 +0000 | [diff] [blame^] | 883 | /* XXX what to do when ip_router_isis is not executed */ |
| 884 | if (circuit->area == NULL) |
| 885 | return CMD_WARNING; |
| 886 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 887 | assert (circuit); |
| 888 | |
| 889 | circuit_t = string2circuit_t (argv[0]); |
| 890 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 891 | if (!circuit_t) |
| 892 | { |
| 893 | vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE); |
| 894 | return CMD_SUCCESS; |
| 895 | } |
| 896 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 897 | is_type = circuit->area->is_type; |
| 898 | if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 899 | isis_event_circuit_type_change (circuit, circuit_t); |
| 900 | else |
| 901 | { |
| 902 | vty_out (vty, "invalid circuit level for area %s.%s", |
| 903 | circuit->area->area_tag, VTY_NEWLINE); |
| 904 | } |
| 905 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 906 | return CMD_SUCCESS; |
| 907 | } |
| 908 | |
| 909 | DEFUN (no_isis_circuit_type, |
| 910 | no_isis_circuit_type_cmd, |
| 911 | "no isis circuit-type (level-1|level-1-2|level-2-only)", |
| 912 | NO_STR |
| 913 | "IS-IS commands\n" |
| 914 | "Configure circuit type for interface\n" |
| 915 | "Level-1 only adjacencies are formed\n" |
| 916 | "Level-1-2 adjacencies are formed\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 917 | "Level-2 only adjacencies are formed\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 918 | { |
| 919 | struct isis_circuit *circuit; |
| 920 | struct interface *ifp; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 921 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 922 | ifp = vty->index; |
| 923 | circuit = ifp->info; |
| 924 | if (circuit == NULL) |
| 925 | { |
| 926 | return CMD_WARNING; |
| 927 | } |
| 928 | |
| 929 | assert (circuit); |
| 930 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 931 | /* |
| 932 | * Set the circuits level to its default value which is that of the area |
| 933 | */ |
| 934 | isis_event_circuit_type_change (circuit, circuit->area->is_type); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 935 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 936 | return CMD_SUCCESS; |
| 937 | } |
| 938 | |
| 939 | DEFUN (isis_passwd, |
| 940 | isis_passwd_cmd, |
| 941 | "isis password WORD", |
| 942 | "IS-IS commands\n" |
| 943 | "Configure the authentication password for interface\n" |
| 944 | "Password\n") |
| 945 | { |
| 946 | struct isis_circuit *circuit; |
| 947 | struct interface *ifp; |
| 948 | int len; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 949 | |
| 950 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 951 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 952 | if (circuit == NULL) |
| 953 | { |
| 954 | return CMD_WARNING; |
| 955 | } |
| 956 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 957 | len = strlen (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 958 | if (len > 254) |
| 959 | { |
| 960 | vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE); |
| 961 | return CMD_WARNING; |
| 962 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 963 | circuit->passwd.len = len; |
| 964 | circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT; |
| 965 | strncpy (circuit->passwd.passwd, argv[0], 255); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 966 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 967 | return CMD_SUCCESS; |
| 968 | } |
| 969 | |
| 970 | DEFUN (no_isis_passwd, |
| 971 | no_isis_passwd_cmd, |
| 972 | "no isis password", |
| 973 | NO_STR |
| 974 | "IS-IS commands\n" |
| 975 | "Configure the authentication password for interface\n") |
| 976 | { |
| 977 | struct isis_circuit *circuit; |
| 978 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 979 | |
| 980 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 981 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 982 | if (circuit == NULL) |
| 983 | { |
| 984 | return CMD_WARNING; |
| 985 | } |
| 986 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 987 | memset (&circuit->passwd, 0, sizeof (struct isis_passwd)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 988 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 989 | return CMD_SUCCESS; |
| 990 | } |
| 991 | |
| 992 | |
| 993 | DEFUN (isis_priority, |
| 994 | isis_priority_cmd, |
| 995 | "isis priority <0-127>", |
| 996 | "IS-IS commands\n" |
| 997 | "Set priority for Designated Router election\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 998 | "Priority value\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 999 | { |
| 1000 | struct isis_circuit *circuit; |
| 1001 | struct interface *ifp; |
| 1002 | int prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1003 | |
| 1004 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1005 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1006 | if (circuit == NULL) |
| 1007 | { |
| 1008 | return CMD_WARNING; |
| 1009 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1010 | assert (circuit); |
| 1011 | |
| 1012 | prio = atoi (argv[0]); |
| 1013 | |
| 1014 | circuit->u.bc.priority[0] = prio; |
| 1015 | circuit->u.bc.priority[1] = prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1016 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1017 | return CMD_SUCCESS; |
| 1018 | } |
| 1019 | |
| 1020 | DEFUN (no_isis_priority, |
| 1021 | no_isis_priority_cmd, |
| 1022 | "no isis priority", |
| 1023 | NO_STR |
| 1024 | "IS-IS commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1025 | "Set priority for Designated Router election\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1026 | { |
| 1027 | struct isis_circuit *circuit; |
| 1028 | struct interface *ifp; |
| 1029 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1030 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1031 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1032 | if (circuit == NULL) |
| 1033 | { |
| 1034 | return CMD_WARNING; |
| 1035 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1036 | assert (circuit); |
| 1037 | |
| 1038 | circuit->u.bc.priority[0] = DEFAULT_PRIORITY; |
| 1039 | circuit->u.bc.priority[1] = DEFAULT_PRIORITY; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1040 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1041 | return CMD_SUCCESS; |
| 1042 | } |
| 1043 | |
| 1044 | ALIAS (no_isis_priority, |
| 1045 | no_isis_priority_arg_cmd, |
| 1046 | "no isis priority <0-127>", |
| 1047 | NO_STR |
| 1048 | "IS-IS commands\n" |
| 1049 | "Set priority for Designated Router election\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1050 | "Priority value\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1051 | |
| 1052 | DEFUN (isis_priority_l1, |
| 1053 | isis_priority_l1_cmd, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1054 | "isis priority <0-127> level-1", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1055 | "IS-IS commands\n" |
| 1056 | "Set priority for Designated Router election\n" |
| 1057 | "Priority value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1058 | "Specify priority for level-1 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1059 | { |
| 1060 | struct isis_circuit *circuit; |
| 1061 | struct interface *ifp; |
| 1062 | int prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1063 | |
| 1064 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1065 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1066 | if (circuit == NULL) |
| 1067 | { |
| 1068 | return CMD_WARNING; |
| 1069 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1070 | assert (circuit); |
| 1071 | |
| 1072 | prio = atoi (argv[0]); |
| 1073 | |
| 1074 | circuit->u.bc.priority[0] = prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1075 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1076 | return CMD_SUCCESS; |
| 1077 | } |
| 1078 | |
| 1079 | DEFUN (no_isis_priority_l1, |
| 1080 | no_isis_priority_l1_cmd, |
| 1081 | "no isis priority level-1", |
| 1082 | NO_STR |
| 1083 | "IS-IS commands\n" |
| 1084 | "Set priority for Designated Router election\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1085 | "Specify priority for level-1 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1086 | { |
| 1087 | struct isis_circuit *circuit; |
| 1088 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1089 | |
| 1090 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1091 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1092 | if (circuit == NULL) |
| 1093 | { |
| 1094 | return CMD_WARNING; |
| 1095 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1096 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1097 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1098 | circuit->u.bc.priority[0] = DEFAULT_PRIORITY; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1099 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1100 | return CMD_SUCCESS; |
| 1101 | } |
| 1102 | |
| 1103 | ALIAS (no_isis_priority_l1, |
| 1104 | no_isis_priority_l1_arg_cmd, |
| 1105 | "no isis priority <0-127> level-1", |
| 1106 | NO_STR |
| 1107 | "IS-IS commands\n" |
| 1108 | "Set priority for Designated Router election\n" |
| 1109 | "Priority value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1110 | "Specify priority for level-1 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1111 | |
| 1112 | DEFUN (isis_priority_l2, |
| 1113 | isis_priority_l2_cmd, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1114 | "isis priority <0-127> level-2", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1115 | "IS-IS commands\n" |
| 1116 | "Set priority for Designated Router election\n" |
| 1117 | "Priority value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1118 | "Specify priority for level-2 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1119 | { |
| 1120 | struct isis_circuit *circuit; |
| 1121 | struct interface *ifp; |
| 1122 | int prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1123 | |
| 1124 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1125 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1126 | if (circuit == NULL) |
| 1127 | { |
| 1128 | return CMD_WARNING; |
| 1129 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1130 | assert (circuit); |
| 1131 | |
| 1132 | prio = atoi (argv[0]); |
| 1133 | |
| 1134 | circuit->u.bc.priority[1] = prio; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1135 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1136 | return CMD_SUCCESS; |
| 1137 | } |
| 1138 | |
| 1139 | DEFUN (no_isis_priority_l2, |
| 1140 | no_isis_priority_l2_cmd, |
| 1141 | "no isis priority level-2", |
| 1142 | NO_STR |
| 1143 | "IS-IS commands\n" |
| 1144 | "Set priority for Designated Router election\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1145 | "Specify priority for level-2 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1146 | { |
| 1147 | struct isis_circuit *circuit; |
| 1148 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1149 | |
| 1150 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1151 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1152 | if (circuit == NULL) |
| 1153 | { |
| 1154 | return CMD_WARNING; |
| 1155 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1156 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1157 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1158 | circuit->u.bc.priority[1] = DEFAULT_PRIORITY; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1159 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1160 | return CMD_SUCCESS; |
| 1161 | } |
| 1162 | |
| 1163 | ALIAS (no_isis_priority_l2, |
| 1164 | no_isis_priority_l2_arg_cmd, |
| 1165 | "no isis priority <0-127> level-2", |
| 1166 | NO_STR |
| 1167 | "IS-IS commands\n" |
| 1168 | "Set priority for Designated Router election\n" |
| 1169 | "Priority value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1170 | "Specify priority for level-2 routing\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1171 | |
| 1172 | /* Metric command */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1173 | DEFUN (isis_metric, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1174 | isis_metric_cmd, |
| 1175 | "isis metric <0-63>", |
| 1176 | "IS-IS commands\n" |
| 1177 | "Set default metric for circuit\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1178 | "Default metric value\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1179 | { |
| 1180 | struct isis_circuit *circuit; |
| 1181 | struct interface *ifp; |
| 1182 | int met; |
| 1183 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1184 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1185 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1186 | if (circuit == NULL) |
| 1187 | { |
| 1188 | return CMD_WARNING; |
| 1189 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1190 | assert (circuit); |
| 1191 | |
| 1192 | met = atoi (argv[0]); |
| 1193 | |
| 1194 | circuit->metrics[0].metric_default = met; |
| 1195 | circuit->metrics[1].metric_default = met; |
| 1196 | |
| 1197 | return CMD_SUCCESS; |
| 1198 | } |
| 1199 | |
| 1200 | DEFUN (no_isis_metric, |
| 1201 | no_isis_metric_cmd, |
| 1202 | "no isis metric", |
| 1203 | NO_STR |
| 1204 | "IS-IS commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1205 | "Set default metric for circuit\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1206 | { |
| 1207 | struct isis_circuit *circuit; |
| 1208 | struct interface *ifp; |
| 1209 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1210 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1211 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1212 | if (circuit == NULL) |
| 1213 | { |
| 1214 | return CMD_WARNING; |
| 1215 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1216 | assert (circuit); |
| 1217 | |
| 1218 | circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 1219 | circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 1220 | |
| 1221 | return CMD_SUCCESS; |
| 1222 | } |
| 1223 | |
| 1224 | ALIAS (no_isis_metric, |
| 1225 | no_isis_metric_arg_cmd, |
| 1226 | "no isis metric <0-127>", |
| 1227 | NO_STR |
| 1228 | "IS-IS commands\n" |
| 1229 | "Set default metric for circuit\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1230 | "Default metric value\n") |
| 1231 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1232 | /* end of metrics */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1233 | DEFUN (isis_hello_interval, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1234 | isis_hello_interval_cmd, |
| 1235 | "isis hello-interval (<1-65535>|minimal)", |
| 1236 | "IS-IS commands\n" |
| 1237 | "Set Hello interval\n" |
| 1238 | "Hello interval value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1239 | "Holdtime 1 seconds, interval depends on multiplier\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1240 | { |
| 1241 | struct isis_circuit *circuit; |
| 1242 | struct interface *ifp; |
| 1243 | int interval; |
| 1244 | char c; |
| 1245 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1246 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1247 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1248 | if (circuit == NULL) |
| 1249 | { |
| 1250 | return CMD_WARNING; |
| 1251 | } |
| 1252 | assert (circuit); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1253 | c = *argv[0]; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1254 | if (isdigit ((int) c)) |
| 1255 | { |
| 1256 | interval = atoi (argv[0]); |
| 1257 | } |
| 1258 | else |
| 1259 | interval = HELLO_MINIMAL; /* FIXME: should be calculated */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1260 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1261 | circuit->hello_interval[0] = (u_int16_t) interval; |
| 1262 | circuit->hello_interval[1] = (u_int16_t) interval; |
| 1263 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1264 | return CMD_SUCCESS; |
| 1265 | } |
| 1266 | |
| 1267 | DEFUN (no_isis_hello_interval, |
| 1268 | no_isis_hello_interval_cmd, |
| 1269 | "no isis hello-interval", |
| 1270 | NO_STR |
| 1271 | "IS-IS commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1272 | "Set Hello interval\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1273 | { |
| 1274 | struct isis_circuit *circuit; |
| 1275 | struct interface *ifp; |
| 1276 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1277 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1278 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1279 | if (circuit == NULL) |
| 1280 | { |
| 1281 | return CMD_WARNING; |
| 1282 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1283 | assert (circuit); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1284 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1285 | |
| 1286 | circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1287 | circuit->hello_interval[1] = HELLO_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1288 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1289 | return CMD_SUCCESS; |
| 1290 | } |
| 1291 | |
| 1292 | ALIAS (no_isis_hello_interval, |
| 1293 | no_isis_hello_interval_arg_cmd, |
| 1294 | "no isis hello-interval (<1-65535>|minimal)", |
| 1295 | NO_STR |
| 1296 | "IS-IS commands\n" |
| 1297 | "Set Hello interval\n" |
| 1298 | "Hello interval value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1299 | "Holdtime 1 second, interval depends on multiplier\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1300 | |
| 1301 | DEFUN (isis_hello_interval_l1, |
| 1302 | isis_hello_interval_l1_cmd, |
| 1303 | "isis hello-interval (<1-65535>|minimal) level-1", |
| 1304 | "IS-IS commands\n" |
| 1305 | "Set Hello interval\n" |
| 1306 | "Hello interval value\n" |
| 1307 | "Holdtime 1 second, interval depends on multiplier\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1308 | "Specify hello-interval for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1309 | { |
| 1310 | struct isis_circuit *circuit; |
| 1311 | struct interface *ifp; |
| 1312 | long interval; |
| 1313 | char c; |
| 1314 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1315 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1316 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1317 | if (circuit == NULL) |
| 1318 | { |
| 1319 | return CMD_WARNING; |
| 1320 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1321 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1322 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1323 | c = *argv[0]; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1324 | if (isdigit ((int) c)) |
| 1325 | { |
| 1326 | interval = atoi (argv[0]); |
| 1327 | } |
| 1328 | else |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1329 | interval = HELLO_MINIMAL; |
| 1330 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1331 | circuit->hello_interval[0] = (u_int16_t) interval; |
| 1332 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1333 | return CMD_SUCCESS; |
| 1334 | } |
| 1335 | |
| 1336 | DEFUN (no_isis_hello_interval_l1, |
| 1337 | no_isis_hello_interval_l1_cmd, |
| 1338 | "no isis hello-interval level-1", |
| 1339 | NO_STR |
| 1340 | "IS-IS commands\n" |
| 1341 | "Set Hello interval\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1342 | "Specify hello-interval for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1343 | { |
| 1344 | struct isis_circuit *circuit; |
| 1345 | struct interface *ifp; |
| 1346 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1347 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1348 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1349 | if (circuit == NULL) |
| 1350 | { |
| 1351 | return CMD_WARNING; |
| 1352 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1353 | assert (circuit); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1354 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1355 | |
| 1356 | circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */ |
| 1357 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1358 | return CMD_SUCCESS; |
| 1359 | } |
| 1360 | |
| 1361 | ALIAS (no_isis_hello_interval_l1, |
| 1362 | no_isis_hello_interval_l1_arg_cmd, |
| 1363 | "no isis hello-interval (<1-65535>|minimal) level-1", |
| 1364 | NO_STR |
| 1365 | "IS-IS commands\n" |
| 1366 | "Set Hello interval\n" |
| 1367 | "Hello interval value\n" |
| 1368 | "Holdtime 1 second, interval depends on multiplier\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1369 | "Specify hello-interval for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1370 | |
| 1371 | DEFUN (isis_hello_interval_l2, |
| 1372 | isis_hello_interval_l2_cmd, |
| 1373 | "isis hello-interval (<1-65535>|minimal) level-2", |
| 1374 | "IS-IS commands\n" |
| 1375 | "Set Hello interval\n" |
| 1376 | "Hello interval value\n" |
| 1377 | "Holdtime 1 second, interval depends on multiplier\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1378 | "Specify hello-interval for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1379 | { |
| 1380 | struct isis_circuit *circuit; |
| 1381 | struct interface *ifp; |
| 1382 | long interval; |
| 1383 | char c; |
| 1384 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1385 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1386 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1387 | if (circuit == NULL) |
| 1388 | { |
| 1389 | return CMD_WARNING; |
| 1390 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1391 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1392 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1393 | c = *argv[0]; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1394 | if (isdigit ((int) c)) |
| 1395 | { |
| 1396 | interval = atoi (argv[0]); |
| 1397 | } |
| 1398 | else |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1399 | interval = HELLO_MINIMAL; |
| 1400 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1401 | circuit->hello_interval[1] = (u_int16_t) interval; |
| 1402 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1403 | return CMD_SUCCESS; |
| 1404 | } |
| 1405 | |
| 1406 | DEFUN (no_isis_hello_interval_l2, |
| 1407 | no_isis_hello_interval_l2_cmd, |
| 1408 | "no isis hello-interval level-2", |
| 1409 | NO_STR |
| 1410 | "IS-IS commands\n" |
| 1411 | "Set Hello interval\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1412 | "Specify hello-interval for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1413 | { |
| 1414 | struct isis_circuit *circuit; |
| 1415 | struct interface *ifp; |
| 1416 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1417 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1418 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1419 | if (circuit == NULL) |
| 1420 | { |
| 1421 | return CMD_WARNING; |
| 1422 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1423 | assert (circuit); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1424 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1425 | |
| 1426 | circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */ |
| 1427 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1428 | return CMD_SUCCESS; |
| 1429 | } |
| 1430 | |
| 1431 | ALIAS (no_isis_hello_interval_l2, |
| 1432 | no_isis_hello_interval_l2_arg_cmd, |
| 1433 | "no isis hello-interval (<1-65535>|minimal) level-2", |
| 1434 | NO_STR |
| 1435 | "IS-IS commands\n" |
| 1436 | "Set Hello interval\n" |
| 1437 | "Hello interval value\n" |
| 1438 | "Holdtime 1 second, interval depends on multiplier\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1439 | "Specify hello-interval for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1440 | |
| 1441 | DEFUN (isis_hello_multiplier, |
| 1442 | isis_hello_multiplier_cmd, |
| 1443 | "isis hello-multiplier <3-1000>", |
| 1444 | "IS-IS commands\n" |
| 1445 | "Set multiplier for Hello holding time\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1446 | "Hello multiplier value\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1447 | { |
| 1448 | struct isis_circuit *circuit; |
| 1449 | struct interface *ifp; |
| 1450 | int mult; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1451 | |
| 1452 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1453 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1454 | if (circuit == NULL) |
| 1455 | { |
| 1456 | return CMD_WARNING; |
| 1457 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1458 | assert (circuit); |
| 1459 | |
| 1460 | mult = atoi (argv[0]); |
| 1461 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1462 | circuit->hello_multiplier[0] = (u_int16_t) mult; |
| 1463 | circuit->hello_multiplier[1] = (u_int16_t) mult; |
| 1464 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1465 | return CMD_SUCCESS; |
| 1466 | } |
| 1467 | |
| 1468 | DEFUN (no_isis_hello_multiplier, |
| 1469 | no_isis_hello_multiplier_cmd, |
| 1470 | "no isis hello-multiplier", |
| 1471 | NO_STR |
| 1472 | "IS-IS commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1473 | "Set multiplier for Hello holding time\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1474 | { |
| 1475 | struct isis_circuit *circuit; |
| 1476 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1477 | |
| 1478 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1479 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1480 | if (circuit == NULL) |
| 1481 | { |
| 1482 | return CMD_WARNING; |
| 1483 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1484 | assert (circuit); |
| 1485 | |
| 1486 | circuit->hello_multiplier[0] = HELLO_MULTIPLIER; |
| 1487 | circuit->hello_multiplier[1] = HELLO_MULTIPLIER; |
| 1488 | |
| 1489 | return CMD_SUCCESS; |
| 1490 | } |
| 1491 | |
| 1492 | ALIAS (no_isis_hello_multiplier, |
| 1493 | no_isis_hello_multiplier_arg_cmd, |
| 1494 | "no isis hello-multiplier <3-1000>", |
| 1495 | NO_STR |
| 1496 | "IS-IS commands\n" |
| 1497 | "Set multiplier for Hello holding time\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1498 | "Hello multiplier value\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1499 | |
| 1500 | DEFUN (isis_hello_multiplier_l1, |
| 1501 | isis_hello_multiplier_l1_cmd, |
| 1502 | "isis hello-multiplier <3-1000> level-1", |
| 1503 | "IS-IS commands\n" |
| 1504 | "Set multiplier for Hello holding time\n" |
| 1505 | "Hello multiplier value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1506 | "Specify hello multiplier for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1507 | { |
| 1508 | struct isis_circuit *circuit; |
| 1509 | struct interface *ifp; |
| 1510 | int mult; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1511 | |
| 1512 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1513 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1514 | if (circuit == NULL) |
| 1515 | { |
| 1516 | return CMD_WARNING; |
| 1517 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1518 | assert (circuit); |
| 1519 | |
| 1520 | mult = atoi (argv[0]); |
| 1521 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1522 | circuit->hello_multiplier[0] = (u_int16_t) mult; |
| 1523 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1524 | return CMD_SUCCESS; |
| 1525 | } |
| 1526 | |
| 1527 | DEFUN (no_isis_hello_multiplier_l1, |
| 1528 | no_isis_hello_multiplier_l1_cmd, |
| 1529 | "no isis hello-multiplier level-1", |
| 1530 | NO_STR |
| 1531 | "IS-IS commands\n" |
| 1532 | "Set multiplier for Hello holding time\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1533 | "Specify hello multiplier for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1534 | { |
| 1535 | struct isis_circuit *circuit; |
| 1536 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1537 | |
| 1538 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1539 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1540 | if (circuit == NULL) |
| 1541 | { |
| 1542 | return CMD_WARNING; |
| 1543 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1544 | assert (circuit); |
| 1545 | |
| 1546 | circuit->hello_multiplier[0] = HELLO_MULTIPLIER; |
| 1547 | |
| 1548 | return CMD_SUCCESS; |
| 1549 | } |
| 1550 | |
| 1551 | ALIAS (no_isis_hello_multiplier_l1, |
| 1552 | no_isis_hello_multiplier_l1_arg_cmd, |
| 1553 | "no isis hello-multiplier <3-1000> level-1", |
| 1554 | NO_STR |
| 1555 | "IS-IS commands\n" |
| 1556 | "Set multiplier for Hello holding time\n" |
| 1557 | "Hello multiplier value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1558 | "Specify hello multiplier for level-1 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1559 | |
| 1560 | DEFUN (isis_hello_multiplier_l2, |
| 1561 | isis_hello_multiplier_l2_cmd, |
| 1562 | "isis hello-multiplier <3-1000> level-2", |
| 1563 | "IS-IS commands\n" |
| 1564 | "Set multiplier for Hello holding time\n" |
| 1565 | "Hello multiplier value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1566 | "Specify hello multiplier for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1567 | { |
| 1568 | struct isis_circuit *circuit; |
| 1569 | struct interface *ifp; |
| 1570 | int mult; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1571 | |
| 1572 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1573 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1574 | if (circuit == NULL) |
| 1575 | { |
| 1576 | return CMD_WARNING; |
| 1577 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1578 | assert (circuit); |
| 1579 | |
| 1580 | mult = atoi (argv[0]); |
| 1581 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1582 | circuit->hello_multiplier[1] = (u_int16_t) mult; |
| 1583 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1584 | return CMD_SUCCESS; |
| 1585 | } |
| 1586 | |
| 1587 | DEFUN (no_isis_hello_multiplier_l2, |
| 1588 | no_isis_hello_multiplier_l2_cmd, |
| 1589 | "no isis hello-multiplier level-2", |
| 1590 | NO_STR |
| 1591 | "IS-IS commands\n" |
| 1592 | "Set multiplier for Hello holding time\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1593 | "Specify hello multiplier for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1594 | { |
| 1595 | struct isis_circuit *circuit; |
| 1596 | struct interface *ifp; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1597 | |
| 1598 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1599 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1600 | if (circuit == NULL) |
| 1601 | { |
| 1602 | return CMD_WARNING; |
| 1603 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1604 | assert (circuit); |
| 1605 | |
| 1606 | circuit->hello_multiplier[1] = HELLO_MULTIPLIER; |
| 1607 | |
| 1608 | return CMD_SUCCESS; |
| 1609 | } |
| 1610 | |
| 1611 | ALIAS (no_isis_hello_multiplier_l2, |
| 1612 | no_isis_hello_multiplier_l2_arg_cmd, |
| 1613 | "no isis hello-multiplier <3-1000> level-2", |
| 1614 | NO_STR |
| 1615 | "IS-IS commands\n" |
| 1616 | "Set multiplier for Hello holding time\n" |
| 1617 | "Hello multiplier value\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1618 | "Specify hello multiplier for level-2 IIHs\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1619 | |
| 1620 | DEFUN (isis_hello, |
| 1621 | isis_hello_cmd, |
| 1622 | "isis hello padding", |
| 1623 | "IS-IS commands\n" |
| 1624 | "Add padding to IS-IS hello packets\n" |
| 1625 | "Pad hello packets\n" |
| 1626 | "<cr>\n") |
| 1627 | { |
| 1628 | struct interface *ifp; |
| 1629 | struct isis_circuit *circuit; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1630 | |
| 1631 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1632 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1633 | if (circuit == NULL) |
| 1634 | { |
| 1635 | return CMD_WARNING; |
| 1636 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1637 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1638 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1639 | circuit->u.bc.pad_hellos = 1; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1640 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1641 | return CMD_SUCCESS; |
| 1642 | } |
| 1643 | |
hasso | 54301ce | 2004-01-27 10:07:34 +0000 | [diff] [blame] | 1644 | #if 0 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1645 | DEFUN (ip_address, |
| 1646 | ip_address_cmd, |
| 1647 | "ip address A.B.C.D/A", |
| 1648 | "Interface Internet Protocol config commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1649 | "Set the IP address of an interface\n" "IP address (e.g. 10.0.0.1/8\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1650 | { |
| 1651 | struct interface *ifp; |
| 1652 | struct isis_circuit *circuit; |
| 1653 | struct prefix_ipv4 *ipv4, *ip; |
| 1654 | struct listnode *node; |
| 1655 | int ret, found = 1; |
| 1656 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1657 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1658 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1659 | if (circuit == NULL) |
| 1660 | { |
| 1661 | return CMD_WARNING; |
| 1662 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1663 | |
| 1664 | assert (circuit); |
| 1665 | #ifdef HAVE_IPV6 |
| 1666 | zlog_info ("ip_address_cmd circuit %d", circuit->interface->ifindex); |
| 1667 | #endif /* HAVE_IPV6 */ |
| 1668 | |
| 1669 | ipv4 = prefix_ipv4_new (); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1670 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1671 | ret = str2prefix_ipv4 (argv[0], ipv4); |
| 1672 | if (ret <= 0) |
| 1673 | { |
| 1674 | zlog_warn ("ip_address_cmd(): malformed address"); |
| 1675 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 1676 | return CMD_WARNING; |
| 1677 | } |
| 1678 | |
| 1679 | if (!circuit->ip_addrs) |
| 1680 | circuit->ip_addrs = list_new (); |
| 1681 | else |
| 1682 | { |
| 1683 | for (node = listhead (circuit->ip_addrs); node; nextnode (node)) |
| 1684 | { |
| 1685 | ip = getdata (node); |
| 1686 | if (prefix_same ((struct prefix *) ip, (struct prefix *) ipv4)) |
| 1687 | found = 1; |
| 1688 | } |
| 1689 | if (found) |
| 1690 | { |
| 1691 | prefix_ipv4_free (ipv4); |
| 1692 | return CMD_SUCCESS; |
| 1693 | } |
| 1694 | } |
| 1695 | |
| 1696 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1697 | listnode_add (circuit->ip_addrs, ipv4); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1698 | #ifdef EXTREME_DEBUG |
| 1699 | zlog_info ("added IP address %s to circuit %d", argv[0], |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1700 | circuit->interface->ifindex); |
| 1701 | #endif /* EXTREME_DEBUG */ |
| 1702 | return CMD_SUCCESS; |
| 1703 | } |
| 1704 | |
| 1705 | DEFUN (no_ip_address, |
| 1706 | no_ip_address_cmd, |
| 1707 | "no ip address A.B.C.D/A", |
| 1708 | NO_STR |
| 1709 | "Interface Internet Protocol config commands\n" |
| 1710 | "Set the IP address of an interface\n" |
| 1711 | "IP address (e.g. 10.0.0.1/8\n") |
| 1712 | { |
| 1713 | struct interface *ifp; |
| 1714 | struct isis_circuit *circuit; |
| 1715 | struct prefix_ipv4 ipv4, *ip = NULL; |
| 1716 | struct listnode *node; |
| 1717 | int ret; |
| 1718 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1719 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1720 | circuit = ifp->info; |
| 1721 | /* UGLY - will remove l8r */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1722 | if (circuit == NULL) |
| 1723 | { |
| 1724 | return CMD_WARNING; |
| 1725 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1726 | assert (circuit); |
| 1727 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1728 | if (!circuit->ip_addrs || circuit->ip_addrs->count == 0) |
| 1729 | { |
| 1730 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 1731 | return CMD_WARNING; |
| 1732 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1733 | ret = str2prefix_ipv4 (argv[0], &ipv4); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1734 | if (ret <= 0) |
| 1735 | { |
| 1736 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 1737 | return CMD_WARNING; |
| 1738 | } |
| 1739 | |
| 1740 | for (node = listhead (circuit->ip_addrs); node; nextnode (node)) |
| 1741 | { |
| 1742 | ip = getdata (node); |
| 1743 | if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4)) |
| 1744 | break; |
| 1745 | } |
| 1746 | |
| 1747 | if (ip) |
| 1748 | { |
| 1749 | listnode_delete (circuit->ip_addrs, ip); |
| 1750 | } |
| 1751 | else |
| 1752 | { |
| 1753 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 1754 | } |
| 1755 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1756 | return CMD_SUCCESS; |
| 1757 | } |
hasso | 54301ce | 2004-01-27 10:07:34 +0000 | [diff] [blame] | 1758 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1759 | |
| 1760 | DEFUN (no_isis_hello, |
| 1761 | no_isis_hello_cmd, |
| 1762 | "no isis hello padding", |
| 1763 | NO_STR |
| 1764 | "IS-IS commands\n" |
| 1765 | "Add padding to IS-IS hello packets\n" |
| 1766 | "Pad hello packets\n" |
| 1767 | "<cr>\n") |
| 1768 | { |
| 1769 | struct isis_circuit *circuit; |
| 1770 | struct interface *ifp; |
| 1771 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1772 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1773 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1774 | if (circuit == NULL) |
| 1775 | { |
| 1776 | return CMD_WARNING; |
| 1777 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1778 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1779 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1780 | circuit->u.bc.pad_hellos = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1781 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1782 | return CMD_SUCCESS; |
| 1783 | } |
| 1784 | |
| 1785 | DEFUN (csnp_interval, |
| 1786 | csnp_interval_cmd, |
| 1787 | "isis csnp-interval <0-65535>", |
| 1788 | "IS-IS commands\n" |
| 1789 | "Set CSNP interval in seconds\n" |
| 1790 | "CSNP interval value\n") |
| 1791 | { |
| 1792 | struct isis_circuit *circuit; |
| 1793 | struct interface *ifp; |
| 1794 | unsigned long interval; |
| 1795 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1796 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1797 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1798 | if (circuit == NULL) |
| 1799 | { |
| 1800 | return CMD_WARNING; |
| 1801 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1802 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1803 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1804 | interval = atol (argv[0]); |
| 1805 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1806 | circuit->csnp_interval[0] = (u_int16_t) interval; |
| 1807 | circuit->csnp_interval[1] = (u_int16_t) interval; |
| 1808 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1809 | return CMD_SUCCESS; |
| 1810 | } |
| 1811 | |
| 1812 | DEFUN (no_csnp_interval, |
| 1813 | no_csnp_interval_cmd, |
| 1814 | "no isis csnp-interval", |
| 1815 | NO_STR |
| 1816 | "IS-IS commands\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1817 | "Set CSNP interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1818 | { |
| 1819 | struct isis_circuit *circuit; |
| 1820 | struct interface *ifp; |
| 1821 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1822 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1823 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1824 | if (circuit == NULL) |
| 1825 | { |
| 1826 | return CMD_WARNING; |
| 1827 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1828 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1829 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1830 | circuit->csnp_interval[0] = CSNP_INTERVAL; |
| 1831 | circuit->csnp_interval[1] = CSNP_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1832 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1833 | return CMD_SUCCESS; |
| 1834 | } |
| 1835 | |
| 1836 | ALIAS (no_csnp_interval, |
| 1837 | no_csnp_interval_arg_cmd, |
| 1838 | "no isis csnp-interval <0-65535>", |
| 1839 | NO_STR |
| 1840 | "IS-IS commands\n" |
| 1841 | "Set CSNP interval in seconds\n" |
| 1842 | "CSNP interval value\n") |
| 1843 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1844 | DEFUN (csnp_interval_l1, |
| 1845 | csnp_interval_l1_cmd, |
| 1846 | "isis csnp-interval <0-65535> level-1", |
| 1847 | "IS-IS commands\n" |
| 1848 | "Set CSNP interval in seconds\n" |
| 1849 | "CSNP interval value\n" |
| 1850 | "Specify interval for level-1 CSNPs\n") |
| 1851 | { |
| 1852 | struct isis_circuit *circuit; |
| 1853 | struct interface *ifp; |
| 1854 | unsigned long interval; |
| 1855 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1856 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1857 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1858 | if (circuit == NULL) |
| 1859 | { |
| 1860 | return CMD_WARNING; |
| 1861 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1862 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1863 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1864 | interval = atol (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1865 | |
| 1866 | circuit->csnp_interval[0] = (u_int16_t) interval; |
| 1867 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1868 | return CMD_SUCCESS; |
| 1869 | } |
| 1870 | |
| 1871 | DEFUN (no_csnp_interval_l1, |
| 1872 | no_csnp_interval_l1_cmd, |
| 1873 | "no isis csnp-interval level-1", |
| 1874 | NO_STR |
| 1875 | "IS-IS commands\n" |
| 1876 | "Set CSNP interval in seconds\n" |
| 1877 | "Specify interval for level-1 CSNPs\n") |
| 1878 | { |
| 1879 | struct isis_circuit *circuit; |
| 1880 | struct interface *ifp; |
| 1881 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1882 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1883 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1884 | if (circuit == NULL) |
| 1885 | { |
| 1886 | return CMD_WARNING; |
| 1887 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1888 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1889 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1890 | circuit->csnp_interval[0] = CSNP_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1891 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1892 | return CMD_SUCCESS; |
| 1893 | } |
| 1894 | |
| 1895 | ALIAS (no_csnp_interval_l1, |
| 1896 | no_csnp_interval_l1_arg_cmd, |
| 1897 | "no isis csnp-interval <0-65535> level-1", |
| 1898 | NO_STR |
| 1899 | "IS-IS commands\n" |
| 1900 | "Set CSNP interval in seconds\n" |
| 1901 | "CSNP interval value\n" |
| 1902 | "Specify interval for level-1 CSNPs\n") |
| 1903 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1904 | DEFUN (csnp_interval_l2, |
| 1905 | csnp_interval_l2_cmd, |
| 1906 | "isis csnp-interval <0-65535> level-2", |
| 1907 | "IS-IS commands\n" |
| 1908 | "Set CSNP interval in seconds\n" |
| 1909 | "CSNP interval value\n" |
| 1910 | "Specify interval for level-2 CSNPs\n") |
| 1911 | { |
| 1912 | struct isis_circuit *circuit; |
| 1913 | struct interface *ifp; |
| 1914 | unsigned long interval; |
| 1915 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1916 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1917 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1918 | if (circuit == NULL) |
| 1919 | { |
| 1920 | return CMD_WARNING; |
| 1921 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1922 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1923 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1924 | interval = atol (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1925 | |
| 1926 | circuit->csnp_interval[1] = (u_int16_t) interval; |
| 1927 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1928 | return CMD_SUCCESS; |
| 1929 | } |
| 1930 | |
| 1931 | DEFUN (no_csnp_interval_l2, |
| 1932 | no_csnp_interval_l2_cmd, |
| 1933 | "no isis csnp-interval level-2", |
| 1934 | NO_STR |
| 1935 | "IS-IS commands\n" |
| 1936 | "Set CSNP interval in seconds\n" |
| 1937 | "Specify interval for level-2 CSNPs\n") |
| 1938 | { |
| 1939 | struct isis_circuit *circuit; |
| 1940 | struct interface *ifp; |
| 1941 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1942 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1943 | circuit = ifp->info; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1944 | if (circuit == NULL) |
| 1945 | { |
| 1946 | return CMD_WARNING; |
| 1947 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1948 | assert (circuit); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1949 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1950 | circuit->csnp_interval[1] = CSNP_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1951 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1952 | return CMD_SUCCESS; |
| 1953 | } |
| 1954 | |
| 1955 | ALIAS (no_csnp_interval_l2, |
| 1956 | no_csnp_interval_l2_arg_cmd, |
| 1957 | "no isis csnp-interval <0-65535> level-2", |
| 1958 | NO_STR |
| 1959 | "IS-IS commands\n" |
| 1960 | "Set CSNP interval in seconds\n" |
| 1961 | "CSNP interval value\n" |
| 1962 | "Specify interval for level-2 CSNPs\n") |
| 1963 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1964 | #ifdef HAVE_IPV6 |
| 1965 | DEFUN (ipv6_router_isis, |
| 1966 | ipv6_router_isis_cmd, |
| 1967 | "ipv6 router isis WORD", |
| 1968 | "IPv6 interface subcommands\n" |
| 1969 | "IPv6 Router interface commands\n" |
| 1970 | "IS-IS Routing for IPv6\n" |
| 1971 | "Routing process tag\n") |
| 1972 | { |
| 1973 | struct isis_circuit *c; |
| 1974 | struct interface *ifp; |
| 1975 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1976 | |
| 1977 | ifp = (struct interface *) vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1978 | assert (ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1979 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1980 | area = isis_area_lookup (argv[0]); |
| 1981 | |
| 1982 | /* Prevent more than one circuit per interface */ |
| 1983 | if (area) |
| 1984 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1985 | else |
| 1986 | c = NULL; |
| 1987 | |
| 1988 | if (c && (ifp->info != NULL)) |
| 1989 | { |
| 1990 | if (c->ipv6_router == 1) |
| 1991 | { |
| 1992 | vty_out (vty, "ISIS circuit is already defined for IPv6%s", |
| 1993 | VTY_NEWLINE); |
| 1994 | return CMD_WARNING; |
| 1995 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1996 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1997 | |
| 1998 | /* this is here for ciscopability */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1999 | if (!area) |
| 2000 | { |
| 2001 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 2002 | return CMD_WARNING; |
| 2003 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2004 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2005 | if (!c) |
| 2006 | { |
| 2007 | c = circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 2008 | c = isis_csm_state_change (ISIS_ENABLE, c, area); |
| 2009 | c->interface = ifp; |
| 2010 | ifp->info = c; |
| 2011 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2012 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2013 | if (!c) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2014 | return CMD_WARNING; |
| 2015 | |
| 2016 | c->ipv6_router = 1; |
| 2017 | area->ipv6_circuits++; |
| 2018 | circuit_update_nlpids (c); |
| 2019 | |
| 2020 | vty->node = INTERFACE_NODE; |
| 2021 | |
| 2022 | return CMD_SUCCESS; |
| 2023 | } |
| 2024 | |
| 2025 | DEFUN (no_ipv6_router_isis, |
| 2026 | no_ipv6_router_isis_cmd, |
| 2027 | "no ipv6 router isis WORD", |
| 2028 | NO_STR |
| 2029 | "IPv6 interface subcommands\n" |
| 2030 | "IPv6 Router interface commands\n" |
| 2031 | "IS-IS Routing for IPv6\n" |
| 2032 | "Routing process tag\n") |
| 2033 | { |
| 2034 | struct isis_circuit *c; |
| 2035 | struct interface *ifp; |
| 2036 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2037 | |
| 2038 | ifp = (struct interface *) vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2039 | /* UGLY - will remove l8r |
| 2040 | if (circuit == NULL) { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2041 | return CMD_WARNING; |
| 2042 | } */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2043 | assert (ifp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2044 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2045 | area = isis_area_lookup (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2046 | if (!area) |
| 2047 | { |
| 2048 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 2049 | return CMD_WARNING; |
| 2050 | } |
| 2051 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2052 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 2053 | if (!c) |
| 2054 | return CMD_WARNING; |
| 2055 | |
| 2056 | c->ipv6_router = 0; |
| 2057 | area->ipv6_circuits--; |
| 2058 | if (c->ip_router == 0) |
| 2059 | isis_csm_state_change (ISIS_DISABLE, c, area); |
| 2060 | |
| 2061 | return CMD_SUCCESS; |
| 2062 | } |
| 2063 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2064 | #if 0 /* Guess we don't really need these */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2065 | |
| 2066 | DEFUN (ipv6_address, |
| 2067 | ipv6_address_cmd, |
| 2068 | "ipv6 address X:X::X:X/M", |
| 2069 | "Interface Internet Protocol config commands\n" |
| 2070 | "Set the IP address of an interface\n" |
| 2071 | "IPv6 address (e.g. 3ffe:506::1/48)\n") |
| 2072 | { |
| 2073 | struct interface *ifp; |
| 2074 | struct isis_circuit *circuit; |
| 2075 | struct prefix_ipv6 *ipv6, *ip6; |
| 2076 | struct listnode *node; |
| 2077 | int ret, found = 1; |
| 2078 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2079 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2080 | circuit = ifp->info; |
| 2081 | /* UGLY - will remove l8r */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2082 | if (circuit == NULL) |
| 2083 | { |
| 2084 | return CMD_WARNING; |
| 2085 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2086 | assert (circuit); |
| 2087 | #ifdef EXTREME_DEBUG |
| 2088 | zlog_info ("ipv6_address_cmd circuit %d", circuit->idx); |
| 2089 | #endif /* EXTREME_DEBUG */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2090 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2091 | if (circuit == NULL) |
| 2092 | { |
| 2093 | zlog_warn ("ipv6_address_cmd(): no circuit"); |
| 2094 | return CMD_WARNING; |
| 2095 | } |
| 2096 | |
| 2097 | |
| 2098 | ipv6 = prefix_ipv6_new (); |
| 2099 | |
| 2100 | ret = str2prefix_ipv6 (argv[0], ipv6); |
| 2101 | if (ret <= 0) |
| 2102 | { |
| 2103 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 2104 | return CMD_WARNING; |
| 2105 | } |
| 2106 | |
| 2107 | if (!circuit->ipv6_addrs) |
| 2108 | circuit->ipv6_addrs = list_new (); |
| 2109 | else |
| 2110 | { |
| 2111 | for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) |
| 2112 | { |
| 2113 | ip6 = getdata (node); |
| 2114 | if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6)) |
| 2115 | found = 1; |
| 2116 | } |
| 2117 | if (found) |
| 2118 | { |
| 2119 | prefix_ipv6_free (ipv6); |
| 2120 | return CMD_SUCCESS; |
| 2121 | } |
| 2122 | } |
| 2123 | |
| 2124 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2125 | listnode_add (circuit->ipv6_addrs, ipv6); |
| 2126 | #ifdef EXTREME_DEBUG |
| 2127 | zlog_info ("added IPv6 address %s to circuit %d", argv[0], circuit->idx); |
| 2128 | #endif /* EXTREME_DEBUG */ |
| 2129 | |
| 2130 | return CMD_SUCCESS; |
| 2131 | } |
| 2132 | |
| 2133 | DEFUN (no_ipv6_address, |
| 2134 | no_ipv6_address_cmd, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2135 | "no ipv6 address X:X::X:X/M", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2136 | NO_STR |
| 2137 | "Interface Internet Protocol config commands\n" |
| 2138 | "Set the IP address of an interface\n" |
| 2139 | "IPv6 address (e.g. 3ffe:506::1/48)\n") |
| 2140 | { |
| 2141 | struct interface *ifp; |
| 2142 | struct isis_circuit *circuit; |
| 2143 | struct prefix_ipv6 ipv6, *ip6 = NULL; |
| 2144 | struct listnode *node; |
| 2145 | int ret; |
| 2146 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2147 | ifp = vty->index; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2148 | circuit = ifp->info; |
| 2149 | /* UGLY - will remove l8r */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2150 | if (circuit == NULL) |
| 2151 | { |
| 2152 | return CMD_WARNING; |
| 2153 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2154 | assert (circuit); |
| 2155 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2156 | if (!circuit->ipv6_addrs || circuit->ipv6_addrs->count == 0) |
| 2157 | { |
| 2158 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 2159 | return CMD_WARNING; |
| 2160 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2161 | ret = str2prefix_ipv6 (argv[0], &ipv6); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2162 | if (ret <= 0) |
| 2163 | { |
| 2164 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 2165 | return CMD_WARNING; |
| 2166 | } |
| 2167 | |
| 2168 | for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) |
| 2169 | { |
| 2170 | ip6 = getdata (node); |
| 2171 | if (prefix_same ((struct prefix *) ip6, (struct prefix *) &ipv6)) |
| 2172 | break; |
| 2173 | } |
| 2174 | |
| 2175 | if (ip6) |
| 2176 | { |
| 2177 | listnode_delete (circuit->ipv6_addrs, ip6); |
| 2178 | } |
| 2179 | else |
| 2180 | { |
| 2181 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 2182 | } |
| 2183 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2184 | return CMD_SUCCESS; |
| 2185 | } |
| 2186 | #endif /* 0 */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2187 | #endif /* HAVE_IPV6 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2188 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2189 | struct cmd_node interface_node = { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2190 | INTERFACE_NODE, |
| 2191 | "%s(config-if)# ", |
| 2192 | 1, |
| 2193 | }; |
| 2194 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2195 | int |
| 2196 | isis_if_new_hook (struct interface *ifp) |
| 2197 | { |
| 2198 | /* FIXME: Discuss if the circuit should be created here |
| 2199 | ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */ |
| 2200 | ifp->info = NULL; |
| 2201 | return 0; |
| 2202 | } |
| 2203 | |
| 2204 | int |
| 2205 | isis_if_delete_hook (struct interface *ifp) |
| 2206 | { |
| 2207 | /* FIXME: Discuss if the circuit should be created here |
| 2208 | XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/ |
| 2209 | ifp->info = NULL; |
| 2210 | return 0; |
| 2211 | } |
| 2212 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2213 | void |
| 2214 | isis_circuit_init () |
| 2215 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2216 | /* Initialize Zebra interface data structure */ |
| 2217 | if_init (); |
| 2218 | if_add_hook (IF_NEW_HOOK, isis_if_new_hook); |
| 2219 | if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook); |
| 2220 | |
| 2221 | /* Install interface node */ |
| 2222 | install_node (&interface_node, isis_interface_config_write); |
| 2223 | install_element (CONFIG_NODE, &interface_cmd); |
| 2224 | |
| 2225 | install_default (INTERFACE_NODE); |
| 2226 | install_element (INTERFACE_NODE, &interface_desc_cmd); |
| 2227 | install_element (INTERFACE_NODE, &no_interface_desc_cmd); |
| 2228 | |
| 2229 | install_element (INTERFACE_NODE, &ip_router_isis_cmd); |
| 2230 | install_element (INTERFACE_NODE, &no_ip_router_isis_cmd); |
| 2231 | |
| 2232 | install_element (INTERFACE_NODE, &isis_circuit_type_cmd); |
| 2233 | install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd); |
| 2234 | |
| 2235 | install_element (INTERFACE_NODE, &isis_passwd_cmd); |
| 2236 | install_element (INTERFACE_NODE, &no_isis_passwd_cmd); |
| 2237 | |
| 2238 | install_element (INTERFACE_NODE, &isis_priority_cmd); |
| 2239 | install_element (INTERFACE_NODE, &no_isis_priority_cmd); |
| 2240 | install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd); |
| 2241 | install_element (INTERFACE_NODE, &isis_priority_l1_cmd); |
| 2242 | install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd); |
| 2243 | install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd); |
| 2244 | install_element (INTERFACE_NODE, &isis_priority_l2_cmd); |
| 2245 | install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd); |
| 2246 | install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd); |
| 2247 | |
| 2248 | install_element (INTERFACE_NODE, &isis_metric_cmd); |
| 2249 | install_element (INTERFACE_NODE, &no_isis_metric_cmd); |
| 2250 | install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd); |
| 2251 | |
| 2252 | install_element (INTERFACE_NODE, &isis_hello_interval_cmd); |
| 2253 | install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd); |
| 2254 | install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd); |
| 2255 | install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd); |
| 2256 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd); |
| 2257 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd); |
| 2258 | install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd); |
| 2259 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd); |
| 2260 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd); |
| 2261 | |
| 2262 | install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd); |
| 2263 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd); |
| 2264 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd); |
| 2265 | install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd); |
| 2266 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd); |
| 2267 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd); |
| 2268 | install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd); |
| 2269 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd); |
| 2270 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd); |
| 2271 | |
| 2272 | install_element (INTERFACE_NODE, &isis_hello_cmd); |
| 2273 | install_element (INTERFACE_NODE, &no_isis_hello_cmd); |
hasso | 38a61c7 | 2004-01-27 13:40:14 +0000 | [diff] [blame] | 2274 | #if 0 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2275 | install_element (INTERFACE_NODE, &ip_address_cmd); |
| 2276 | install_element (INTERFACE_NODE, &no_ip_address_cmd); |
hasso | 38a61c7 | 2004-01-27 13:40:14 +0000 | [diff] [blame] | 2277 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2278 | install_element (INTERFACE_NODE, &csnp_interval_cmd); |
| 2279 | install_element (INTERFACE_NODE, &no_csnp_interval_cmd); |
| 2280 | install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd); |
| 2281 | install_element (INTERFACE_NODE, &csnp_interval_l1_cmd); |
| 2282 | install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd); |
| 2283 | install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd); |
| 2284 | install_element (INTERFACE_NODE, &csnp_interval_l2_cmd); |
| 2285 | install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd); |
| 2286 | install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd); |
| 2287 | |
| 2288 | #ifdef HAVE_IPV6 |
| 2289 | install_element (INTERFACE_NODE, &ipv6_router_isis_cmd); |
| 2290 | install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd); |
| 2291 | #if 0 |
| 2292 | install_element (INTERFACE_NODE, &ipv6_address_cmd); |
| 2293 | install_element (INTERFACE_NODE, &no_ipv6_address_cmd); |
| 2294 | #endif |
| 2295 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2296 | } |