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

Method Append

internal/pkg/table/policy.go:952–971  ·  view source on GitHub ↗
(arg DefinedSet)

Source from the content-addressed store, hash-verified

950}
951
952func (lhs *regExpSet) Append(arg DefinedSet) error {
953 if lhs.Type() != arg.Type() {
954 return fmt.Errorf("can't append to different type of defined-set")
955 }
956 var list []*regexp.Regexp
957 switch lhs.Type() {
958 case DEFINED_TYPE_AS_PATH:
959 list = arg.(*AsPathSet).list
960 case DEFINED_TYPE_COMMUNITY:
961 list = arg.(*CommunitySet).list
962 case DEFINED_TYPE_EXT_COMMUNITY:
963 list = arg.(*ExtCommunitySet).list
964 case DEFINED_TYPE_LARGE_COMMUNITY:
965 list = arg.(*LargeCommunitySet).list
966 default:
967 return fmt.Errorf("invalid defined-set type: %d", lhs.Type())
968 }
969 lhs.list = append(lhs.list, list...)
970 return nil
971}
972
973func (lhs *regExpSet) Remove(arg DefinedSet) error {
974 if lhs.Type() != arg.Type() {

Callers

nothing calls this directly

Calls 2

TypeMethod · 0.95
TypeMethod · 0.65

Tested by

no test coverage detected