(peerP []*PeerInfo)
| 307 | } |
| 308 | |
| 309 | func 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 | |
| 324 | func updateMsgP1() *bgp.BGPMessage { |
| 325 | origin := bgp.NewPathAttributeOrigin(0) |
no test coverage detected
searching dependent graphs…