From: rgirada Date: Fri, 25 Jun 2021 09:49:47 +0000 (-0700) Subject: ospf6d: Datastructure modification for GR helper functionality. X-Git-Tag: base_8.1~177^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=91c169f7d78e71417431c4297da008145da98d9d;p=mirror%2Ffrr.git ospf6d: Datastructure modification for GR helper functionality. Description: Adding GR helper specific datastructures. Signed-off-by: Rajesh Girada --- diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h index 4c95ee69bd..a8ed9132dd 100644 --- a/ospf6d/ospf6_lsa.h +++ b/ospf6d/ospf6_lsa.h @@ -70,7 +70,8 @@ #define OSPF6_LSTYPE_TYPE_7 0x2007 #define OSPF6_LSTYPE_LINK 0x0008 #define OSPF6_LSTYPE_INTRA_PREFIX 0x2009 -#define OSPF6_LSTYPE_SIZE 0x000a +#define OSPF6_LSTYPE_GRACE_LSA 0x000b +#define OSPF6_LSTYPE_SIZE 0x000c /* Masks for LS Type : RFC 2740 A.4.2.1 "LS type" */ #define OSPF6_LSTYPE_UBIT_MASK 0x8000 @@ -146,6 +147,9 @@ struct ospf6_lsa { /* lsa instance */ struct ospf6_lsa_header *header; + + /*For topo chg detection in HELPER role*/ + bool tobe_acknowledged; }; #define OSPF6_LSA_HEADERONLY 0x01 @@ -210,6 +214,14 @@ extern vector ospf6_lsa_handler_vector; continue; \ } +#define CHECK_LSA_TOPO_CHG_ELIGIBLE(type) \ + ((type == OSPF6_LSTYPE_ROUTER) \ + || (type == OSPF6_LSTYPE_NETWORK) \ + || (type == OSPF6_LSTYPE_INTER_PREFIX) \ + || (type == OSPF6_LSTYPE_INTER_ROUTER) \ + || (type == OSPF6_LSTYPE_AS_EXTERNAL) \ + || (type == OSPF6_LSTYPE_TYPE_7) \ + || (type == OSPF6_LSTYPE_INTRA_PREFIX)) /* Function Prototypes */ extern const char *ospf6_lstype_name(uint16_t type); diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 729b1d2e85..a229897226 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -32,6 +32,38 @@ extern unsigned char conf_debug_ospf6_neighbor; #define IS_OSPF6_DEBUG_NEIGHBOR(level) \ (conf_debug_ospf6_neighbor & OSPF6_DEBUG_NEIGHBOR_##level) +struct ospf6_helper_info { + + /* Grace interval received from + * Restarting Router. + */ + uint32_t recvd_grace_period; + + /* Grace interval used for grace + * gracetimer. + */ + uint32_t actual_grace_period; + + /* Grace timer,This Router acts as + * helper until this timer until + * this timer expires. + */ + struct thread *t_grace_timer; + + /* Helper status */ + uint32_t gr_helper_status; + + /* Helper exit reason*/ + uint32_t helper_exit_reason; + + /* Planned/Unplanned restart*/ + uint32_t gr_restart_reason; + + + /* Helper rejected reason */ + uint32_t rejected_reason; +}; + /* Neighbor structure */ struct ospf6_neighbor { /* Neighbor Router ID String */ @@ -104,6 +136,9 @@ struct ospf6_neighbor { /* BFD information */ struct bfd_session_params *bfd_session; + + /* ospf6 graceful restart HELPER info */ + struct ospf6_helper_info gr_helper_info; }; /* Neighbor state */ diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h index fe02cd3f84..58ecf08495 100644 --- a/ospf6d/ospf6_top.h +++ b/ospf6d/ospf6_top.h @@ -60,6 +60,43 @@ struct ospf6_redist { #define ROUTEMAP(R) (R->route_map.map) }; +struct ospf6_gr_helper { + /* Gracefull restart Helper supported configs*/ + /* Supported grace interval*/ + uint32_t supported_grace_time; + + /* Helper support + * Supported : True + * Not Supported : False. + */ + bool is_helper_supported; + + /* Support for strict LSA check. + * if it is set,Helper aborted + * upon a TOPO change. + */ + bool strict_lsa_check; + + /* Support as HELPER only for + * planned restarts. + */ + bool only_planned_restart; + + /* This list contains the advertisement + * routerids for which Helper support is + * enabled. + */ + struct hash *enable_rtr_list; + + /* HELPER for number of active + * RESTARTERs. + */ + int active_restarter_cnt; + + /* last HELPER exit reason */ + uint32_t last_exit_reason; +}; + /* OSPFv3 top level data structure */ struct ospf6 { /* The relevant vrf_id */ @@ -154,6 +191,10 @@ struct ospf6 { * to support ECMP. */ uint16_t max_multipath; + + /*ospf6 Graceful restart helper info */ + struct ospf6_gr_helper ospf6_helper_cfg; + /* Count of NSSA areas */ uint8_t anyNSSA; struct thread *t_abr_task; /* ABR task timer. */