definition

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitializeStatus int32 = iota
	InitializedStatus
	StartedStatus
	StoppedStatus
)
View Source
const (
	CoroutineGroupCollector1    = "DefragmentLIB-collector-scheduling"
	CoroutineGroupCollectorMgr1 = "DefragmentLIB-collectorMgr-checkFullPktQueueCapacityPeriodically"
)
View Source
const (
	EthDstLen  = 6
	EthSrcLen  = 6
	EthTypeLen = 2
	EthHdrLen  = EthDstLen + EthSrcLen + EthTypeLen
)
View Source
const (
	IPV4DifferentiatedSvcFieldLen = 1
	IPV4TotalLengthFieldLen       = 2
	IPV4IdentificationLen         = 2
	IPV4FlagsFlagsLen             = 2
	IPV4TimeToLiveLen             = 1
	IPV4ProtocolLen               = 1
	IPV4HeaderChecksumLen         = 2
	IPV4SourceAddressLen          = 4
	IPV4DestinationAddressLen     = 4
	IPV4HdrLen                    = IPVersionLen + IPV4DifferentiatedSvcFieldLen + IPV4TotalLengthFieldLen + IPV4IdentificationLen +
		IPV4FlagsFlagsLen + IPV4TimeToLiveLen + IPV4ProtocolLen + IPV4HeaderChecksumLen +
		IPV4SourceAddressLen + IPV4DestinationAddressLen
)
View Source
const (
	IPV6TrafficClassFlowLabelLen = 3
	IPV6PayloadLen               = 2
	IPV6NextHeaderLen            = 1
	IPV6HopLimitLen              = 1
	IPV6SrcAddrLen               = 16
	IPV6DstAddrLen               = 16
	IPV6HdrLen                   = IPVersionLen + IPV6TrafficClassFlowLabelLen + IPV6PayloadLen + IPV6NextHeaderLen +
		IPV6HopLimitLen + IPV6SrcAddrLen + IPV6DstAddrLen

	IPV6FragmentNextHeaderLen    = 1
	IPV6FragmentReservedOctetLen = 1
	IPV6FlagsFlagsLen            = 2
	IPV6FragHdrIdentOffsetLen    = 4
	IPV6FragmentHdrLen           = IPV6FragmentNextHeaderLen + IPV6FragmentReservedOctetLen + IPV6FlagsFlagsLen + IPV6FragHdrIdentOffsetLen

	IPV6FragLayerIdx = 2

	FragOffsetMulNum = 8
)
View Source
const (
	EthIPV4HdrLen = EthHdrLen + IPV4HdrLen
	EthIPV6HdrLen = EthHdrLen + IPV6HdrLen
)
View Source
const (
	IPVersionLen = 1
)
View Source
const (
	ResultPacketProcessStepErr uint8 = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorOption

type CollectorOption struct {
	MaxCollectorsNum            uint32
	MaxChannelCap               uint32
	MaxFullPktQueueLen          uint32
	MaxFragGroupDurationSeconds int64
}

type DetectionInfo

type DetectionInfo struct {
	SrcMAC, DstMAC []byte
	EthType        layers.EthernetType
	EthPayload     []byte

	SrcIP, DstIP   net.IP
	IPProtocol     layers.IPProtocol
	FragType       FragType
	FragOffset     uint16
	MoreFrags      bool
	Identification uint32
	IPPayload      []byte

	InterfaceId InterfaceId
	FragGroupId FragGroupID
}

func (*DetectionInfo) Reset added in v1.0.3

func (t *DetectionInfo) Reset()

type ErrResultType

type ErrResultType uint16
const (
	NonErrResultType ErrResultType = iota
	ErrResultTypeNewPacket
	ErrResultSerializeLayers
	ErrResultFullPacketBufAppendBytes

	ErrResultIPV4HdrLenInsufficient

	ErrResultIPV6NetworkLayerNil
	ErrResultIPV6HdrLenInsufficient
	ErrResultIPV6FragHdrLenInsufficient
)

type FragGroupID added in v1.0.1

type FragGroupID string

type FragType added in v1.0.1

type FragType int8
const (
	NonFragType FragType = iota

	IPV4FragType
	IPV6FragType
	PFCPFragType

	MaxInvalidFragType
)

type FullPacket

type FullPacket struct {
	InterfaceId InterfaceId
	FragGroupID FragGroupID
	Pkt         gopacket.Packet
}

func (*FullPacket) GetFragGroupID

func (t *FullPacket) GetFragGroupID() FragGroupID

func (*FullPacket) GetInterfaceId added in v1.0.2

func (t *FullPacket) GetInterfaceId() InterfaceId

func (*FullPacket) GetPacket

func (t *FullPacket) GetPacket() gopacket.Packet

type IPV6WorkerOption

type IPV6WorkerOption struct {
	QueueLen int
	Interval time.Duration
	RWNum    int
}

type InterfaceId added in v1.0.2

type InterfaceId uint16

type LayerHeaders

type LayerHeaders struct {
	Eth  *layers.Ethernet
	IPV4 *layers.IPv4
	IPV6 *layers.IPv6
}

type OnDetectCompleted added in v1.0.1

type OnDetectCompleted func(fragType FragType, fragGroupID FragGroupID)

type Option

type Option struct {
	StatsOption       StatsOption
	PickFragmentTypes []FragType
	CollectorOption   CollectorOption
}

func NewOption

func NewOption(fns ...func(opt *Option)) *Option

type ReplyParse

type ReplyParse struct {
	SrcIP          string
	DstIP          string
	Protocol       interface{}
	Identification uint32
}

type StatsOption

type StatsOption struct {
	Enable bool
}

Jump to

Keyboard shortcuts

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