diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-05-01 10:06:42 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-05-01 10:16:09 +0000 |
commit | 232b30117c8eafc5cae7aec81ce9fafe742bdd4b (patch) | |
tree | 235342a7345b6034f02a1864485a4c96e25d3ea2 /table/table.go | |
parent | cea5941db2dd9268ad35b5f494480350d747d404 (diff) |
table: add support for route target constraint nlri
add rtc route
$ gobgp global rib add 65000 77 -a rtc
check it
$ gobgp global rib -a rtc
Network Next Hop AS_PATH Age Attrs
*> 65001:65000:75 0.0.0.0 [65001] 00:15:35 [{Origin: IGP}]
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table.go')
-rw-r--r-- | table/table.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/table/table.go b/table/table.go index b1434732..22499f5a 100644 --- a/table/table.go +++ b/table/table.go @@ -353,3 +353,22 @@ func (t *EncapTable) createDest(nlri bgp.AddrPrefixInterface) Destination { func (t *EncapTable) tableKey(nlri bgp.AddrPrefixInterface) string { return nlri.String() } + +type RouteTargetTable struct { + *TableDefault +} + +func NewRouteTargetTable() *RouteTargetTable { + routeTargetTable := &RouteTargetTable{} + routeTargetTable.TableDefault = NewTableDefault(0) + routeTargetTable.TableDefault.ROUTE_FAMILY = bgp.RF_RTC_UC + return routeTargetTable +} + +func (t *RouteTargetTable) createDest(nlri bgp.AddrPrefixInterface) Destination { + return Destination(NewRouteTargetDestination(nlri)) +} + +func (t *RouteTargetTable) tableKey(nlri bgp.AddrPrefixInterface) string { + return nlri.String() +} |