From 36f8911cee2557a0065ee291d03a6c6d88b537c0 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 23 Jan 2016 20:40:16 +0900 Subject: table: support sending/receiving EOR msg Signed-off-by: ISHIDA Wataru --- table/path.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'table/path.go') diff --git a/table/path.go b/table/path.go index 3837333f..bb3eb7a3 100644 --- a/table/path.go +++ b/table/path.go @@ -54,6 +54,7 @@ type originInfo struct { isFromZebra bool key string uuid []byte + eor bool } type Path struct { @@ -89,6 +90,24 @@ func NewPath(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool, pa } } +func NewEOR(family bgp.RouteFamily) *Path { + afi, safi := bgp.RouteFamilyToAfiSafi(family) + nlri, _ := bgp.NewPrefixFromRouteFamily(afi, safi) + return &Path{ + info: &originInfo{ + nlri: nlri, + eor: true, + }, + } +} + +func (path *Path) IsEOR() bool { + if path.info != nil && path.info.eor { + return true + } + return false +} + func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath { newASparams := make([]bgp.AsPathParamInterface, len(asAttr.Value)) for i, param := range asAttr.Value { -- cgit v1.2.3