Removed router watcher code duplication. Small code refactor.

This commit is contained in:
Milos Gajdos
2019-06-13 15:12:07 +01:00
parent 6e669d4611
commit 6a33b7576b
6 changed files with 42 additions and 94 deletions

View File

@@ -2,6 +2,13 @@ package router
import "context"
var (
// DefaultLocalMetric is default route cost for local network
DefaultLocalMetric = 1
// DefaultNetworkMetric is default route cost for micro network
DefaultNetworkMetric = 10
)
// AddPolicy defines routing table addition policy
type AddPolicy int
@@ -10,8 +17,6 @@ const (
OverrideIfExists AddPolicy = iota
// IgnoreIfExists does not add new route
IgnoreIfExists
// ErrIfExists returns error if the route already exists
ErrIfExists
)
// RouteOption is used to define routing table entry options