counters

package
v10.299.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CounterError

func CounterError(t CounterType, err error) error

CounterError is a convinence function which returns error as well as increments the counter.

func CounterNames

func CounterNames() []string

CounterNames returns an array of names

func GetErrorCounters

func GetErrorCounters() []collector.Counters

GetErrorCounters returns the error counters and resets the counters to zero

func IncrementCounter

func IncrementCounter(err CounterType)

IncrementCounter increments counters for a given PU

Types

type CounterType

type CounterType int

CounterType custom counter error type.

const (
	ErrUnknownError CounterType = iota
	ErrNonPUTraffic
	ErrNoConnFound
	ErrRejectPacket
	ErrMarkNotFound
	ErrPortNotFound
	ErrContextIDNotFound
	ErrInvalidProtocol
	ErrConnectionsProcessed
	ErrEncrConnectionsProcessed
	ErrUDPDropFin
	ErrUDPSynDroppedInvalidToken
	ErrUDPSynAckInvalidToken
	ErrUDPAckInvalidToken
	ErrUDPConnectionsProcessed
	ErrUDPContextIDNotFound
	ErrUDPDropQueueFull
	ErrUDPDropInNfQueue
	ErrAppServicePreProcessorFailed
	ErrAppServicePostProcessorFailed
	ErrNetServicePreProcessorFailed
	ErrNetServicePostProcessorFailed
	ErrSynTokenFailed
	ErrSynDroppedInvalidToken
	ErrSynDroppedTCPOption
	ErrSynDroppedInvalidFormat
	ErrSynRejectPacket
	ErrSynUnexpectedPacket
	ErrInvalidNetSynState
	ErrNetSynNotSeen
	ErrSynToExtNetAccept
	ErrSynFromExtNetAccept
	ErrSynToExtNetReject
	ErrSynFromExtNetReject
	ErrSynAckTokenFailed
	ErrOutOfOrderSynAck
	ErrInvalidSynAck
	ErrSynAckInvalidToken
	ErrSynAckMissingToken
	ErrSynAckNoTCPAuthOption
	ErrSynAckInvalidFormat
	ErrSynAckEncryptionMismatch
	ErrSynAckRejected
	ErrSynAckToExtNetAccept
	ErrSynAckFromExtNetAccept
	ErrSynAckFromExtNetReject
	ErrAckTokenFailed
	ErrAckRejected
	ErrAckTCPNoTCPAuthOption //50
	ErrAckInvalidFormat
	ErrAckInvalidToken
	ErrAckInUnknownState
	ErrAckFromExtNetAccept
	ErrAckFromExtNetReject
	ErrUDPAppPreProcessingFailed
	ErrUDPAppPostProcessingFailed
	ErrUDPNetPreProcessingFailed
	ErrUDPNetPostProcessingFailed
	ErrUDPSynInvalidToken
	ErrUDPSynMissingClaims
	ErrUDPSynDroppedPolicy
	ErrUDPSynAckNoConnection
	ErrUDPSynAckPolicy
	ErrDroppedTCPPackets
	ErrDroppedUDPPackets
	ErrDroppedICMPPackets
	ErrDroppedDNSPackets
	ErrDroppedDHCPPackets
	ErrDroppedNTPPackets
	ErrTCPConnectionsExpired
	ErrUDPConnectionsExpired
	ErrSynTokenEncodeFailed
	ErrSynTokenHashFailed
	ErrSynTokenSignFailed
	ErrSynSharedSecretMissing
	ErrSynInvalidSecret
	ErrSynInvalidTokenLength
	ErrSynMissingSignature
	ErrSynInvalidSignature
	ErrSynCompressedTagMismatch
	ErrSynDatapathVersionMismatch
	ErrSynTokenDecodeFailed
	ErrSynTokenExpired
	ErrSynSharedKeyHashFailed
	ErrSynPublicKeyFailed
	ErrSynAckTokenEncodeFailed
	ErrSynAckTokenHashFailed
	ErrSynAckTokenSignFailed
	ErrSynAckSharedSecretMissing
	ErrSynAckInvalidSecret
	ErrSynAckInvalidTokenLength
	ErrSynAckMissingSignature
	ErrSynAckInvalidSignature
	ErrSynAckCompressedTagMismatch
	ErrSynAckDatapathVersionMismatch
	ErrSynAckTokenDecodeFailed
	ErrSynAckTokenExpired
	ErrSynAckSharedKeyHashFailed
	ErrSynAckPublicKeyFailed //100
	ErrAckTokenEncodeFailed
	ErrAckTokenHashFailed
	ErrAckTokenSignFailed
	ErrAckSharedSecretMissing
	ErrAckInvalidSecret
	ErrAckInvalidTokenLength
	ErrAckMissingSignature
	ErrAckCompressedTagMismatch
	ErrAckDatapathVersionMismatch
	ErrAckTokenDecodeFailed
	ErrAckTokenExpired
	ErrAckSignatureMismatch
	ErrUDPSynTokenFailed
	ErrUDPSynTokenEncodeFailed
	ErrUDPSynTokenHashFailed
	ErrUDPSynTokenSignFailed
	ErrUDPSynSharedSecretMissing
	ErrUDPSynInvalidSecret
	ErrUDPSynInvalidTokenLength
	ErrUDPSynMissingSignature
	ErrUDPSynInvalidSignature
	ErrUDPSynCompressedTagMismatch
	ErrUDPSynDatapathVersionMismatch
	ErrUDPSynTokenDecodeFailed
	ErrUDPSynTokenExpired
	ErrUDPSynSharedKeyHashFailed
	ErrUDPSynPublicKeyFailed
	ErrUDPSynAckTokenFailed
	ErrUDPSynAckTokenEncodeFailed
	ErrUDPSynAckTokenHashFailed
	ErrUDPSynAckTokenSignFailed
	ErrUDPSynAckSharedSecretMissing
	ErrUDPSynAckInvalidSecret
	ErrUDPSynAckInvalidTokenLength
	ErrUDPSynAckMissingSignature
	ErrUDPSynAckInvalidSignature
	ErrUDPSynAckCompressedTagMismatch
	ErrUDPSynAckDatapathVersionMismatch
	ErrUDPSynAckTokenDecodeFailed
	ErrUDPSynAckTokenExpired
	ErrUDPSynAckSharedKeyHashFailed
	ErrUDPSynAckPublicKeyFailed
	ErrUDPAckTokenFailed
	ErrUDPAckTokenEncodeFailed
	ErrUDPAckTokenHashFailed
	ErrUDPAckSharedSecretMissing
	ErrUDPAckInvalidSecret
	ErrUDPAckInvalidTokenLength
	ErrUDPAckMissingSignature
	ErrUDPAckCompressedTagMismatch //150
	ErrUDPAckDatapathVersionMismatch
	ErrUDPAckTokenDecodeFailed
	ErrUDPAckTokenExpired
	ErrUDPAckSignatureMismatch
	ErrAppSynAuthOptionSet
	ErrAckToFinAck
	ErrIgnoreFin
	ErrInvalidNetState
	ErrInvalidNetAckState
	ErrAppSynAckAuthOptionSet
	ErrDuplicateAckDrop
	ErrDNSForwardFailed
	ErrDNSResponseFailed
	ErrNfLogError
	ErrSegmentServerContainerEventExceedsProcessingTime
	ErrCorruptPacket
	ErrSynMissingTCPOption
	ErrUDPDropRst
	ErrNonPUUDPTraffic
	ErrIPTablesReset
	ErrDNSInvalidRequest
)

Error counters used in the enforcerd

func (CounterType) String

func (i CounterType) String() string

type Counters

type Counters struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Counters holds the counters value.

func NewCounters

func NewCounters() *Counters

NewCounters initializes new counters handler. Thread safe.

func (*Counters) CounterError

func (c *Counters) CounterError(t CounterType, err error) error

CounterError is a convinence function which returns error as well as increments the counter.

func (*Counters) GetErrorCounters

func (c *Counters) GetErrorCounters() []collector.Counters

GetErrorCounters returns the error counters and resets the counters to zero

func (*Counters) IncrementCounter

func (c *Counters) IncrementCounter(t CounterType)

IncrementCounter increments counters for a given PU

Jump to

Keyboard shortcuts

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