summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-17 15:54:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-19 13:29:33 +0900
commitc14a63575c62addaf96c78f4de9aef6e3c430f0f (patch)
tree272698e91435a7cd0a765dee37069096f4052501 /packet/bgp.go
parent22b43f7ae7daf381520a529157be4c71c11c2bc8 (diff)
table: withdraw self-generated vrfed routes when a vrf deleted
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index a38f4bca..c910f310 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -1395,6 +1395,10 @@ func (er *EVPNEthernetAutoDiscoveryRoute) String() string {
return fmt.Sprintf("[type:A-D][rd:%s][esi:%s][etag:%d][label:%d]", er.RD, er.ESI, er.ETag, er.Label)
}
+func (er *EVPNEthernetAutoDiscoveryRoute) rd() RouteDistinguisherInterface {
+ return er.RD
+}
+
type EVPNMacIPAdvertisementRoute struct {
RD RouteDistinguisherInterface
ESI EthernetSegmentIdentifier
@@ -1487,6 +1491,10 @@ func (er *EVPNMacIPAdvertisementRoute) String() string {
return fmt.Sprintf("[type:macadv][rd:%s][esi:%s][etag:%d][mac:%s][ip:%s][labels:%v]", er.RD, er.ESI.String(), er.ETag, er.MacAddress, er.IPAddress, er.Labels)
}
+func (er *EVPNMacIPAdvertisementRoute) rd() RouteDistinguisherInterface {
+ return er.RD
+}
+
type EVPNMulticastEthernetTagRoute struct {
RD RouteDistinguisherInterface
ETag uint32
@@ -1541,6 +1549,10 @@ func (er *EVPNMulticastEthernetTagRoute) String() string {
return fmt.Sprintf("[type:multicast][rd:%s][etag:%d][ip:%s]", er.RD, er.ETag, er.IPAddress)
}
+func (er *EVPNMulticastEthernetTagRoute) rd() RouteDistinguisherInterface {
+ return er.RD
+}
+
type EVPNEthernetSegmentRoute struct {
RD RouteDistinguisherInterface
ESI EthernetSegmentIdentifier
@@ -1595,12 +1607,17 @@ type EVPNRouteTypeInterface interface {
DecodeFromBytes([]byte) error
Serialize() ([]byte, error)
String() string
+ rd() RouteDistinguisherInterface
}
func (er *EVPNEthernetSegmentRoute) String() string {
return fmt.Sprintf("[type:esi][rd:%s][esi:%d][ip:%s]", er.RD, er.ESI, er.IPAddress)
}
+func (er *EVPNEthernetSegmentRoute) rd() RouteDistinguisherInterface {
+ return er.RD
+}
+
func getEVPNRouteType(t uint8) (EVPNRouteTypeInterface, error) {
switch t {
case EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY:
@@ -1686,6 +1703,10 @@ func (n *EVPNNLRI) MarshalJSON() ([]byte, error) {
})
}
+func (n *EVPNNLRI) RD() RouteDistinguisherInterface {
+ return n.RouteTypeData.rd()
+}
+
func NewEVPNNLRI(routetype uint8, length uint8, routetypedata EVPNRouteTypeInterface) *EVPNNLRI {
return &EVPNNLRI{
routetype,