summaryrefslogtreecommitdiffhomepage
path: root/api/grpc_server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-08-01 09:56:40 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-08-02 10:48:58 +0900
commitb19731ffeab480bccb58d6b7a154ba72c29088e8 (patch)
treea4bbd7dfb0e23ef80d25a2b56a518581754df0b1 /api/grpc_server.go
parent1890b4c5ef28fde6cff478a78e1ded3a65badd6b (diff)
api/cli: api/cli support for unnumbered bgp
fron cli: ``` $ gobgp neighbor add interface eth1 as 65000 $ gobgp neighbor del interface eth1 $ gobgp neighbor eth1 Peer AS Up/Down State |#Advertised Received Accepted eth1 65000 00:00:05 Establ | 0 0 0 ``` Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r--api/grpc_server.go35
1 files changed, 19 insertions, 16 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go
index 875ce687..fe6e7f50 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -106,21 +106,22 @@ func (s *Server) GetNeighbor(ctx context.Context, arg *GetNeighborRequest) (*Get
}
return &Peer{
Conf: &PeerConf{
- NeighborAddress: pconf.Config.NeighborAddress,
- Id: s.Description,
- PeerAs: pconf.Config.PeerAs,
- LocalAs: pconf.Config.LocalAs,
- PeerType: uint32(pconf.Config.PeerType.ToInt()),
- AuthPassword: pconf.Config.AuthPassword,
- RemovePrivateAs: uint32(pconf.Config.RemovePrivateAs.ToInt()),
- RouteFlapDamping: pconf.Config.RouteFlapDamping,
- SendCommunity: uint32(pconf.Config.SendCommunity.ToInt()),
- Description: pconf.Config.Description,
- PeerGroup: pconf.Config.PeerGroup,
- RemoteCap: s.Capabilities.RemoteList,
- LocalCap: s.Capabilities.LocalList,
- PrefixLimits: prefixLimits,
- LocalAddress: localAddress,
+ NeighborAddress: pconf.Config.NeighborAddress,
+ Id: s.Description,
+ PeerAs: pconf.Config.PeerAs,
+ LocalAs: pconf.Config.LocalAs,
+ PeerType: uint32(pconf.Config.PeerType.ToInt()),
+ AuthPassword: pconf.Config.AuthPassword,
+ RemovePrivateAs: uint32(pconf.Config.RemovePrivateAs.ToInt()),
+ RouteFlapDamping: pconf.Config.RouteFlapDamping,
+ SendCommunity: uint32(pconf.Config.SendCommunity.ToInt()),
+ Description: pconf.Config.Description,
+ PeerGroup: pconf.Config.PeerGroup,
+ RemoteCap: s.Capabilities.RemoteList,
+ LocalCap: s.Capabilities.LocalList,
+ PrefixLimits: prefixLimits,
+ LocalAddress: localAddress,
+ NeighborInterface: pconf.Config.NeighborInterface,
},
Info: &PeerState{
BgpState: bgp.FSMState(s.SessionState.ToInt()).String(),
@@ -753,6 +754,7 @@ func (s *Server) AddNeighbor(ctx context.Context, arg *AddNeighborRequest) (*Add
pconf.Config.Description = a.Conf.Description
pconf.Config.PeerGroup = a.Conf.PeerGroup
pconf.Config.NeighborAddress = a.Conf.NeighborAddress
+ pconf.Config.NeighborInterface = a.Conf.NeighborInterface
}
if a.Timers != nil && a.Timers.Config != nil {
pconf.Timers.Config.ConnectRetry = float64(a.Timers.Config.ConnectRetry)
@@ -819,7 +821,8 @@ func (s *Server) AddNeighbor(ctx context.Context, arg *AddNeighborRequest) (*Add
func (s *Server) DeleteNeighbor(ctx context.Context, arg *DeleteNeighborRequest) (*DeleteNeighborResponse, error) {
return &DeleteNeighborResponse{}, s.bgpServer.DeleteNeighbor(&config.Neighbor{Config: config.NeighborConfig{
- NeighborAddress: arg.Peer.Conf.NeighborAddress,
+ NeighborAddress: arg.Peer.Conf.NeighborAddress,
+ NeighborInterface: arg.Peer.Conf.NeighborInterface,
}})
}