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;