diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-09-30 05:50:25 -0700 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-09-30 05:50:25 -0700 |
commit | dfe1b71fd28496110436ff15bf135feec02f181e (patch) | |
tree | 9baa416de7f16cf6bf333034f43333a68a038364 /table | |
parent | 8f4603b25a08046937ede81efbc3062eebf89067 (diff) |
api: add id to VrfRequest
to support VRF ID for Zebra Protocol v3.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/table_manager.go | 3 | ||||
-rw-r--r-- | table/vrf.go | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index f6bebbf7..f93c3a54 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -164,7 +164,7 @@ func (manager *TableManager) getNextLabel() (uint32, error) { return label, nil } -func (manager *TableManager) AddVrf(name string, rd bgp.RouteDistinguisherInterface, importRt, exportRt []bgp.ExtendedCommunityInterface, info *PeerInfo) ([]*Path, error) { +func (manager *TableManager) AddVrf(name string, id uint32, rd bgp.RouteDistinguisherInterface, importRt, exportRt []bgp.ExtendedCommunityInterface, info *PeerInfo) ([]*Path, error) { if _, ok := manager.Vrfs[name]; ok { return nil, fmt.Errorf("vrf %s already exists", name) } @@ -177,6 +177,7 @@ func (manager *TableManager) AddVrf(name string, rd bgp.RouteDistinguisherInterf }).Debugf("add vrf") manager.Vrfs[name] = &Vrf{ Name: name, + Id: id, Rd: rd, ImportRt: importRt, ExportRt: exportRt, diff --git a/table/vrf.go b/table/vrf.go index 18a5af87..83b9e353 100644 --- a/table/vrf.go +++ b/table/vrf.go @@ -22,6 +22,7 @@ import ( type Vrf struct { Name string + Id uint32 Rd bgp.RouteDistinguisherInterface ImportRt []bgp.ExtendedCommunityInterface ExportRt []bgp.ExtendedCommunityInterface @@ -62,6 +63,7 @@ func (v *Vrf) Clone() *Vrf { } return &Vrf{ Name: v.Name, + Id: v.Id, Rd: v.Rd, ImportRt: f(v.ImportRt), ExportRt: f(v.ExportRt), |