summaryrefslogtreecommitdiffhomepage
path: root/server/grpc_server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-28 12:59:28 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-28 12:59:28 +0900
commit427e9efa79b3cac87a5628698ef0662088fd856a (patch)
tree5e508afbab87096899e6c07fc121489279f6a9bf /server/grpc_server.go
parent9abc68f4e7327ce856a1e05aac64c576c26c1258 (diff)
add RPKI support
Just get info from ROA server. Not varidate any route yet. Currently, "--rpki-server" option enables RPKI: $ gobgpd --rpki-server 210.173.170.254:323 We'll use the configuration file for this later. You can see ROAs via CLI: $ gobgp rpki For ipv6, $ gobgp rpki -a v6 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r--server/grpc_server.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go
index 4a652c4f..a4e61be7 100644
--- a/server/grpc_server.go
+++ b/server/grpc_server.go
@@ -83,6 +83,7 @@ const (
REQ_MONITOR_GLOBAL_BEST_CHANGED
REQ_MONITOR_NEIGHBOR_PEER_STATE
REQ_MRT_GLOBAL_RIB
+ REQ_RPKI
)
const GRPC_PORT = 8080
@@ -621,6 +622,26 @@ END:
return err
}
+func (s *Server) GetRPKI(arg *api.Arguments, stream api.Grpc_GetRPKIServer) error {
+ rf, err := convertAf2Rf(arg.Af)
+ if err != nil {
+ return err
+ }
+ req := NewGrpcRequest(REQ_RPKI, "", rf, nil)
+ s.bgpServerCh <- req
+
+ for res := range req.ResponseCh {
+ if err := res.Err(); err != nil {
+ log.Debug(err.Error())
+ return err
+ }
+ if err := stream.Send(res.Data.(*api.ROA)); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
type GrpcRequest struct {
RequestType int
RemoteAddr string