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

Function NewPathAttributeNextHop

pkg/packet/bgp/bgp.go:12172–12189  ·  view source on GitHub ↗
(addr netip.Addr)

Source from the content-addressed store, hash-verified

12170}
12171
12172func NewPathAttributeNextHop(addr netip.Addr) (*PathAttributeNextHop, error) {
12173 if !addr.IsValid() {
12174 return nil, errors.New("invalid address")
12175 }
12176 t := BGP_ATTR_TYPE_NEXT_HOP
12177 l := net.IPv4len
12178 if addr.Is6() {
12179 l = net.IPv6len
12180 }
12181 return &PathAttributeNextHop{
12182 PathAttribute: PathAttribute{
12183 Flags: PathAttrFlags[t],
12184 Type: t,
12185 Length: uint16(l),
12186 },
12187 Value: addr,
12188 }, nil
12189}
12190
12191type PathAttributeMultiExitDisc struct {
12192 PathAttribute

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…