summaryrefslogtreecommitdiffhomepage
path: root/table/vrf.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-11-04 13:19:47 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-11-04 13:19:47 +0900
commita17832195c5fc42d6d0ec3dd7cc4868694bed88d (patch)
tree14381d27f1e58a6c399de90cc206d2433d8d366f /table/vrf.go
parent97bc9dd0da71ce743dbb7deb4a09f260ca518dcc (diff)
support neighbor belongs to VRF
$ gobgp vrf add red rd 100:100 rt both 100:100 $ gobgp neighbor add 10.0.0.1 as 2 vrf red $ gobgp vrf red neighbor Peer AS Up/Down State |#Advertised Received Accepted 10.0.0.1 2 never Active | 0 0 0 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/vrf.go')
-rw-r--r--table/vrf.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/table/vrf.go b/table/vrf.go
index 1440f896..480f963f 100644
--- a/table/vrf.go
+++ b/table/vrf.go
@@ -16,7 +16,6 @@
package table
import (
- "fmt"
"github.com/osrg/gobgp/packet/bgp"
)
@@ -28,30 +27,6 @@ type Vrf struct {
ExportRt []bgp.ExtendedCommunityInterface
}
-func (v *Vrf) ToGlobalPath(path *Path) error {
- nlri := path.GetNlri()
- switch rf := path.GetRouteFamily(); rf {
- case bgp.RF_IPv4_UC:
- n := nlri.(*bgp.IPAddrPrefix)
- path.OriginInfo().nlri = bgp.NewLabeledVPNIPAddrPrefix(n.Length, n.Prefix.String(), *bgp.NewMPLSLabelStack(0), v.Rd)
- case bgp.RF_IPv6_UC:
- n := nlri.(*bgp.IPv6AddrPrefix)
- path.OriginInfo().nlri = bgp.NewLabeledVPNIPv6AddrPrefix(n.Length, n.Prefix.String(), *bgp.NewMPLSLabelStack(0), v.Rd)
- case bgp.RF_EVPN:
- n := nlri.(*bgp.EVPNNLRI)
- switch n.RouteType {
- case bgp.EVPN_ROUTE_TYPE_MAC_IP_ADVERTISEMENT:
- n.RouteTypeData.(*bgp.EVPNMacIPAdvertisementRoute).RD = v.Rd
- case bgp.EVPN_INCLUSIVE_MULTICAST_ETHERNET_TAG:
- n.RouteTypeData.(*bgp.EVPNMulticastEthernetTagRoute).RD = v.Rd
- }
- default:
- return fmt.Errorf("unsupported route family for vrf: %s", rf)
- }
- path.SetExtCommunities(v.ExportRt, false)
- return nil
-}
-
func (v *Vrf) Clone() *Vrf {
f := func(rt []bgp.ExtendedCommunityInterface) []bgp.ExtendedCommunityInterface {
l := make([]bgp.ExtendedCommunityInterface, 0, len(rt))