From bbc640470e207a7c5d8a9bb4308dfed330f94412 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 17 Dec 2015 15:31:48 -0800 Subject: rpki: support multiple roa servers Signed-off-by: FUJITA Tomonori --- server/server.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 7f3e5756..c5875299 100644 --- a/server/server.go +++ b/server/server.go @@ -94,7 +94,7 @@ type BgpServer struct { neighborMap map[string]*Peer globalRib *table.TableManager zclient *zebra.Client - roaClient *roaClient + roaManager *roaManager bmpClient *bmpClient bmpConnCh chan *bmpConn shutdown bool @@ -115,7 +115,7 @@ func NewBgpServer(port int) *BgpServer { b.neighborMap = make(map[string]*Peer) b.listenPort = port b.watchers = make(map[watcherType]watcher) - b.roaClient, _ = newROAClient(0, config.RpkiServers{}) + b.roaManager, _ = newROAManager(0, config.RpkiServers{}) b.policy = table.NewRoutingPolicy() return &b } @@ -168,7 +168,7 @@ func (server *BgpServer) Serve() { } server.bmpClient, _ = newBMPClient(config.BmpServers{BmpServerList: []config.BmpServer{}}, server.bmpConnCh) - server.roaClient, _ = newROAClient(g.GlobalConfig.As, config.RpkiServers{}) + server.roaManager, _ = newROAManager(g.GlobalConfig.As, config.RpkiServers{}) if g.Mrt.FileName != "" { w, err := newMrtWatcher(g.Mrt.FileName) @@ -321,7 +321,7 @@ func (server *BgpServer) Serve() { select { case c := <-server.rpkiConfigCh: - server.roaClient, _ = newROAClient(server.bgpConfig.Global.GlobalConfig.As, c) + server.roaManager, _ = newROAManager(server.bgpConfig.Global.GlobalConfig.As, c) case c := <-server.bmpConfigCh: server.bmpClient, _ = newBMPClient(c, server.bmpConnCh) case c := <-server.bmpConnCh: @@ -344,8 +344,8 @@ func (server *BgpServer) Serve() { msgList: bmpMsgList, } server.broadcastMsgs = append(server.broadcastMsgs, m) - case rmsg := <-server.roaClient.recieveROA(): - server.roaClient.handleRTRMsg(rmsg) + case rmsg := <-server.roaManager.recieveROA(): + server.roaManager.handleROAEvent(rmsg) case zmsg := <-zapiMsgCh: m := handleZapiMsg(zmsg, server) if len(m) > 0 { @@ -875,7 +875,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg, incoming chan * msgs = append(msgs, newSenderMsg(peer, msgList)) } if len(pathList) > 0 { - server.roaClient.validate(pathList) + server.roaManager.validate(pathList) m, altered := server.propagateUpdate(peer, pathList) msgs = append(msgs, m...) @@ -1821,7 +1821,7 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { case REQ_MOD_RPKI: server.handleModRpki(grpcReq) case REQ_ROA, REQ_RPKI: - server.roaClient.handleGRPC(grpcReq) + server.roaManager.handleGRPC(grpcReq) case REQ_VRF, REQ_VRFS, REQ_VRF_MOD: pathList := server.handleVrfRequest(grpcReq) if len(pathList) > 0 { @@ -2397,7 +2397,7 @@ func (server *BgpServer) handleModRpki(grpcReq *GrpcRequest) { r.RpkiServerConfig.Address = net.ParseIP(arg.Address) r.RpkiServerConfig.Port = arg.Port server.bgpConfig.RpkiServers.RpkiServerList = append(server.bgpConfig.RpkiServers.RpkiServerList, r) - server.roaClient, _ = newROAClient(server.bgpConfig.Global.GlobalConfig.As, server.bgpConfig.RpkiServers) + server.roaManager, _ = newROAManager(server.bgpConfig.Global.GlobalConfig.As, server.bgpConfig.RpkiServers) grpcDone(grpcReq, nil) return } -- cgit v1.2.3