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

Function createPathWithExtCommunities

internal/pkg/table/community_match_chart_test.go:43–53  ·  view source on GitHub ↗
(ecs []bgp.ExtendedCommunityInterface)

Source from the content-addressed store, hash-verified

41}
42
43func createPathWithExtCommunities(ecs []bgp.ExtendedCommunityInterface) *Path {
44 p := netip.MustParsePrefix("10.0.0.0/24")
45 nlri, _ := bgp.NewIPAddrPrefix(p)
46 nexthop, _ := bgp.NewPathAttributeNextHop(netip.MustParseAddr("10.0.0.1"))
47 attrs := []bgp.PathAttributeInterface{
48 bgp.NewPathAttributeOrigin(0),
49 nexthop,
50 bgp.NewPathAttributeExtendedCommunities(ecs),
51 }
52 return NewPath(bgp.RF_IPv4_UC, nil, bgp.PathNLRI{NLRI: nlri}, false, attrs, time.Now(), false)
53}
54
55type communityChartCase struct {
56 Bench string

Callers 1

Calls 5

NewIPAddrPrefixFunction · 0.92
NewPathAttributeNextHopFunction · 0.92
NewPathAttributeOriginFunction · 0.92
NewPathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…