From 99cccf981227a482cbd6404b664bd4f7cc9a1720 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 25 Apr 2015 10:06:56 +0000 Subject: 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 --- table/destination.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'table/destination.go') diff --git a/table/destination.go b/table/destination.go index cfd411ce..ead4797a 100644 --- a/table/destination.go +++ b/table/destination.go @@ -1041,3 +1041,15 @@ func (evpnd *EVPNDestination) MarshalJSON() ([]byte, error) { BestPathIdx: idx, }) } + +type EncapDestination struct { + *DestinationDefault +} + +func NewEncapDestination(nlri bgp.AddrPrefixInterface) *EncapDestination { + d := NewDestinationDefault(nlri) + d.ROUTE_FAMILY = bgp.RF_ENCAP + return &EncapDestination{ + DestinationDefault: d, + } +} -- cgit v1.2.3