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