trireme-lib: go.aporeto.io/trireme-lib/controller/pkg/counters Index | Files

package counters

import "go.aporeto.io/trireme-lib/controller/pkg/counters"

Index

Package Files

counters.go default.go types.go

func CounterError Uses

func CounterError(t CounterType, err error) error

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

func GetErrorCounters Uses

func GetErrorCounters() []collector.Counters

GetErrorCounters returns the error counters and resets the counters to zero

func IncrementCounter Uses

func IncrementCounter(err CounterType)

IncrementCounter increments counters for a given PU

type CounterType Uses

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
    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
    ErrUDPAckDatapathVersionMismatch
    ErrUDPAckTokenDecodeFailed
    ErrUDPAckTokenExpired
    ErrUDPAckSignatureMismatch
    ErrAppSynAuthOptionSet
    ErrAckToFinAck
    ErrIgnoreFin
    ErrInvalidNetState
    ErrInvalidNetAckState
    ErrAppSynAckAuthOptionSet
    ErrDuplicateAckDrop
)

WARNING: Append any new counters at the end of the list. DO NOT CHANGE EXISTING ORDER. Also ensure that the list doesn't exceed current totalCounters, If it does, increase the totalCounters by multiples of 10.

type Counters Uses

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

Counters holds the counters value.

func NewCounters Uses

func NewCounters() *Counters

NewCounters initializes new counters handler. Thread safe.

func (*Counters) CounterError Uses

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 Uses

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

GetErrorCounters returns the error counters and resets the counters to zero

func (*Counters) IncrementCounter Uses

func (c *Counters) IncrementCounter(t CounterType)

IncrementCounter increments counters for a given PU

Package counters imports 3 packages (graph) and is imported by 5 packages. Updated 2020-04-01. Refresh now. Tools for package owners.