github.com/bgpfix/bgpfix@v0.2.0/speaker/options.go (about)

     1  package speaker
     2  
     3  import (
     4  	"net/netip"
     5  
     6  	"github.com/bgpfix/bgpfix/caps"
     7  	"github.com/bgpfix/bgpfix/msg"
     8  	"github.com/rs/zerolog"
     9  	"github.com/rs/zerolog/log"
    10  )
    11  
    12  // Default BGP speaker options
    13  var DefaultOptions = Options{
    14  	Logger:        &log.Logger,
    15  	Passive:       true,
    16  	LocalASN:      -1,
    17  	LocalHoldTime: msg.OPEN_HOLDTIME,
    18  	RemoteASN:     -1,
    19  }
    20  
    21  // Options are BGP speaker options, see also DefaultOptions
    22  type Options struct {
    23  	Logger *zerolog.Logger // if nil logging is disabled
    24  
    25  	Passive bool // if true, expect the peer to go first with OPEN
    26  
    27  	LocalASN      int        // local ASN; -1 means use remote (if Passive)
    28  	LocalHoldTime int        // local hold time (s); -1 means use a default
    29  	LocalId       netip.Addr // local identifier; unspecified means use remote-1 (if Passive)
    30  	LocalCaps     caps.Caps  // additional local capabilities; set to nil to block a capability
    31  
    32  	RemoteASN      int        // expected remote ASN; -1 means accept any
    33  	RemoteHoldTime int        // minimum remote hold time (s); <= 0 means any
    34  	RemoteId       netip.Addr // expected remote identifier; unspecified means any
    35  	RemoteCaps     caps.Caps  // minimum remote capabilities; set to nil to block a capability
    36  }