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

Method AddDefinedSet

internal/pkg/table/policy.go:4303–4319  ·  view source on GitHub ↗
(s DefinedSet, replace bool)

Source from the content-addressed store, hash-verified

4301}
4302
4303func (r *RoutingPolicy) AddDefinedSet(s DefinedSet, replace bool) error {
4304 r.mu.Lock()
4305 defer r.mu.Unlock()
4306
4307 if m, ok := r.definedSetMap[s.Type()]; !ok {
4308 return fmt.Errorf("invalid defined-set type: %d", s.Type())
4309 } else {
4310 if d, ok := m[s.Name()]; ok && !replace {
4311 if err := d.Append(s); err != nil {
4312 return err
4313 }
4314 } else {
4315 m[s.Name()] = s
4316 }
4317 }
4318 return nil
4319}
4320
4321func (r *RoutingPolicy) DeleteDefinedSet(a DefinedSet, all bool) (err error) {
4322 r.mu.Lock()

Callers

nothing calls this directly

Calls 3

TypeMethod · 0.65
NameMethod · 0.65
AppendMethod · 0.65

Tested by

no test coverage detected