diff options
Diffstat (limited to 'isisd/isisd.c')
| -rw-r--r-- | isisd/isisd.c | 70 |
1 files changed, 66 insertions, 4 deletions
diff --git a/isisd/isisd.c b/isisd/isisd.c index 827e022baf..a802bac13b 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -32,6 +32,7 @@ #include "if.h" #include "hash.h" #include "filter.h" +#include "plist.h" #include "stream.h" #include "prefix.h" #include "table.h" @@ -315,6 +316,11 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name) "/frr-isisd:isis/instance/fast-reroute/level-1/lfa/load-sharing"); area->lfa_load_sharing[1] = yang_get_default_bool( "/frr-isisd:isis/instance/fast-reroute/level-2/lfa/load-sharing"); + area->attached_bit_send = + yang_get_default_bool("/frr-isisd:isis/instance/attach-send"); + area->attached_bit_rcv_ignore = yang_get_default_bool( + "/frr-isisd:isis/instance/attach-receive-ignore"); + #else area->max_lsp_lifetime[0] = DEFAULT_LSP_LIFETIME; /* 1200 */ area->max_lsp_lifetime[1] = DEFAULT_LSP_LIFETIME; /* 1200 */ @@ -331,6 +337,8 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name) area->lsp_mtu = DEFAULT_LSP_MTU; area->lfa_load_sharing[0] = true; area->lfa_load_sharing[1] = true; + area->attached_bit_send = true; + area->attached_bit_rcv_ignore = false; #endif /* ifndef FABRICD */ area->lfa_priority_limit[0] = SPF_PREFIX_PRIO_LOW; area->lfa_priority_limit[1] = SPF_PREFIX_PRIO_LOW; @@ -416,6 +424,22 @@ int isis_area_get(struct vty *vty, const char *area_tag) return CMD_SUCCESS; } +/* return the number of Level1 and level-1-2 routers or + * the number of Level2 and level-1-2 routers configured + */ +int isis_area_count(const struct isis *isis, int levels) +{ + struct isis_area *area; + struct listnode *node; + int count = 0; + + for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) + if (area->is_type & levels) + count++; + + return count; +} + void isis_area_destroy(struct isis_area *area) { struct listnode *node, *nnode; @@ -485,6 +509,7 @@ void isis_area_destroy(struct isis_area *area) thread_cancel(&area->t_tick); thread_cancel(&area->t_lsp_refresh[0]); thread_cancel(&area->t_lsp_refresh[1]); + thread_cancel(&area->t_rlfa_rib_update); thread_cancel_event(master, area); @@ -649,6 +674,34 @@ void isis_filter_update(struct access_list *access) } } +void isis_prefix_list_update(struct prefix_list *plist) +{ + struct isis *isis; + struct isis_area *area; + struct listnode *node, *anode; + + for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) { + for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) { + for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; + level++) { + const char *plist_name = + prefix_list_name(plist); + + if (!area->rlfa_plist_name[level - 1]) + continue; + + if (!strmatch(area->rlfa_plist_name[level - 1], + plist_name)) + continue; + + area->rlfa_plist[level - 1] = + prefix_list_lookup(AFI_IP, plist_name); + lsp_regenerate_schedule(area, area->is_type, 0); + } + } + } +} + #ifdef FABRICD static void area_set_mt_enabled(struct isis_area *area, uint16_t mtid, bool enabled) @@ -2517,12 +2570,21 @@ void isis_area_overload_bit_set(struct isis_area *area, bool overload_bit) #endif /* ifndef FABRICD */ } -void isis_area_attached_bit_set(struct isis_area *area, bool attached_bit) +void isis_area_attached_bit_send_set(struct isis_area *area, bool attached_bit) +{ + + if (attached_bit != area->attached_bit_send) { + area->attached_bit_send = attached_bit; + lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1); + } +} + +void isis_area_attached_bit_receive_set(struct isis_area *area, + bool attached_bit) { - char new_attached_bit = attached_bit ? LSPBIT_ATT : 0; - if (new_attached_bit != area->attached_bit) { - area->attached_bit = new_attached_bit; + if (attached_bit != area->attached_bit_rcv_ignore) { + area->attached_bit_rcv_ignore = attached_bit; lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1); } } |
