Documentation
¶
Index ¶
Constants ¶
View Source
const ( M_OPEN = 1 M_UPDATE = 2 M_NOTIFICATION = 3 M_KEEPALIVE = 4 IGP = 0 EGP = 1 //https://www.rfc-editor.org/rfc/rfc3392.txt CAPABILITIES_OPTIONAL_PARAMETER = 2 // Capabilities Optional Parameter (Parameter Type 2) // https://www.iana.org/assignments/capability-codes/capability-codes.xhtml BGP4_MP = 1 //Multiprotocol Extensions for BGP-4 // Path attribute types ORIGIN = 1 AS_PATH = 2 NEXT_HOP = 3 MULTI_EXIT_DISC = 4 LOCAL_PREF = 5 COMMUNITIES = 8 MP_REACH_NLRI = 14 // Multiprotocol Reachable NLRI - MP_REACH_NLRI (Type Code 14) MP_UNREACH_NLRI = 15 // Multiprotocol Unreachable NLRI - MP_UNREACH_NLRI (Type Code 15) AS_SET = 1 AS_SEQUENCE = 2 // NOTIFICATION ERROR CODES MESSAGE_HEADER_ERROR = 1 // [RFC4271] OPEN_MESSAGE_ERROR = 2 // [RFC4271] UPDATE_MESSAGE_ERROR = 3 // [RFC4271] HOLD_TIMER_EXPIRED = 4 // [RFC4271] FSM_ERROR = 5 // [RFC4271] CEASE = 6 // [RFC4271] ROUTE_REFRESH_MESSAGE_ERROR = 7 // [RFC7313] UNSUPPORTED_VERSION_NUMBER = 1 // OPEN_MESSAGE_ERROR BAD_BGP_ID = 3 // OPEN_MESSAGE_ERROR UNNACEPTABLE_HOLD_TIME = 6 // OPEN_MESSAGE_ERROR BAD_MESSAGE_TYPE = 3 // MESSAGE_HEADER_ERROR ADMINISTRATIVE_SHUTDOWN = 2 // CEASE OUT_OF_RESOURCES = 8 // CEASE WTCR = 64 // (Well-known, Transitive, Complete, Regular length) WTCE = 80 // (Well-known, Transitive, Complete, Extended length) ONCR = 128 // (Optional, Non-transitive, Complete, Regular length) ONCE = 144 // (Optional, Non-transitive, Complete, Extended length) OTCR = 192 // (Optional, Transitive, Complete, Regular length) OTCE = 208 // (Optional, Transitive, Complete, Extended length) )
View Source
const ( IDLE = "IDLE" ACTIVE = "ACTIVE" CONNECT = "CONNECT" OPEN_SENT = "OPEN_SENT" OPEN_CONFIRM = "OPEN_CONFIRM" ESTABLISHED = "ESTABLISHED" )
View Source
const ( CONNECTION_FAILED = iota REMOTE_SHUTDOWN LOCAL_SHUTDOWN INVALID_LOCALIP )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Community ¶
type Community uint32
func (*Community) MarshalJSON ¶
func (*Community) UnmarshalJSON ¶
type IP6 ¶ added in v0.1.0
type IP6 [16]byte
func (IP6) MarshalJSON ¶ added in v0.1.0
func (*IP6) UnmarshalJSON ¶ added in v0.1.0
type IPNet ¶
func (*IPNet) MarshalJSON ¶
func (*IPNet) UnmarshalJSON ¶
func (*IPNet) UnmarshalText ¶
type Parameters ¶
type Parameters struct {
// only used at session start
ASNumber uint16 `json:"as_number,omitempty"`
HoldTime uint16 `json:"hold_time,omitempty"`
SourceIP IP4 `json:"source_ip,omitempty"` // not sure that this can be used with Dial()
NextHop4 IP4 `json:"next_hop_4,omitempty"`
NextHop6 IP6 `json:"next_hop_6,omitempty"`
Multiprotocol bool `json:"multiprotocol,omitempty"`
// can change during session
MED uint32 `json:"med,omitempty"`
LocalPref uint32 `json:"local_pref,omitempty"`
Communities []Community `json:"communities,omitempty"`
Accept []netip.Prefix `json:"accept,omitempty"`
Reject []netip.Prefix `json:"reject,omitempty"`
}
func (*Parameters) Diff ¶
func (a *Parameters) Diff(b Parameters) bool
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) Configure ¶
func (p *Pool) Configure(c map[string]Parameters)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) Configure ¶
func (s *Session) Configure(p Parameters)
type Status ¶
type Status struct {
State string `json:"state"`
When time.Time `json:"when"`
Duration time.Duration `json:"duration_s"`
UpdateCalculation time.Duration `json:"update_calculation_ms"`
Advertised uint64 `json:"advertised_routes"`
Withdrawn uint64 `json:"withdrawn_routes"`
Prefixes int `json:"current_routes"`
Attempts uint64 `json:"connection_attempts"`
Connections uint64 `json:"successful_connections"`
Established uint64 `json:"established_sessions"`
LastError string `json:"last_error"`
HoldTime uint16 `json:"hold_time"`
LocalASN uint16 `json:"local_asn"`
RemoteASN uint16 `json:"remote_asn"`
AdjRIBOut []string `json:"adj_rib_out"`
LocalIP string `json:"local_ip"`
}
Click to show internal directories.
Click to hide internal directories.