Added network ID option. Added mutex to routing table.

This commit is contained in:
Milos Gajdos
2019-06-07 17:20:22 +01:00
parent e4311c3a10
commit d7f0db04ec
4 changed files with 42 additions and 17 deletions

View File

@@ -8,6 +8,8 @@ import (
type Options struct {
// Address is router address
Address string
// Network defines micro network address
Network string
// RIB is Routing Information Base
RIB RIB
// Table is routing table
@@ -16,13 +18,6 @@ type Options struct {
Context context.Context
}
// RIBase allows to configure RIB
func RIBase(r RIB) Option {
return func(o *Options) {
o.RIB = r
}
}
// Address allows to set router address
func Address(a string) Option {
return func(o *Options) {
@@ -30,6 +25,20 @@ func Address(a string) Option {
}
}
// Network allows to set router network
func Network(n string) Option {
return func(o *Options) {
o.Network = n
}
}
// RIBase allows to configure RIB
func RIBase(r RIB) Option {
return func(o *Options) {
o.RIB = r
}
}
// RoutingTable allows to specify custom routing table
func RoutingTable(t Table) Option {
return func(o *Options) {