summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-04-02 22:23:26 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-04-02 22:23:26 +0900
commit0f122bd85d683836eb582ca67fd91ac2fb464b13 (patch)
treef38a623986b8f5b9c725361c6ce1c99dd3aa84dd /server
parent6a3bffa10435f0289a54b60b8cf85bbfdf0a66bc (diff)
api: simplify adj-in/out json format
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/peer.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/peer.go b/server/peer.go
index 6677e0bc..8ff38191 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -312,19 +312,18 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) {
pathList := peer.adjRib.GetOutPathList(restReq.RouteFamily)
peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))
case api.REQ_ADJ_RIB_IN, api.REQ_ADJ_RIB_OUT:
- adjrib := make(map[string][]table.Path)
rf := restReq.RouteFamily
if restReq.RequestType == api.REQ_ADJ_RIB_IN {
paths := peer.adjRib.GetInPathList(rf)
- adjrib[rf.String()] = paths
+ j, _ := json.Marshal(paths)
+ result.Data = j
log.Debugf("RouteFamily=%v adj-rib-in found : %d", rf.String(), len(paths))
} else {
paths := peer.adjRib.GetOutPathList(rf)
- adjrib[rf.String()] = paths
+ j, _ := json.Marshal(paths)
+ result.Data = j
log.Debugf("RouteFamily=%v adj-rib-out found : %d", rf.String(), len(paths))
}
- j, _ := json.Marshal(adjrib)
- result.Data = j
case api.REQ_NEIGHBOR_ENABLE, api.REQ_NEIGHBOR_DISABLE:
r := make(map[string]string)
if restReq.RequestType == api.REQ_NEIGHBOR_ENABLE {