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