summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-02-10 23:41:44 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-02-10 23:41:44 -0800
commit023a498e4a90982095c870c5491770bf4952fc2b (patch)
tree135c11a05d8ff106264d91f0965aa6d926ac861b /table/path.go
parentb19bbd415e8d33f01bcd407baece94ea1b81c957 (diff)
server: support graceful-restart helper-speaker behavior
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
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 {