summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-23 00:03:29 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-23 00:03:29 +0900
commit12ae36fb0fecdd068fa4b3a8c1ea36d95b29bf7c (patch)
tree35f34946924dded3fbe59c5d6e4b7cd74e283bd5 /table/path.go
parent56f5c27011c50b3073cd30f5e9592da172203766 (diff)
table: not update timestamp if the path replaces the same path
If a new path has the exact same attributes that the existing one (after RouteRefresh), we don't update the timestamp. Signed-off-by: FUJITA Tomonori <fujita.tomonori@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 2916be1d..391e3298 100644
--- a/table/path.go
+++ b/table/path.go
@@ -41,6 +41,8 @@ type Path interface {
setMedSetByTargetNeighbor(medSetByTargetNeighbor bool)
getMedSetByTargetNeighbor() bool
clone(IsWithdraw bool) Path
+ getTimestamp() time.Time
+ setTimestamp(t time.Time)
MarshalJSON() ([]byte, error)
}
@@ -74,6 +76,14 @@ func NewPathDefault(rf bgp.RouteFamily, source *PeerInfo, nlri bgp.AddrPrefixInt
return path
}
+func (pd *PathDefault) getTimestamp() time.Time {
+ return pd.timestamp
+}
+
+func (pd *PathDefault) setTimestamp(t time.Time) {
+ pd.timestamp = t
+}
+
func (pd *PathDefault) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Network string