summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-01 19:54:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-08 20:56:46 +0900
commitef934f76a52df814d5c77f9d0c3f9acaeb0856d9 (patch)
tree745f67a7fbc30cacf4286f99ec22434344ebcd08
parent74fd2e51ee6746440602250b11477ba96d86c258 (diff)
api: change arguments name from neighbor_address to name
planning to use this variable more generally (for vrf) Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--api/gobgp.pb.go15
-rw-r--r--api/gobgp.proto11
-rw-r--r--gobgp/monitor.go2
-rw-r--r--gobgp/neighbor.go20
-rw-r--r--server/grpc_server.go12
5 files changed, 31 insertions, 29 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index 436f6119..d37eaa3e 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -582,9 +582,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"`
- NeighborAddress string `protobuf:"bytes,3,opt,name=neighbor_address" json:"neighbor_address,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"`
+ Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
}
func (m *Arguments) Reset() { *m = Arguments{} }
@@ -600,10 +600,11 @@ func (m *Arguments) GetAf() *AddressFamily {
type ModPathArguments struct {
Resource Resource `protobuf:"varint,1,opt,name=resource,enum=api.Resource" json:"resource,omitempty"`
- IsWithdraw bool `protobuf:"varint,2,opt,name=is_withdraw" json:"is_withdraw,omitempty"`
- RawNlri []byte `protobuf:"bytes,3,opt,name=raw_nlri,proto3" json:"raw_nlri,omitempty"`
- RawPattrs [][]byte `protobuf:"bytes,4,rep,name=raw_pattrs,proto3" json:"raw_pattrs,omitempty"`
- NoImplicitWithdraw bool `protobuf:"varint,5,opt,name=no_implicit_withdraw" json:"no_implicit_withdraw,omitempty"`
+ Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
+ IsWithdraw bool `protobuf:"varint,3,opt,name=is_withdraw" json:"is_withdraw,omitempty"`
+ RawNlri []byte `protobuf:"bytes,4,opt,name=raw_nlri,proto3" json:"raw_nlri,omitempty"`
+ RawPattrs [][]byte `protobuf:"bytes,5,rep,name=raw_pattrs,proto3" json:"raw_pattrs,omitempty"`
+ NoImplicitWithdraw bool `protobuf:"varint,6,opt,name=no_implicit_withdraw" json:"no_implicit_withdraw,omitempty"`
}
func (m *ModPathArguments) Reset() { *m = ModPathArguments{} }
diff --git a/api/gobgp.proto b/api/gobgp.proto
index 74c0b993..92f9fcf5 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -55,15 +55,16 @@ message Error {
message Arguments {
Resource resource = 1;
AddressFamily af = 2;
- string neighbor_address = 3;
+ string name = 3;
}
message ModPathArguments {
Resource resource = 1;
- bool is_withdraw = 2;
- bytes raw_nlri = 3;
- repeated bytes raw_pattrs = 4;
- bool no_implicit_withdraw = 5;
+ string name = 2;
+ bool is_withdraw = 3;
+ bytes raw_nlri = 4;
+ repeated bytes raw_pattrs = 5;
+ bool no_implicit_withdraw = 6;
}
message PolicyArguments {
diff --git a/gobgp/monitor.go b/gobgp/monitor.go
index ae8d37e5..ebd68716 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{
- NeighborAddress: args[0],
+ Name: args[0],
}
} else {
arg = &api.Arguments{}
diff --git a/gobgp/neighbor.go b/gobgp/neighbor.go
index bc88e42d..bb0755f6 100644
--- a/gobgp/neighbor.go
+++ b/gobgp/neighbor.go
@@ -141,7 +141,7 @@ func showNeighbors() error {
func showNeighbor(args []string) error {
id := &api.Arguments{
- NeighborAddress: args[0],
+ Name: args[0],
}
p, e := client.GetNeighbor(context.Background(), id)
if e != nil {
@@ -430,9 +430,9 @@ func showNeighborRib(r string, remoteIP net.IP, args []string) error {
}
arg := &api.Arguments{
- Resource: resource,
- Af: rt,
- NeighborAddress: remoteIP.String(),
+ Resource: resource,
+ Af: rt,
+ Name: remoteIP.String(),
}
ps := paths{}
@@ -544,8 +544,8 @@ func resetNeighbor(cmd string, remoteIP net.IP, args []string) error {
return err
}
arg := &api.Arguments{
- NeighborAddress: remoteIP.String(),
- Af: rt,
+ Name: remoteIP.String(),
+ Af: rt,
}
switch cmd {
case CMD_RESET:
@@ -562,8 +562,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,
- NeighborAddress: remoteIP.String(),
+ Af: api.AF_IPV4_UC,
+ Name: remoteIP.String(),
}
var err error
switch cmd {
@@ -583,8 +583,8 @@ func showNeighborPolicy(remoteIP net.IP) error {
return err
}
arg := &api.Arguments{
- Af: rt,
- NeighborAddress: remoteIP.String(),
+ Af: rt,
+ Name: remoteIP.String(),
}
ap, e := client.GetNeighborPolicy(context.Background(), arg)
diff --git a/server/grpc_server.go b/server/grpc_server.go
index e72b42aa..17fb6c87 100644
--- a/server/grpc_server.go
+++ b/server/grpc_server.go
@@ -128,7 +128,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.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(REQ_NEIGHBOR, arg.Name, rf, nil)
s.bgpServerCh <- req
res := <-req.ResponseCh
@@ -174,7 +174,7 @@ func (s *Server) GetAdjRib(arg *api.Arguments, stream api.Grpc_GetAdjRibServer)
return err
}
- req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(reqType, arg.Name, rf, nil)
s.bgpServerCh <- req
for res := range req.ResponseCh {
@@ -206,7 +206,7 @@ func (s *Server) GetRib(arg *api.Arguments, stream api.Grpc_GetRibServer) error
return err
}
- req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(reqType, arg.Name, rf, nil)
s.bgpServerCh <- req
for res := range req.ResponseCh {
@@ -254,7 +254,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.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(REQ_MONITOR_NEIGHBOR_PEER_STATE, arg.Name, rf, nil)
s.bgpServerCh <- req
var err error
@@ -280,7 +280,7 @@ func (s *Server) neighbor(reqType int, arg *api.Arguments) (*api.Error, error) {
}
none := &api.Error{}
- req := NewGrpcRequest(reqType, arg.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(reqType, arg.Name, rf, nil)
s.bgpServerCh <- req
res := <-req.ResponseCh
@@ -360,7 +360,7 @@ func (s *Server) GetNeighborPolicy(ctx context.Context, arg *api.Arguments) (*ap
return nil, err
}
- req := NewGrpcRequest(REQ_NEIGHBOR_POLICY, arg.NeighborAddress, rf, nil)
+ req := NewGrpcRequest(REQ_NEIGHBOR_POLICY, arg.Name, rf, nil)
s.bgpServerCh <- req
res := <-req.ResponseCh