diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-04-25 10:06:56 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-04-25 15:16:45 +0000 |
commit | 99cccf981227a482cbd6404b664bd4f7cc9a1720 (patch) | |
tree | e8c93e477bb245122e4771cfe879db6833bcc04e /table/table_manager.go | |
parent | 27d0d45b6319658bc0a43511d1909a411df40b08 (diff) |
table: add support for encapsulation nlri
add encap end point route(10.0.0.1) with vni 20
$ gobgp global rib add 10.0.0.1 20 -a encap
check it
$ gobgp global rib -a encap
Please specify one command of: add or del
Network Next Hop AS_PATH Age Attrs
*> 10.0.0.1 0.0.0.0 [64512] 00:00:01 [{Origin: IGP} {Encap: < VXLAN | color: 20 >}]
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index df89a2eb..d56c2e65 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -42,7 +42,7 @@ func (p *ProcessMessage) nlri2Path(now time.Time) []Path { // define local variable to pass nlri's address to CreatePath var nlri bgp.NLRInfo = nlri_info // create Path object - path := CreatePath(p.fromPeer, &nlri, pathAttributes, false, now) + path, _ := CreatePath(p.fromPeer, &nlri, pathAttributes, false, now) pathList = append(pathList, path) } return pathList @@ -56,7 +56,7 @@ func (p *ProcessMessage) withdraw2Path(now time.Time) []Path { // define local variable to pass nlri's address to CreatePath var w bgp.WithdrawnRoute = nlriWithdraw // create withdrawn Path object - path := CreatePath(p.fromPeer, &w, pathAttributes, true, now) + path, _ := CreatePath(p.fromPeer, &w, pathAttributes, true, now) pathList = append(pathList, path) } return pathList @@ -79,7 +79,7 @@ func (p *ProcessMessage) mpreachNlri2Path(now time.Time) []Path { for _, mp := range attrList { nlri_info := mp.Value for _, nlri := range nlri_info { - path := CreatePath(p.fromPeer, nlri, pathAttributes, false, now) + path, _ := CreatePath(p.fromPeer, nlri, pathAttributes, false, now) pathList = append(pathList, path) } } @@ -104,7 +104,7 @@ func (p *ProcessMessage) mpunreachNlri2Path(now time.Time) []Path { nlri_info := mp.Value for _, nlri := range nlri_info { - path := CreatePath(p.fromPeer, nlri, pathAttributes, true, now) + path, _ := CreatePath(p.fromPeer, nlri, pathAttributes, true, now) pathList = append(pathList, path) } } @@ -141,7 +141,8 @@ func NewTableManager(owner string, rfList []bgp.RouteFamily) *TableManager { t.Tables[bgp.RF_IPv4_VPN] = NewIPv4VPNTable(0) case bgp.RF_EVPN: t.Tables[bgp.RF_EVPN] = NewEVPNTable(0) - + case bgp.RF_ENCAP: + t.Tables[bgp.RF_ENCAP] = NewEncapTable() } } t.owner = owner |