definition

package
v1.0.2-dev Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitializeStatus int32 = iota
	InitializedStatus
	StartedStatus
	StoppedStatus
)
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 ClassifierOption

type ClassifierOption struct {
	MaxClassifiersNum uint32
}

type CollectorOption

type CollectorOption struct {
	MaxCollectorsNum   uint32
	MaxChannelCap      uint32
	MaxFullPktQueueLen uint32
}

type DetectionInfo

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

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

func (*DetectionInfo) GenFragGroupID

func (t *DetectionInfo) GenFragGroupID() FragmentGroupID

func (*DetectionInfo) Rest

func (t *DetectionInfo) Rest()

type ErrResultType

type ErrResultType uint16
const (
	NonErrResultType ErrResultType = iota
	//ErrResultTypeHandleNil
	ErrResultTypeNewPacket

	ErrResultIPV4NetworkLayerNil
	ErrResultConvIPV4
	ErrResultIPv4Serialize
	ErrResultIPV4NewPacket
	ErrResultIPV4HdrLenInsufficient

	ErrResultIPV6NetworkLayerNil
	ErrResultNoIPV6FragLayer
	ErrResultConvIPv6Frag
	ErrResultIPv6Serialize
	ErrResultTypeIPV6NewPacket
	ErrResultIPV6HdrLenInsufficient
	ErrResultIPV6FragHdrLenInsufficient
)

type FragmentGroupID

type FragmentGroupID string

type FragmentType

type FragmentType int8
const (
	InvalidFragType FragmentType = iota

	IPV4FragType
	IPV6FragType
	PFCPFragType

	MaxInvalidFragType
)

type FullPacket

type FullPacket struct {
	InMarkValue uint64
	FragGroupID FragmentGroupID
	Pkt         gopacket.Packet
}

func (*FullPacket) GetFragGroupID

func (t *FullPacket) GetFragGroupID() FragmentGroupID

func (*FullPacket) GetInMarkValue

func (t *FullPacket) GetInMarkValue() uint64

func (*FullPacket) GetPacket

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

type IPV6WorkerOption

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

type LayerHeaders

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

type OnDetectSuccessfulFunc

type OnDetectSuccessfulFunc func(fragGroupID FragmentGroupID)

type Option

type Option struct {
	PickFragmentTypes []FragmentType
	CollectorOption   CollectorOption
	ClassifierOption  ClassifierOption
}

func NewOption

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

type ReplyParse

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

Jump to

Keyboard shortcuts

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