func (h *BFDAuthHeader) Length() int {
	switch h.AuthType {
	case BFDAuthTypePassword:
		return 3 + len(h.Data)
	case BFDAuthTypeKeyedMD5, BFDAuthTypeMeticulousKeyedMD5:
		return 8 + len(h.Data)
	case BFDAuthTypeKeyedSHA1, BFDAuthTypeMeticulousKeyedSHA1:
		return 8 + len(h.Data)
	default:
		return 0
	}
}
Length returns the data length of the BFDAuthHeader based on the
authentication type
package layers
import (
	"encoding/binary"
	"errors"
	"github.com/google/gopacket"
)
const bfdMinimumRecordSizeInBytes int = 24
type BFDVersion uint8
type BFDDiagnostic uint8
const (
	BFDDiagnosticNone               BFDDiagnostic = 0  
	BFDDiagnosticTimeExpired        BFDDiagnostic = 1  
	BFDDiagnosticEchoFailed         BFDDiagnostic = 2  
	BFDDiagnosticNeighborSignalDown BFDDiagnostic = 3  
	BFDDiagnosticForwardPlaneReset  BFDDiagnostic = 4  
	BFDDiagnosticPathDown           BFDDiagnostic = 5  
	BFDDiagnosticConcatPathDown     BFDDiagnostic = 6  
	BFDDiagnosticAdminDown          BFDDiagnostic = 7  
	BFDDiagnosticRevConcatPathDown  BFDDiagnostic = 8  
)
func (bd BFDDiagnostic) String() string {
	switch bd {
	default:
		return "Unknown"
	case BFDDiagnosticNone:
		return "None"
	case BFDDiagnosticTimeExpired:
		return "Control Detection Time Expired"
	case BFDDiagnosticEchoFailed:
		return "Echo Function Failed"
	case BFDDiagnosticNeighborSignalDown:
		return "Neighbor Signaled Session Down"
	case BFDDiagnosticForwardPlaneReset:
		return "Forwarding Plane Reset"
	case BFDDiagnosticPathDown:
		return "Path Down"
	case BFDDiagnosticConcatPathDown:
		return "Concatenated Path Down"
	case BFDDiagnosticAdminDown:
		return "Administratively Down"
	case BFDDiagnosticRevConcatPathDown:
		return "Reverse Concatenated Path Down"
	}
}
type BFDState uint8
const (
	BFDStateAdminDown BFDState = 0
	BFDStateDown      BFDState = 1
	BFDStateInit      BFDState = 2
	BFDStateUp        BFDState = 3
)
func (s BFDState) String() string {
	switch s {
	default:
		return "Unknown"
	case BFDStateAdminDown:
		return "Admin Down"
	case BFDStateDown:
		return "Down"
	case BFDStateInit:
		return "Init"
	case BFDStateUp:
		return "Up"
	}
}
type BFDDetectMultiplier uint8
type BFDDiscriminator uint32
type BFDTimeInterval uint32
type BFDAuthType uint8
const (
	BFDAuthTypeNone                BFDAuthType = 0  
	BFDAuthTypePassword            BFDAuthType = 1  
	BFDAuthTypeKeyedMD5            BFDAuthType = 2  
	BFDAuthTypeMeticulousKeyedMD5  BFDAuthType = 3  
	BFDAuthTypeKeyedSHA1           BFDAuthType = 4  
	BFDAuthTypeMeticulousKeyedSHA1 BFDAuthType = 5  
)
func (at BFDAuthType) String() string {
	switch at {
	default:
		return "Unknown"
	case BFDAuthTypeNone:
		return "No Authentication"
	case BFDAuthTypePassword:
		return "Simple Password"
	case BFDAuthTypeKeyedMD5:
		return "Keyed MD5"
	case BFDAuthTypeMeticulousKeyedMD5:
		return "Meticulous Keyed MD5"
	case BFDAuthTypeKeyedSHA1:
		return "Keyed SHA1"
	case BFDAuthTypeMeticulousKeyedSHA1:
		return "Meticulous Keyed SHA1"
	}
}
type BFDAuthKeyID uint8
type BFDAuthSequenceNumber uint32
type BFDAuthData []byte
type BFDAuthHeader struct {
	AuthType       BFDAuthType
	KeyID          BFDAuthKeyID
	SequenceNumber BFDAuthSequenceNumber
	Data           BFDAuthData
}