diff options
author | Marcus Wichelmann <mail@marcusw.de> | 2021-02-20 17:48:11 +0100 |
---|---|---|
committer | Marcus Wichelmann <mail@marcusw.de> | 2021-03-29 20:53:45 +0200 |
commit | 76f40ede0d466dfc7b1151d4e36b619a0daae51e (patch) | |
tree | b1480b30d563c827eb08e5c0051e983bcf9ea140 /pkg/server | |
parent | c1e7463e361632de60337cfd52dc44eb453d9746 (diff) |
Added DeleteDynamicNeighbor message to API
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/peer.go | 4 | ||||
-rw-r--r-- | pkg/server/server.go | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/pkg/server/peer.go b/pkg/server/peer.go index 4a7d5922..243a3dcc 100644 --- a/pkg/server/peer.go +++ b/pkg/server/peer.go @@ -57,6 +57,10 @@ func (pg *peerGroup) AddDynamicNeighbor(c *config.DynamicNeighbor) { pg.dynamicNeighbors[c.Config.Prefix] = c } +func (pg *peerGroup) DeleteDynamicNeighbor(prefix string) { + delete(pg.dynamicNeighbors, prefix) +} + func newDynamicPeer(g *config.Global, neighborAddress string, pg *config.PeerGroup, loc *table.TableManager, policy *table.RoutingPolicy) *peer { conf := config.Neighbor{ Config: config.NeighborConfig{ diff --git a/pkg/server/server.go b/pkg/server/server.go index 25fd31cc..090d97b8 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -3002,6 +3002,13 @@ func (s *BgpServer) DeletePeer(ctx context.Context, r *api.DeletePeerRequest) er }, true) } +func (s *BgpServer) DeleteDynamicNeighbor(ctx context.Context, r *api.DeleteDynamicNeighborRequest) error { + return s.mgmtOperation(func() error { + s.peerGroupMap[r.PeerGroup].DeleteDynamicNeighbor(r.Prefix) + return nil + }, true) +} + func (s *BgpServer) updatePeerGroup(pg *config.PeerGroup) (needsSoftResetIn bool, err error) { name := pg.Config.PeerGroupName |