summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-05 17:44:25 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-05 17:44:25 -0800
commitb896584828aaf7f6287842f34dc37f15c0cde1b8 (patch)
tree15ce9ca1c9b75cc0e363cb779bdbebd969551075 /server/peer.go
parent626da9416938d54ae6a3925037c13a947d365d44 (diff)
cli: improve the state of neighbor
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/server/peer.go b/server/peer.go
index 516fc24e..96f6dfb3 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -293,23 +293,23 @@ func (peer *Peer) MarshalJSON() ([]byte, error) {
c := f.peerConfig
p := make(map[string]interface{})
+ capList := make([]int, 0)
+ for k, _ := range peer.capMap {
+ capList = append(capList, int(k))
+ }
p["conf"] = struct {
- RemoteIP string `json:"remote_ip"`
- Id string `json:"id"`
- //Description string `json:"description"`
- RemoteAS uint32 `json:"remote_as"`
- //LocalAddress string `json:"local_address"`
- //LocalPort int `json:"local_port"`
- CapRefresh bool `json:"cap_refresh"`
- CapEnhancedRefresh bool `json:"cap_enhanced_refresh"`
+ RemoteIP string `json:"remote_ip"`
+ Id string `json:"id"`
+ RemoteAS uint32 `json:"remote_as"`
+ CapRefresh bool `json:"cap_refresh"`
+ CapEnhancedRefresh bool `json:"cap_enhanced_refresh"`
+ CapList []int
}{
- RemoteIP: c.NeighborAddress.String(),
- Id: peer.peerInfo.ID.To4().String(),
- //Description: "",
- RemoteAS: c.PeerAs,
- //LocalAddress: f.passiveConn.LocalAddr().String(),
- //LocalPort: f.passiveConn.LocalAddr().(*net.TCPAddr).Port,
+ RemoteIP: c.NeighborAddress.String(),
+ Id: peer.peerInfo.ID.To4().String(),
+ RemoteAS: c.PeerAs,
+ CapList: capList,
CapRefresh: false,
CapEnhancedRefresh: false,
}