bgp

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) (*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) Close

func (s *Session) Close() error

Close shuts down the BGP session.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL