speaker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package speaker provides a very basic BGP speaker.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	Logger:        &log.Logger,
	Passive:       true,
	LocalASN:      -1,
	LocalHoldTime: msg.OPEN_HOLDTIME,
	RemoteASN:     -1,
}

Default BGP speaker options

View Source
var (
	// remote hold timer expired
	EVENT_PEER_TIMEOUT = "bgpfix/speaker.PEER_TIMEOUT"
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Logger *zerolog.Logger // if nil logging is disabled

	Passive bool // if true, expect the peer to go first with OPEN

	LocalASN      int        // local ASN; -1 means use remote (if Passive)
	LocalHoldTime int        // local hold time (s); -1 means use a default
	LocalId       netip.Addr // local identifier; unspecified means use remote-1 (if Passive)
	LocalCaps     caps.Caps  // additional local capabilities; set to nil to block a capability

	RemoteASN      int        // expected remote ASN; -1 means accept any
	RemoteHoldTime int        // minimum remote hold time (s); <= 0 means any
	RemoteId       netip.Addr // expected remote identifier; unspecified means any
	RemoteCaps     caps.Caps  // minimum remote capabilities; set to nil to block a capability
}

Options are BGP speaker options, see also DefaultOptions

type Speaker

type Speaker struct {
	*zerolog.Logger

	Options Options // options; do not modify after Attach()
	// contains filtered or unexported fields
}

Speaker represents a basic BGP speaker for single-threaded use

func NewSpeaker

func NewSpeaker(ctx context.Context) *Speaker

NewSpeaker returns a new Speaker. Call Speaker.Attach() next.

func (*Speaker) Attach

func (s *Speaker) Attach(p *pipe.Pipe, dst msg.Dir) error

Attach attaches the speaker to given pipe input. Must not be called more than once.

Jump to

Keyboard shortcuts

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