Added network ID option. Added mutex to routing table.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user