Documentation ¶
Index ¶
Constants ¶
const MainTableID = 254
MainTableID is the default routing table. IPRoute2 names the default routing table as 'main'
Variables ¶
This section is empty.
Functions ¶
func RoutePartiallyEqual ¶
RoutePartiallyEqual compares a limited set of route attributes. The reason for not using the Equal method associated with type netlink.Route is because a user will only specify a limited subset of fields but when we introspect routes seen on the system, other fields are populated by default and therefore won't be equal anymore with user defined routes. Compare a limited set of fields that we care about. Also, netlink.Routes Equal method doesn't compare MTU.
Types ¶
type Controller ¶
func NewController ¶
func NewController() *Controller
NewController manages routes which include adding and deletion of routes. It also manages restoration of managed routes. Begin managing routes by calling Run() to start the manager. Routes should be added via add(route) and deletion via del(route) functions only. All other functions are used internally.
func (*Controller) Add ¶
func (c *Controller) Add(r netlink.Route) error
Add submits a request to add a route
func (*Controller) Del ¶
func (c *Controller) Del(r netlink.Route) error
Del submits a request to del a route
func (*Controller) Run ¶
func (c *Controller) Run(stopCh <-chan struct{}, syncPeriod time.Duration)
Run starts route manager and syncs at least every syncPeriod