diff --git a/protocols/bgp/packet/path_attributes.go b/protocols/bgp/packet/path_attributes.go index b62aacda0e58706f461bedfa513b1269919160b8..a859f4a08debe338450dc6c7f4cc692a1cddf45e 100644 --- a/protocols/bgp/packet/path_attributes.go +++ b/protocols/bgp/packet/path_attributes.go @@ -587,40 +587,6 @@ func (pa *PathAttribute) serializeLargeCommunities(buf *bytes.Buffer) uint8 { return length } -/*func (pa *PathAttribute) PrependASPath(prepend []uint32) { - if pa.TypeCode != ASPathAttr { - return - } - - asPath := pa.Value.(ASPath) - asPathSegementCount := len(asPath) - currentSegment := asPathSegementCount - 1 - - newSegmentNeeded := false - if asPath[asPathSegementCount-1].Type == ASSequence { - newSegmentNeeded = true - } else { - if len(asPath[asPathSegementCount-1].ASNs) >= MaxASNsSegment { - newSegmentNeeded = true - } - } - - for _, asn := range prepend { - if newSegmentNeeded { - segment := ASPathSegment{ - Type: ASSequence, - ASNs: make([]uint32, 0), - }, - } - - asPath[currentSegment].ASNs = append(asPath[currentSegment].ASNs, asn) - if len(asPath[asPathSegementCount-1].ASNs) >= MaxASNsSegment { - newSegmentNeeded = true - } - } - -}*/ - // ParseASPathStr converts an AS path from string representation info an PathAttribute object func ParseASPathStr(asPathString string) (*PathAttribute, error) { asPath := ASPath{}