|
|
| version 1.1.1.2, 2012/10/09 09:22:28 | version 1.1.1.4, 2016/11/02 10:09:10 |
|---|---|
| Line 122 isis_circuit_configure (struct isis_circuit *circuit, | Line 122 isis_circuit_configure (struct isis_circuit *circuit, |
| circuit->area = area; | circuit->area = area; |
| /* | /* |
| * The level for the circuit is same as for the area, unless configured | * Whenever the is-type of an area is changed, the is-type of each circuit |
| * otherwise. | * in that area is updated to a non-empty subset of the area is-type. |
| * Inversely, when configuring a new circuit, this property should be | |
| * ensured as well. | |
| */ | */ |
| if (area->is_type != IS_LEVEL_1_AND_2 && area->is_type != circuit->is_type) | if (area->is_type != IS_LEVEL_1_AND_2) |
| zlog_warn ("circut %s is_type %d mismatch with area %s is_type %d", | circuit->is_type = area->is_type; |
| circuit->interface->name, circuit->is_type, | |
| circuit->area->area_tag, area->is_type); | |
| /* | /* |
| * Add the circuit into area | * Add the circuit into area |
| Line 326 isis_circuit_del_addr (struct isis_circuit *circuit, | Line 326 isis_circuit_del_addr (struct isis_circuit *circuit, |
| prefix2str (connected->address, (char *)buf, BUFSIZ); | prefix2str (connected->address, (char *)buf, BUFSIZ); |
| zlog_warn ("Nonexitant ip address %s removal attempt from \ | zlog_warn ("Nonexitant ip address %s removal attempt from \ |
| circuit %d", buf, circuit->circuit_id); | circuit %d", buf, circuit->circuit_id); |
| zlog_warn ("Current ip addresses on %s:", circuit->interface->name); | |
| for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ip)) | |
| { | |
| prefix2str((struct prefix*)ip, (char *)buf, BUFSIZ); | |
| zlog_warn(" %s", buf); | |
| } | |
| zlog_warn("End of addresses"); | |
| } | } |
| prefix_ipv4_free (ipv4); | |
| } | } |
| #ifdef HAVE_IPV6 | #ifdef HAVE_IPV6 |
| if (connected->address->family == AF_INET6) | if (connected->address->family == AF_INET6) |
| Line 367 isis_circuit_del_addr (struct isis_circuit *circuit, | Line 376 isis_circuit_del_addr (struct isis_circuit *circuit, |
| prefix2str (connected->address, (char *)buf, BUFSIZ); | prefix2str (connected->address, (char *)buf, BUFSIZ); |
| zlog_warn ("Nonexitant ip address %s removal attempt from \ | zlog_warn ("Nonexitant ip address %s removal attempt from \ |
| circuit %d", buf, circuit->circuit_id); | circuit %d", buf, circuit->circuit_id); |
| zlog_warn ("Current ip addresses on %s:", circuit->interface->name); | |
| for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ip6)) | |
| { | |
| prefix2str((struct prefix*)ip6, (char *)buf, BUFSIZ); | |
| zlog_warn(" %s", buf); | |
| } | |
| zlog_warn(" -----"); | |
| for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ip6)) | |
| { | |
| prefix2str((struct prefix*)ip6, (char *)buf, BUFSIZ); | |
| zlog_warn(" %s", buf); | |
| } | |
| zlog_warn("End of addresses"); | |
| } | } |
| else if (circuit->area) | else if (circuit->area) |
| lsp_regenerate_schedule (circuit->area, circuit->is_type, 0); | lsp_regenerate_schedule (circuit->area, circuit->is_type, 0); |
| prefix_ipv6_free (ipv6); | |
| } | } |
| #endif /* HAVE_IPV6 */ | #endif /* HAVE_IPV6 */ |
| return; | return; |
| Line 393 isis_circuit_id_gen (struct interface *ifp) | Line 417 isis_circuit_id_gen (struct interface *ifp) |
| */ | */ |
| for (i = 0; i < strlen (ifp->name); i++) | for (i = 0; i < strlen (ifp->name); i++) |
| { | { |
| if (isdigit(ifp->name[i])) | if (isdigit((unsigned char)ifp->name[i])) |
| { | { |
| if (start < 0) | if (start < 0) |
| { | { |
| Line 574 isis_circuit_update_all_srmflags (struct isis_circuit | Line 598 isis_circuit_update_all_srmflags (struct isis_circuit |
| } | } |
| } | } |
| size_t | |
| isis_circuit_pdu_size(struct isis_circuit *circuit) | |
| { | |
| return ISO_MTU(circuit); | |
| } | |
| void | |
| isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream) | |
| { | |
| size_t stream_size = isis_circuit_pdu_size(circuit); | |
| if (!*stream) | |
| { | |
| *stream = stream_new(stream_size); | |
| } | |
| else | |
| { | |
| if (STREAM_SIZE(*stream) != stream_size) | |
| stream_resize(*stream, stream_size); | |
| stream_reset(*stream); | |
| } | |
| } | |
| int | int |
| isis_circuit_up (struct isis_circuit *circuit) | isis_circuit_up (struct isis_circuit *circuit) |
| { | { |
| Line 588 isis_circuit_up (struct isis_circuit *circuit) | Line 635 isis_circuit_up (struct isis_circuit *circuit) |
| if (circuit->is_passive) | if (circuit->is_passive) |
| return ISIS_OK; | return ISIS_OK; |
| if (circuit->area->lsp_mtu > isis_circuit_pdu_size(circuit)) | |
| { | |
| zlog_err("Interface MTU %zu on %s is too low to support area lsp mtu %u!", | |
| isis_circuit_pdu_size(circuit), circuit->interface->name, | |
| circuit->area->lsp_mtu); | |
| isis_circuit_down(circuit); | |
| return ISIS_ERROR; | |
| } | |
| if (circuit->circ_type == CIRCUIT_T_BROADCAST) | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| { | { |
| /* | /* |
| * Get the Hardware Address | * Get the Hardware Address |
| */ | */ |
| #ifdef HAVE_STRUCT_SOCKADDR_DL | |
| #ifndef SUNOS_5 | |
| if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN) | |
| zlog_warn ("unsupported link layer"); | |
| else | |
| memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), | |
| ETH_ALEN); | |
| #endif | |
| #else | |
| if (circuit->interface->hw_addr_len != ETH_ALEN) | if (circuit->interface->hw_addr_len != ETH_ALEN) |
| { | { |
| zlog_warn ("unsupported link layer"); | zlog_warn ("unsupported link layer"); |
| Line 615 isis_circuit_up (struct isis_circuit *circuit) | Line 662 isis_circuit_up (struct isis_circuit *circuit) |
| circuit->interface->ifindex, ISO_MTU (circuit), | circuit->interface->ifindex, ISO_MTU (circuit), |
| snpa_print (circuit->u.bc.snpa)); | snpa_print (circuit->u.bc.snpa)); |
| #endif /* EXTREME_DEBUG */ | #endif /* EXTREME_DEBUG */ |
| #endif /* HAVE_STRUCT_SOCKADDR_DL */ | |
| circuit->u.bc.adjdb[0] = list_new (); | circuit->u.bc.adjdb[0] = list_new (); |
| circuit->u.bc.adjdb[1] = list_new (); | circuit->u.bc.adjdb[1] = list_new (); |
| if (circuit->area->min_bcast_mtu == 0 || | |
| ISO_MTU (circuit) < circuit->area->min_bcast_mtu) | |
| circuit->area->min_bcast_mtu = ISO_MTU (circuit); | |
| /* | /* |
| * ISO 10589 - 8.4.1 Enabling of broadcast circuits | * ISO 10589 - 8.4.1 Enabling of broadcast circuits |
| */ | */ |
| Line 684 isis_circuit_up (struct isis_circuit *circuit) | Line 727 isis_circuit_up (struct isis_circuit *circuit) |
| } | } |
| /* initialize the circuit streams after opening connection */ | /* initialize the circuit streams after opening connection */ |
| if (circuit->rcv_stream == NULL) | isis_circuit_stream(circuit, &circuit->rcv_stream); |
| circuit->rcv_stream = stream_new (ISO_MTU (circuit)); | isis_circuit_stream(circuit, &circuit->snd_stream); |
| if (circuit->snd_stream == NULL) | |
| circuit->snd_stream = stream_new (ISO_MTU (circuit)); | |
| #ifdef GNU_LINUX | #ifdef GNU_LINUX |
| THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit, | THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit, |
| circuit->fd); | circuit->fd); |
| Line 759 isis_circuit_down (struct isis_circuit *circuit) | Line 799 isis_circuit_down (struct isis_circuit *circuit) |
| THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]); | THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]); |
| THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[0]); | THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[0]); |
| THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[1]); | THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[1]); |
| circuit->lsp_regenerate_pending[0] = 0; | |
| circuit->lsp_regenerate_pending[1] = 0; | |
| } | } |
| else if (circuit->circ_type == CIRCUIT_T_P2P) | else if (circuit->circ_type == CIRCUIT_T_P2P) |
| { | { |
| Line 850 isis_circuit_print_vty (struct isis_circuit *circuit, | Line 892 isis_circuit_print_vty (struct isis_circuit *circuit, |
| if (detail == ISIS_UI_LEVEL_DETAIL) | if (detail == ISIS_UI_LEVEL_DETAIL) |
| { | { |
| struct listnode *node; | |
| struct prefix *ip_addr; | |
| u_char buf[BUFSIZ]; | |
| vty_out (vty, " Interface: %s", circuit->interface->name); | vty_out (vty, " Interface: %s", circuit->interface->name); |
| vty_out (vty, ", State: %s", circuit_state2string (circuit->state)); | vty_out (vty, ", State: %s", circuit_state2string (circuit->state)); |
| if (circuit->is_passive) | if (circuit->is_passive) |
| Line 931 isis_circuit_print_vty (struct isis_circuit *circuit, | Line 977 isis_circuit_print_vty (struct isis_circuit *circuit, |
| } | } |
| if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0) | if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0) |
| { | { |
| struct listnode *node; | |
| struct prefix *ip_addr; | |
| u_char buf[BUFSIZ]; | |
| vty_out (vty, " IP Prefix(es):%s", VTY_NEWLINE); | vty_out (vty, " IP Prefix(es):%s", VTY_NEWLINE); |
| for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr)) | for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr)) |
| { | { |
| Line 941 isis_circuit_print_vty (struct isis_circuit *circuit, | Line 984 isis_circuit_print_vty (struct isis_circuit *circuit, |
| vty_out (vty, " %s%s", buf, VTY_NEWLINE); | vty_out (vty, " %s%s", buf, VTY_NEWLINE); |
| } | } |
| } | } |
| if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0) | |
| { | |
| vty_out(vty, " IPv6 Link-Locals:%s", VTY_NEWLINE); | |
| for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ip_addr)) | |
| { | |
| prefix2str(ip_addr, (char*)buf, BUFSIZ), | |
| vty_out(vty, " %s%s", buf, VTY_NEWLINE); | |
| } | |
| } | |
| if (circuit->ipv6_link && listcount(circuit->ipv6_non_link) > 0) | |
| { | |
| vty_out(vty, " IPv6 Prefixes:%s", VTY_NEWLINE); | |
| for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ip_addr)) | |
| { | |
| prefix2str(ip_addr, (char*)buf, BUFSIZ), | |
| vty_out(vty, " %s%s", buf, VTY_NEWLINE); | |
| } | |
| } | |
| vty_out (vty, "%s", VTY_NEWLINE); | vty_out (vty, "%s", VTY_NEWLINE); |
| } | } |
| return; | return; |
| Line 1189 DEFUN (ip_router_isis, | Line 1251 DEFUN (ip_router_isis, |
| struct isis_circuit *circuit; | struct isis_circuit *circuit; |
| struct interface *ifp; | struct interface *ifp; |
| struct isis_area *area; | struct isis_area *area; |
| int rv; | |
| ifp = (struct interface *) vty->index; | ifp = (struct interface *) vty->index; |
| assert (ifp); | assert (ifp); |
| Line 1217 DEFUN (ip_router_isis, | Line 1280 DEFUN (ip_router_isis, |
| area = vty->index; | area = vty->index; |
| circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area); | circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area); |
| isis_circuit_if_bind (circuit, ifp); | if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP) |
| { | |
| vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE); | |
| rv = CMD_WARNING; | |
| } | |
| else | |
| { | |
| isis_circuit_if_bind (circuit, ifp); | |
| circuit->ip_router = 1; | circuit->ip_router = 1; |
| area->ip_circuits++; | area->ip_circuits++; |
| circuit_update_nlpids (circuit); | circuit_update_nlpids (circuit); |
| rv = CMD_SUCCESS; | |
| } | |
| vty->node = INTERFACE_NODE; | vty->node = INTERFACE_NODE; |
| vty->index = ifp; | vty->index = ifp; |
| return CMD_SUCCESS; | return rv; |
| } | } |
| DEFUN (no_ip_router_isis, | DEFUN (no_ip_router_isis, |
| Line 1287 DEFUN (ipv6_router_isis, | Line 1359 DEFUN (ipv6_router_isis, |
| struct isis_circuit *circuit; | struct isis_circuit *circuit; |
| struct interface *ifp; | struct interface *ifp; |
| struct isis_area *area; | struct isis_area *area; |
| int rv; | |
| ifp = (struct interface *) vty->index; | ifp = (struct interface *) vty->index; |
| assert (ifp); | assert (ifp); |
| Line 1315 DEFUN (ipv6_router_isis, | Line 1388 DEFUN (ipv6_router_isis, |
| area = vty->index; | area = vty->index; |
| circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area); | circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area); |
| isis_circuit_if_bind (circuit, ifp); | if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP) |
| { | |
| vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE); | |
| rv = CMD_WARNING; | |
| } | |
| else | |
| { | |
| isis_circuit_if_bind (circuit, ifp); | |
| circuit->ipv6_router = 1; | circuit->ipv6_router = 1; |
| area->ipv6_circuits++; | area->ipv6_circuits++; |
| circuit_update_nlpids (circuit); | circuit_update_nlpids (circuit); |
| rv = CMD_SUCCESS; | |
| } | |
| vty->node = INTERFACE_NODE; | vty->node = INTERFACE_NODE; |
| vty->index = ifp; | vty->index = ifp; |
| return CMD_SUCCESS; | return rv; |
| } | } |
| DEFUN (no_ipv6_router_isis, | DEFUN (no_ipv6_router_isis, |
| Line 1338 DEFUN (no_ipv6_router_isis, | Line 1420 DEFUN (no_ipv6_router_isis, |
| { | { |
| struct interface *ifp; | struct interface *ifp; |
| struct isis_area *area; | struct isis_area *area; |
| struct listnode *node; | |
| struct isis_circuit *circuit; | struct isis_circuit *circuit; |
| ifp = (struct interface *) vty->index; | ifp = (struct interface *) vty->index; |
| Line 2736 void | Line 2817 void |
| isis_circuit_init () | isis_circuit_init () |
| { | { |
| /* Initialize Zebra interface data structure */ | /* Initialize Zebra interface data structure */ |
| if_init (); | |
| if_add_hook (IF_NEW_HOOK, isis_if_new_hook); | if_add_hook (IF_NEW_HOOK, isis_if_new_hook); |
| if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook); | if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook); |