]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Datastructure modification for GR helper functionality.
authorrgirada <rgirada@vmware.com>
Fri, 25 Jun 2021 09:49:47 +0000 (02:49 -0700)
committerrgirada <rgirada@vmware.com>
Tue, 10 Aug 2021 09:57:23 +0000 (02:57 -0700)
Description:
Adding GR helper specific datastructures.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
ospf6d/ospf6_lsa.h
ospf6d/ospf6_neighbor.h
ospf6d/ospf6_top.h

index 4c95ee69bd82bff2631eac9ee61f2895bb0874de..a8ed9132dd9b1ca1cc360d2ce640ad549742350c 100644 (file)
@@ -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);
index 729b1d2e85d2e9de7be35798d9c57d2d12a707ce..a229897226be6e95517b7cd2101959d2e223402b 100644 (file)
@@ -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 */
index fe02cd3f84927bfe89812b18f274c4acec017b43..58ecf08495b9413ff9e36bb8b97b76587fae7a48 100644 (file)
@@ -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. */