summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-23 16:19:04 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-12-23 16:19:04 -0800
commitc66c6b3b0469346c4ce05354552be2dec1e46ffa (patch)
tree28ce5f50a10aa3df9485089e4df793fe28e21a14 /server
parentb644f6b6bf6ef5c833f549664d45ff96ba962308 (diff)
server: update Uptime and UpdateRecvTime
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/peer.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index 23df06d9..5c26fc18 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -23,6 +23,7 @@ import (
"github.com/osrg/gobgp/table"
"gopkg.in/tomb.v2"
"net"
+ "time"
)
type Peer struct {
@@ -68,6 +69,7 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) {
pathList := peer.adjRib.GetOutPathList(table.RF_IPv4_UC)
peer.sendMessages(peer.path2update(pathList))
case bgp.BGP_MSG_UPDATE:
+ peer.peerConfig.BgpNeighborCommonState.UpdateRecvTime = time.Now()
msg := table.NewProcessMessage(m, peer.fsm.peerInfo)
pathList := msg.ToPathList()
if len(pathList) == 0 {
@@ -142,6 +144,7 @@ func (peer *Peer) loop() error {
if nextState == bgp.BGP_FSM_ESTABLISHED {
pathList := peer.adjRib.GetOutPathList(table.RF_IPv4_UC)
peer.sendMessages(peer.path2update(pathList))
+ peer.peerConfig.BgpNeighborCommonState.Uptime = time.Now()
peer.peerConfig.BgpNeighborCommonState.EstablishedCount++
}
if oldState == bgp.BGP_FSM_ESTABLISHED {