An IP route iterator.
Private Functions
Friends
A route via iterator.
Private Functions
Friends
The manager for IP static route configuration.
Public Functions
Set the manager to only interact with routes with the given tag.
If this tag is set to a non-zero number, then methods on this class will only affect or expose routes with the given tag.
Returns the current tag, or 0 if no tag is set.
Resync provides a mechanism to set routes to a known state.
To start a resync, call resync_init() and then use ip_route_set() and ip_route_via_set() to populate the static routing table with the known entries. After all entries have been set, call resync_complete(), which will delete all existing routes and vias that were not added or modified during resync. If a tag is set, resync will only delete routes and vias corresponding to the current tag.
During resync, this manager will act like it is referencing a temporary table that starts off empty. Thus, methods like exist, del, and getters will act only on that temporary table, regardless of the real values in Sysdb. The one exception is iteration; they will traverse the table stored in Sysdb, regardless of whether or not the manager is in resync mode.
Completes any underway resync operation.
Iterates across all configured static routes. If a tag is set, only return routes that have match the current tag.
Iterates across configured nexthops for a given route key, i.e., emit all ip_route_via_t’s for a given route key. If a tag is set, only return vias on routes that match the current tag.
Tests for existence of any routes matching the route key in the config. If a tag is set and the route belongs to a different tag, this function returns false.
Tests if the given via exists.
Gets a static route, or panics if the route key does not exist.
Inserts or updates a static route into the switch configuration.
Removes all ECMP vias matching the route key, and the route itself.
Adds a via to an ip_route_t. Will call panic() if the corresponding route does not match the currently configured tag.
If the passed via has no IP address, interface or nexthop group set.
Removes a via from an ip_route_t. When all vias are removed, the route still exists with no nexthop information.
Protected Functions
Private Members
Typedefs
An IP route key, consisting of a prefix and preference.
Public Functions
Getter for ‘prefix’: the IP v4/v6 network prefix.
Setter for ‘prefix’.
Getter for ‘preference’: a value 0..255, defaults to 1.
Setter for ‘preference’.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of ip_route_key_t to the ostream.
An IP v4/v6 static route. “Via”, or nexthops, for this route are stored separately and are associated by route key.
Public Functions
Creates an IP static route for the route key.
Getter for ‘key’: the route’s key.
Setter for ‘key’.
Getter for ‘tag’: a numbered tag, used for table segregation.
Setter for ‘tag’.
Getter for ‘persistent’: indicates whether this route persists in system configuration. If true, the route appears in “show running-config”, and will be saved to startup-config if a “copy running start” or “write memory” CLI command is issued.
Setter for ‘persistent’.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of ip_route_t to the ostream.
A Via describing a particular set of nexthop information. A Via can describe either a nexthop group name to either forward traffic to, or drop traffic if the interface is Null0.
Public Functions
Creates a route via for a route key.
Getter for ‘route_key’: key for the route that this via is attached to.
Setter for ‘route_key’.
Getter for ‘hop’: IP v4/v6 nexthop address, or a default ip_addr_t if not set.
Setter for ‘hop’.
Getter for ‘intf’: use the named interface if not a default intf_id_t. Using intf Null0 installs a “drop” route for the given prefix and preference.
Setter for ‘intf’.
Getter for ‘nexthop_group’: name of the next-hop group to use. If this string is non-empty, the next-hop group of the given name will be used, and both “hop” and “intf” must be left to their default value otherwise we will panic(). Note this is currently only supported for IPv4 routes.
Setter for ‘nexthop_group’.
Getter for ‘mpls_label’: Push this MPLS label onto packets using this route.
Setter for ‘mpls_label’.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of ip_route_via_t to the ostream.