Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advertisement ¶
type Advertisement struct { // The prefix being advertised to the peer. Prefix *net.IPNet // The address of the router to which the peer should forward traffic. NextHop net.IP // The local preference of this route. Only propagated to IBGP // peers (i.e. where the peer ASN matches the local ASN). LocalPref uint32 // BGP communities to attach to the path. Communities []uint32 }
Advertisement represents one network path and its BGP attributes.
func (*Advertisement) Equal ¶
func (a *Advertisement) Equal(b *Advertisement) bool
Equal returns true if a and b are equivalent advertisements.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents one BGP session to an external router.
func New ¶
func New(l log.Logger, addr string, asn uint32, routerID net.IP, peerASN uint32, holdTime time.Duration, password string, myNode string) (*Session, error)
New creates a BGP session using the given session parameters.
The session will immediately try to connect and synchronize its local state with the peer.
func (*Session) Set ¶
func (s *Session) Set(advs ...*Advertisement) error
Set updates the set of Advertisements that this session's peer should receive.
Changes are propagated to the peer asynchronously, Set may return before the peer learns about the changes.
Click to show internal directories.
Click to hide internal directories.