MCPcopy
hub / github.com/osrg/gobgp / AddDefinedSet

Method AddDefinedSet

pkg/server/server.go:4127–4138  ·  view source on GitHub ↗
(ctx context.Context, r *api.AddDefinedSetRequest)

Source from the content-addressed store, hash-verified

4125}
4126
4127func (s *BgpServer) AddDefinedSet(ctx context.Context, r *api.AddDefinedSetRequest) error {
4128 if r == nil || r.DefinedSet == nil {
4129 return fmt.Errorf("nil request")
4130 }
4131 return s.mgmtOperation(func() error {
4132 set, err := newDefinedSetFromApiStruct(r.DefinedSet)
4133 if err != nil {
4134 return err
4135 }
4136 return s.policy.AddDefinedSet(set, r.GetReplace())
4137 }, false)
4138}
4139
4140func (s *BgpServer) DeleteDefinedSet(ctx context.Context, r *api.DeleteDefinedSetRequest) error {
4141 if r == nil || r.DefinedSet == nil {

Callers 4

TestWatchEventFunction · 0.95
TestAddDefinedSetReplaceFunction · 0.95
TestGRPCWatchEventFunction · 0.95

Calls 4

mgmtOperationMethod · 0.95
GetReplaceMethod · 0.80
AddDefinedSetMethod · 0.65

Tested by 4

TestWatchEventFunction · 0.76
TestAddDefinedSetReplaceFunction · 0.76
TestGRPCWatchEventFunction · 0.76