(addr netip.Addr)
| 12170 | } |
| 12171 | |
| 12172 | func 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 | |
| 12191 | type PathAttributeMultiExitDisc struct { |
| 12192 | PathAttribute |
no outgoing calls
searching dependent graphs…