summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-04-25 10:06:56 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-04-25 15:16:45 +0000
commit99cccf981227a482cbd6404b664bd4f7cc9a1720 (patch)
treee8c93e477bb245122e4771cfe879db6833bcc04e /table/table.go
parent27d0d45b6319658bc0a43511d1909a411df40b08 (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.go')
-rw-r--r--table/table.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/table/table.go b/table/table.go
index 4739b292..b1434732 100644
--- a/table/table.go
+++ b/table/table.go
@@ -334,3 +334,22 @@ func (ipv4vpnt *EVPNTable) tableKey(nlri bgp.AddrPrefixInterface) string {
addrPrefix := nlri.(*bgp.EVPNNLRI)
return addrPrefix.String()
}
+
+type EncapTable struct {
+ *TableDefault
+}
+
+func NewEncapTable() *EncapTable {
+ EncapTable := &EncapTable{}
+ EncapTable.TableDefault = NewTableDefault(0)
+ EncapTable.TableDefault.ROUTE_FAMILY = bgp.RF_ENCAP
+ return EncapTable
+}
+
+func (t *EncapTable) createDest(nlri bgp.AddrPrefixInterface) Destination {
+ return Destination(NewEncapDestination(nlri))
+}
+
+func (t *EncapTable) tableKey(nlri bgp.AddrPrefixInterface) string {
+ return nlri.String()
+}