assembler

package
v0.0.0-...-ba8b0ab Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRawInstructions

func BuildRawInstructions(cond Condition) (retList []bpf.RawInstruction, retErr error)

func CalculateChunkLinkInstructionsNumBy

func CalculateChunkLinkInstructionsNumBy(chunk IChunk) (retNum int)

Types

type Assembler

type Assembler struct {
	// contains filtered or unexported fields
}

type BaseCell

type BaseCell struct {
	// contains filtered or unexported fields
}

func (*BaseCell) GetIndex

func (t *BaseCell) GetIndex() int

func (*BaseCell) GetNextCell

func (t *BaseCell) GetNextCell() ICell

func (*BaseCell) GetSkipRetConstantIndex

func (t *BaseCell) GetSkipRetConstantIndex(retAllowIndex int) (skipToAllowNum, skipToRejectNum uint8)

func (*BaseCell) IsTailCell

func (t *BaseCell) IsTailCell() bool

func (*BaseCell) SetNextCell

func (t *BaseCell) SetNextCell(cell ICell)

type BaseChunk

type BaseChunk struct {
	// contains filtered or unexported fields
}

func (*BaseChunk) BuildInstructions

func (t *BaseChunk) BuildInstructions(reject bool, instructions *[]bpf.Instruction) error

func (*BaseChunk) GetCellLinkLen

func (t *BaseChunk) GetCellLinkLen() int

func (*BaseChunk) GetFirstCellIndex

func (t *BaseChunk) GetFirstCellIndex() (retIdx int)

func (*BaseChunk) GetInstructionsNum

func (t *BaseChunk) GetInstructionsNum() int

func (*BaseChunk) GetNextChunk

func (t *BaseChunk) GetNextChunk() IChunk

func (*BaseChunk) GetPreviousChunk

func (t *BaseChunk) GetPreviousChunk() IChunk

func (*BaseChunk) SetNextChunk

func (t *BaseChunk) SetNextChunk(chunk IChunk)

func (*BaseChunk) SetPreviousChunk

func (t *BaseChunk) SetPreviousChunk(chunk IChunk)
type CellLink struct {
	// contains filtered or unexported fields
}
func NewCellLink() *CellLink

type Condition

type Condition struct {
	Reject         bool
	SrcIPV4List    []net.IP
	DstIPV4List    []net.IP
	SrcIPV6List    []net.IP
	DstIPV6List    []net.IP
	IPProtocolList []layers.IPProtocol
	PortList       []int
}

type DstIPV4AddrChunk

type DstIPV4AddrChunk struct {
	IPV4AddrChunk
}

func NewDstIPV4Chunk

func NewDstIPV4Chunk(index int) *DstIPV4AddrChunk

type DstIPV6AddrChunk

type DstIPV6AddrChunk struct {
	IPV6AddrChunk
}

func NewDstIPV6AddrChunk

func NewDstIPV6AddrChunk(index int) *DstIPV6AddrChunk

type DstIPV6AddrValueCell

type DstIPV6AddrValueCell struct {
	IPV6AddrValueCell
}

type EthTypeCell

type EthTypeCell struct {
	BaseCell
	// contains filtered or unexported fields
}

func (*EthTypeCell) BuildInstructions

func (t *EthTypeCell) BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction, retAllowIndex int) (retErr error)

type EthTypeIPV4Cell

type EthTypeIPV4Cell struct {
	EthTypeCell
}

type EthTypeIPV6Cell

type EthTypeIPV6Cell struct {
	EthTypeCell
}

type EthernetLayerChunk

type EthernetLayerChunk struct {
	BaseChunk
}

func NewEthernetLayerChunk

func NewEthernetLayerChunk() *EthernetLayerChunk

type ICell

type ICell interface {
	GetIndex() int
	IsTailCell() bool
	GetNextCell() ICell
	SetNextCell(cell ICell)
	BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction, retAllowIndex int) error
	GetSkipRetConstantIndex(retAllowIndex int) (skipToAllowNum, skipToRejectNum uint8)
}

func NewDstIPV6AddrValueCell

func NewDstIPV6AddrValueCell(index int, nIP net.IP) ICell

func NewEthTypeIPV4Cell

func NewEthTypeIPV4Cell(index int) ICell

func NewEthTypeIPV6Cell

func NewEthTypeIPV6Cell(index int) ICell

func NewIPProtoCell

func NewIPProtoCell(index int, proto layers.IPProtocol) (ICell, error)

func NewIPProtoIPV6FragCell

func NewIPProtoIPV6FragCell(index int, proto layers.IPProtocol) ICell

func NewIPProtoTCPCell

func NewIPProtoTCPCell(index int, proto layers.IPProtocol) ICell

func NewIPProtoUDPCell

func NewIPProtoUDPCell(index int, proto layers.IPProtocol) ICell

func NewIPV4AddrValueCell

func NewIPV4AddrValueCell(index int, nIP net.IP) ICell

func NewLoadAbsoluteCell

func NewLoadAbsoluteCell(index int, off uint32, size int) ICell

func NewSrcIPV6AddrValueCell

func NewSrcIPV6AddrValueCell(index int, nIP net.IP) ICell

type IChunk

type IChunk interface {
	GetFirstCellIndex() int
	GetCellLinkLen() int

	GetPreviousChunk() IChunk
	GetNextChunk() IChunk
	SetNextChunk(chunk IChunk)
	SetPreviousChunk(chunk IChunk)

	GetInstructionsNum() int
	// contains filtered or unexported methods
}

func CheckAndCreateDstIPV4AddrChunk

func CheckAndCreateDstIPV4AddrChunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateDstIPV6AddrChunk

func CheckAndCreateDstIPV6AddrChunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateIPProtoIPV4Chunk

func CheckAndCreateIPProtoIPV4Chunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateIPProtoIPV6Chunk

func CheckAndCreateIPProtoIPV6Chunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateIPProtoIPv6FragChunk

func CheckAndCreateIPProtoIPv6FragChunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateSrcIPV4AddrChunk

func CheckAndCreateSrcIPV4AddrChunk(idx int, cond *Condition) (IChunk, error)

func CheckAndCreateSrcIPV6AddrChunk

func CheckAndCreateSrcIPV6AddrChunk(idx int, cond *Condition) (IChunk, error)

type IPProtoCell

type IPProtoCell struct {
	BaseCell
	// contains filtered or unexported fields
}

func (*IPProtoCell) BuildInstructions

func (t *IPProtoCell) BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction, retAllowIndex int) (retErr error)

type IPProtocolIPV4Chunk

type IPProtocolIPV4Chunk struct {
	BaseChunk
}

func NewIPProtocolIPV4Chunk

func NewIPProtocolIPV4Chunk(index int) *IPProtocolIPV4Chunk

type IPProtocolIPV6Chunk

type IPProtocolIPV6Chunk struct {
	BaseChunk
}

func NewIPProtocolIPV6Chunk

func NewIPProtocolIPV6Chunk(index int) *IPProtocolIPV6Chunk

type IPProtocolIPv6FragChunk

type IPProtocolIPv6FragChunk struct {
	BaseChunk
}

func NewIPProtocolIPv6FragChunk

func NewIPProtocolIPv6FragChunk(index int) *IPProtocolIPv6FragChunk

type IPV4AddrChunk

type IPV4AddrChunk struct {
	BaseChunk
	// contains filtered or unexported fields
}

type IPV4AddrValueCell

type IPV4AddrValueCell struct {
	BaseCell
	IPValue uint32
}

func (*IPV4AddrValueCell) BuildInstructions

func (t *IPV4AddrValueCell) BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction,
	retAllowIndex int) (retErr error)

type IPV6AddrChunk

type IPV6AddrChunk struct {
	BaseChunk
	// contains filtered or unexported fields
}

type IPV6AddrValueCell

type IPV6AddrValueCell struct {
	BaseCell
	// contains filtered or unexported fields
}

func (*IPV6AddrValueCell) BuildInstructions

func (t *IPV6AddrValueCell) BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction, retAllowIndex int) (retErr error)

type LoadAbsoluteCell

type LoadAbsoluteCell struct {
	BaseCell
	// contains filtered or unexported fields
}

func (*LoadAbsoluteCell) BuildInstructions

func (t *LoadAbsoluteCell) BuildInstructions(reject bool, chunk IChunk, instructions *[]bpf.Instruction, retAllowIndex int) (retErr error)

type SrcIPV4AddrChunk

type SrcIPV4AddrChunk struct {
	IPV4AddrChunk
}

func NewSrcIPV4Chunk

func NewSrcIPV4Chunk(index int) *SrcIPV4AddrChunk

type SrcIPV6AddrChunk

type SrcIPV6AddrChunk struct {
	IPV6AddrChunk
}

func NewSrcIPV6AddrChunk

func NewSrcIPV6AddrChunk(index int) *SrcIPV6AddrChunk

type SrcIPV6AddrValueCell

type SrcIPV6AddrValueCell struct {
	IPV6AddrValueCell
}

Jump to

Keyboard shortcuts

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