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

Function PathCreatePath

internal/pkg/table/path_test.go:309–322  ·  view source on GitHub ↗
(peerP []*PeerInfo)

Source from the content-addressed store, hash-verified

307}
308
309func PathCreatePath(peerP []*PeerInfo) []*Path {
310 bgpMsgP1 := updateMsgP1()
311 bgpMsgP2 := updateMsgP2()
312 bgpMsgP3 := updateMsgP3()
313 pathP := make([]*Path, 3)
314 for i, msg := range []*bgp.BGPMessage{bgpMsgP1, bgpMsgP2, bgpMsgP3} {
315 updateMsgP := msg.Body.(*bgp.BGPUpdate)
316 nlriList := updateMsgP.NLRI
317 pathAttributes := updateMsgP.PathAttributes
318 nlri_info := nlriList[0]
319 pathP[i] = NewPath(bgp.RF_IPv4_UC, peerP[i], bgp.PathNLRI{NLRI: nlri_info.NLRI}, false, pathAttributes, time.Now(), false)
320 }
321 return pathP
322}
323
324func updateMsgP1() *bgp.BGPMessage {
325 origin := bgp.NewPathAttributeOrigin(0)

Callers 6

TestPathNewIPv4Function · 0.85
TestPathNewIPv6Function · 0.85
TestPathGetPrefixFunction · 0.85
TestPathGetAttributeFunction · 0.85
TestGetPathAttrsFunction · 0.85

Calls 4

updateMsgP1Function · 0.85
updateMsgP2Function · 0.85
updateMsgP3Function · 0.85
NewPathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…