summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/path.go')
-rw-r--r--table/path.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go
index bb3eb7a3..87ba4212 100644
--- a/table/path.go
+++ b/table/path.go
@@ -55,6 +55,7 @@ type originInfo struct {
key string
uuid []byte
eor bool
+ stale bool
}
type Path struct {
@@ -237,6 +238,7 @@ func (path *Path) ToApiStruct(id string) *api.Path {
Family: family,
SourceAsn: path.OriginInfo().source.AS,
SourceId: path.OriginInfo().source.ID.String(),
+ Stale: path.IsStale(),
}
}
@@ -308,6 +310,14 @@ func (path *Path) GetSource() *PeerInfo {
return path.OriginInfo().source
}
+func (path *Path) MarkStale(s bool) {
+ path.OriginInfo().stale = s
+}
+
+func (path *Path) IsStale() bool {
+ return path.OriginInfo().stale
+}
+
func (path *Path) GetSourceAs() uint32 {
attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_AS_PATH)
if attr != nil {