diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-06-27 14:47:48 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-07-04 09:30:48 +0900 |
commit | 04ce5ce2956d4e77dd4782adce7ab889625e3f08 (patch) | |
tree | 9167b91b72f581eb4d0f02387c94983f4f2cf0d2 /table/table_manager_test.go | |
parent | 547cd0893a5d426a1c34713026291f5cd55516fe (diff) |
use Destination instead of Path for path selection API
With Destination struct, multiple Paths can be moved from the table
package to the server package in a cleaner way; for features such as
add-path.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager_test.go')
-rw-r--r-- | table/table_manager_test.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/table/table_manager_test.go b/table/table_manager_test.go index 2a8ed2f6..ec979bf6 100644 --- a/table/table_manager_test.go +++ b/table/table_manager_test.go @@ -29,15 +29,12 @@ import ( // process BGPUpdate message // this function processes only BGPUpdate func (manager *TableManager) ProcessUpdate(fromPeer *PeerInfo, message *bgp.BGPMessage) ([]*Path, error) { - paths := ProcessMessage(message, fromPeer, time.Now()) - best, _, _ := manager.ProcessPaths([]string{GLOBAL_RIB_NAME}, paths) - paths2 := make([]*Path, 0, len(paths)) - for _, p := range best[GLOBAL_RIB_NAME] { - if p != nil { - paths2 = append(paths2, p) - } + pathList := make([]*Path, 0) + for _, d := range manager.ProcessPaths(ProcessMessage(message, fromPeer, time.Now())) { + b, _, _ := d.GetChanges(GLOBAL_RIB_NAME, false) + pathList = append(pathList, b) } - return paths2, nil + return pathList, nil } func getLogger(lv log.Level) *log.Logger { |