From 28ae39ae03a2d6c6727c82a93172003f5bd99d5d Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 29 Jul 2015 00:12:32 +0900 Subject: api: s/router_id/neighbor_address Signed-off-by: ISHIDA Wataru --- api/gobgp.pb.go | 8 ++++---- api/gobgp.proto | 4 ++-- gobgp/monitor.go | 2 +- gobgp/neighbor.go | 30 +++++++++++++++--------------- server/grpc_server.go | 14 +++++++------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go index 0d776960..40a1e596 100644 --- a/api/gobgp.pb.go +++ b/api/gobgp.pb.go @@ -573,9 +573,9 @@ func (m *Error) String() string { return proto.CompactTextString(m) } func (*Error) ProtoMessage() {} type Arguments struct { - Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"` - Af *AddressFamily `protobuf:"bytes,2,opt,name=af" json:"af,omitempty"` - RouterId string `protobuf:"bytes,3,opt,name=router_id" json:"router_id,omitempty"` + Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"` + Af *AddressFamily `protobuf:"bytes,2,opt,name=af" json:"af,omitempty"` + NeighborAddress string `protobuf:"bytes,3,opt,name=neighbor_address" json:"neighbor_address,omitempty"` } func (m *Arguments) Reset() { *m = Arguments{} } @@ -608,7 +608,7 @@ func (m *ModPathArguments) GetPath() *Path { type PolicyArguments struct { Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"` Operation Operation `protobuf:"varint,2,opt,name=operation,enum=api.Operation" json:"operation,omitempty"` - RouterId string `protobuf:"bytes,3,opt,name=router_id" json:"router_id,omitempty"` + NeighborAddress string `protobuf:"bytes,3,opt,name=neighbor_address" json:"neighbor_address,omitempty"` Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` PolicyDefinition *PolicyDefinition `protobuf:"bytes,6,opt,name=policy_definition" json:"policy_definition,omitempty"` ApplyPolicy *ApplyPolicy `protobuf:"bytes,7,opt,name=apply_policy" json:"apply_policy,omitempty"` diff --git a/api/gobgp.proto b/api/gobgp.proto index 98136bc6..b80964eb 100644 --- a/api/gobgp.proto +++ b/api/gobgp.proto @@ -55,7 +55,7 @@ message Error { message Arguments { Resource resource = 1; AddressFamily af = 2; - string router_id = 3; + string neighbor_address = 3; } message ModPathArguments { @@ -66,7 +66,7 @@ message ModPathArguments { message PolicyArguments { Resource resource = 1; Operation operation = 2; - string router_id = 3; + string neighbor_address = 3; string name = 4; PolicyDefinition policy_definition = 6; ApplyPolicy apply_policy = 7; diff --git a/gobgp/monitor.go b/gobgp/monitor.go index d21de0f3..ae8d37e5 100644 --- a/gobgp/monitor.go +++ b/gobgp/monitor.go @@ -75,7 +75,7 @@ func NewMonitorCmd() *cobra.Command { var arg *api.Arguments if len(args) > 0 { arg = &api.Arguments{ - RouterId: args[0], + NeighborAddress: args[0], } } else { arg = &api.Arguments{} diff --git a/gobgp/neighbor.go b/gobgp/neighbor.go index 7add621b..9774fc3d 100644 --- a/gobgp/neighbor.go +++ b/gobgp/neighbor.go @@ -141,7 +141,7 @@ func showNeighbors() error { func showNeighbor(args []string) error { id := &api.Arguments{ - RouterId: args[0], + NeighborAddress: args[0], } p, e := client.GetNeighbor(context.Background(), id) if e != nil { @@ -428,9 +428,9 @@ func showNeighborRib(r string, remoteIP net.IP, args []string) error { } arg := &api.Arguments{ - Resource: resource, - Af: rt, - RouterId: remoteIP.String(), + Resource: resource, + Af: rt, + NeighborAddress: remoteIP.String(), } ps := paths{} @@ -542,8 +542,8 @@ func resetNeighbor(cmd string, remoteIP net.IP, args []string) error { return err } arg := &api.Arguments{ - RouterId: remoteIP.String(), - Af: rt, + NeighborAddress: remoteIP.String(), + Af: rt, } switch cmd { case CMD_RESET: @@ -560,8 +560,8 @@ func resetNeighbor(cmd string, remoteIP net.IP, args []string) error { func stateChangeNeighbor(cmd string, remoteIP net.IP, args []string) error { arg := &api.Arguments{ - Af: api.AF_IPV4_UC, - RouterId: remoteIP.String(), + Af: api.AF_IPV4_UC, + NeighborAddress: remoteIP.String(), } var err error switch cmd { @@ -581,8 +581,8 @@ func showNeighborPolicy(remoteIP net.IP) error { return err } arg := &api.Arguments{ - Af: rt, - RouterId: remoteIP.String(), + Af: rt, + NeighborAddress: remoteIP.String(), } ap, e := client.GetNeighborPolicy(context.Background(), arg) @@ -661,11 +661,11 @@ func modNeighborPolicy(remoteIP net.IP, cmdType string, eArg []string) error { operation = api.Operation_DEL } arg := &api.PolicyArguments{ - Resource: api.Resource_POLICY_ROUTEPOLICY, - Operation: operation, - RouterId: remoteIP.String(), - Name: eArg[0], - ApplyPolicy: pol, + Resource: api.Resource_POLICY_ROUTEPOLICY, + Operation: operation, + NeighborAddress: remoteIP.String(), + Name: eArg[0], + ApplyPolicy: pol, } stream, err := client.ModNeighborPolicy(context.Background()) if err != nil { diff --git a/server/grpc_server.go b/server/grpc_server.go index a4e61be7..3c1c7b08 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -127,7 +127,7 @@ func (s *Server) Serve() error { func (s *Server) GetNeighbor(ctx context.Context, arg *api.Arguments) (*api.Peer, error) { var rf bgp.RouteFamily - req := NewGrpcRequest(REQ_NEIGHBOR, arg.RouterId, rf, nil) + req := NewGrpcRequest(REQ_NEIGHBOR, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req res := <-req.ResponseCh @@ -173,7 +173,7 @@ func (s *Server) GetAdjRib(arg *api.Arguments, stream api.Grpc_GetAdjRibServer) return err } - req := NewGrpcRequest(reqType, arg.RouterId, rf, nil) + req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req for res := range req.ResponseCh { @@ -205,7 +205,7 @@ func (s *Server) GetRib(arg *api.Arguments, stream api.Grpc_GetRibServer) error return err } - req := NewGrpcRequest(reqType, arg.RouterId, rf, nil) + req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req for res := range req.ResponseCh { @@ -253,7 +253,7 @@ END: func (s *Server) MonitorPeerState(arg *api.Arguments, stream api.Grpc_MonitorPeerStateServer) error { var rf bgp.RouteFamily - req := NewGrpcRequest(REQ_MONITOR_NEIGHBOR_PEER_STATE, arg.RouterId, rf, nil) + req := NewGrpcRequest(REQ_MONITOR_NEIGHBOR_PEER_STATE, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req var err error @@ -279,7 +279,7 @@ func (s *Server) neighbor(reqType int, arg *api.Arguments) (*api.Error, error) { } none := &api.Error{} - req := NewGrpcRequest(reqType, arg.RouterId, rf, nil) + req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req res := <-req.ResponseCh @@ -363,7 +363,7 @@ func (s *Server) GetNeighborPolicy(ctx context.Context, arg *api.Arguments) (*ap return nil, err } - req := NewGrpcRequest(REQ_NEIGHBOR_POLICY, arg.RouterId, rf, nil) + req := NewGrpcRequest(REQ_NEIGHBOR_POLICY, arg.NeighborAddress, rf, nil) s.bgpServerCh <- req res := <-req.ResponseCh @@ -408,7 +408,7 @@ func (s *Server) ModNeighborPolicy(stream api.Grpc_ModNeighborPolicyServer) erro reqType = REQ_NEIGHBOR_POLICY_DEL_DISTRIBUTE } } - req := NewGrpcRequest(reqType, arg.RouterId, rf, arg.ApplyPolicy) + req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, arg.ApplyPolicy) s.bgpServerCh <- req res := <-req.ResponseCh if err := res.Err(); err != nil { -- cgit v1.2.3