From 0ed857ab63fee474225b2d218df5816f62a076c0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 16 Jul 2019 08:01:17 -0400 Subject: [PATCH] static: Start state tracking to know what we think the route is doing We need to track the state information in staticd of what we think the route is. Add the enum for this state and place it into the si. Signed-off-by: Donald Sharp --- staticd/static_routes.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/staticd/static_routes.h b/staticd/static_routes.h index 6036bfe396..6414947b16 100644 --- a/staticd/static_routes.h +++ b/staticd/static_routes.h @@ -44,6 +44,26 @@ typedef enum { STATIC_IPV6_GATEWAY_IFNAME, } static_types; +/* + * Route Creation gives us: + * START -> Initial State, only exit is when we send the route to + * zebra for installation + * When we send the route to Zebra move to SENT_TO_ZEBRA + * SENT_TO_ZEBRA -> A way to notice that we've sent the route to zebra + * But have not received a response on it's status yet + * After The response from zebra we move to INSTALLED or FAILED + * INSTALLED -> Route was accepted + * FAILED -> Route was rejected + * When we receive notification about a nexthop that a route uses + * We move the route back to START and initiate the process again. + */ +enum static_install_states { + STATIC_START, + STATIC_SENT_TO_ZEBRA, + STATIC_INSTALLED, + STATIC_NOT_INSTALLED, +}; + /* Static route information. */ struct static_route { /* For linked list. */ @@ -55,6 +75,12 @@ struct static_route { vrf_id_t nh_vrf_id; char nh_vrfname[VRF_NAMSIZ + 1]; + /* + * States that we walk the route through + * To know where we are. + */ + enum static_install_states state; + /* Administrative distance. */ uint8_t distance; -- 2.39.5