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