Changed router interface. Added table watcher. Advertise routes
* Changed router interface to return Advertisement channel * Added default gateway route to the routing table if supplied * Watch table for updates and advertise to the network * We hash the routes on 3-tuple (Destination, Gateway, Network)
This commit is contained in:
@@ -81,7 +81,7 @@ type tableWatcher struct {
|
||||
}
|
||||
|
||||
// Next returns the next noticed action taken on table
|
||||
// TODO: this needs to be thought through properly; we only allow watching particular route destination
|
||||
// TODO: this needs to be thought through properly; we only allow watching particular route destination for now
|
||||
func (w *tableWatcher) Next() (*Event, error) {
|
||||
for {
|
||||
select {
|
||||
@@ -93,6 +93,7 @@ func (w *tableWatcher) Next() (*Event, error) {
|
||||
if w.opts.Destination == res.Route.Destination {
|
||||
return res, nil
|
||||
}
|
||||
continue
|
||||
}
|
||||
case <-w.done:
|
||||
return nil, ErrWatcherStopped
|
||||
|
||||
Reference in New Issue
Block a user