Documentation
¶
Index ¶
- Constants
- func ControlPacketByteLength(data []byte) int
- func GreaterUInt32(n ...uint32) uint32
- func UniqueStringsSorted(str []string) []string
- type AuthType
- type AuthenticationData
- type AuthenticationSection
- type ControlPacket
- type Diagnostic
- type Session
- type SessionConfig
- type SessionIntervalParams
- type SessionRole
- type State
Constants ¶
View Source
const ( StateAdminDown State = 0 // AdminDown StateDown State = 1 // Down StateInit State = 2 // Init StateUp State = 3 // Up DiagNone Diagnostic = 0 // No Diagnostic DiagTimeExpired Diagnostic = 1 // Control Detection Time Expired DiagEchoFailed Diagnostic = 2 // Echo Function Failed DiagNeighborSignalDown Diagnostic = 3 // Neighbor Signaled Session Down DiagForwardPlaneReset Diagnostic = 4 // Forwarding Plane Reset DiagPathDown Diagnostic = 5 // Path Down DiagConcatPathDown Diagnostic = 6 // Concatenated Path Down DiagAdminDown Diagnostic = 7 // Administratively Down DiagRevConcatPathDown Diagnostic = 8 // Reverse Concatenated Path Down )
Variables ¶
This section is empty.
Functions ¶
func ControlPacketByteLength ¶
func GreaterUInt32 ¶
func UniqueStringsSorted ¶
Types ¶
type AuthenticationData ¶
type AuthenticationData interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
}
type AuthenticationSection ¶
type AuthenticationSection struct {
AuthType AuthType
AuthLen uint8
AuthenticationData *AuthenticationData
}
func (AuthenticationSection) MarshalBinary ¶
func (authSect AuthenticationSection) MarshalBinary() (data []byte, err error)
func (*AuthenticationSection) UnmarshalBinary ¶
func (authSect *AuthenticationSection) UnmarshalBinary(data []byte) error
type ControlPacket ¶
type ControlPacket struct {
Version uint8
Diagnostic Diagnostic
State State
Poll bool
Final bool
ControlPlaneIndependent bool
AuthenticationPresent bool
Demand bool
Multipoint bool
DetectMult uint8
Length uint8
MyDiscriminator uint32
YourDiscriminator uint32
DesiredMinTXInterval uint32
RequiredMinRXInterval uint32
RequiredMinEchoRXInterval uint32
AuthenticationSection *AuthenticationSection
}
func UnmarshalReceivedControlPacket ¶
func UnmarshalReceivedControlPacket(data []byte) (cp *ControlPacket, err error)
func (*ControlPacket) MarshalBinary ¶
func (cp *ControlPacket) MarshalBinary() (data []byte, err error)
func (*ControlPacket) UnmarshalBinary ¶
func (cp *ControlPacket) UnmarshalBinary(data []byte) error
type Diagnostic ¶
type Diagnostic uint8
type Session ¶
type Session struct {
// channels
CpRxChan chan ControlPacket
CpTxChan chan ControlPacket
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(conf SessionConfig, logger *zap.SugaredLogger) *Session
func (*Session) LocalDiscr ¶
func (*Session) ManipulateIntervals ¶
func (*Session) RemoteDiscr ¶
func (*Session) SetAdminDown ¶
type SessionConfig ¶
type SessionIntervalParams ¶
type SessionIntervalParams struct {
// contains filtered or unexported fields
}
type SessionRole ¶
type SessionRole uint8
const ( SessionRoleActive SessionRole = iota SessionRolePassive SessionRole = iota )
Click to show internal directories.
Click to hide internal directories.