plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIN = 1 << iota
	SYN
	RST
	PSH
	ACK
	URG
)

Variables

This section is empty.

Functions

func CheckSum

func CheckSum(data []byte) uint16

func IPtoByte

func IPtoByte(ipStr string) [4]byte

func IsPseudo

func IsPseudo(key string) bool

func IsValidDir

func IsValidDir(dirPath string) error

Types

type DeviceListener

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

func NewDeviceListener

func NewDeviceListener(device string, port int, rawInput *RAWInput) *DeviceListener

func (*DeviceListener) Close

func (l *DeviceListener) Close()

func (*DeviceListener) String

func (l *DeviceListener) String() string

type FileDirInput

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

func NewFileDirInput

func NewFileDirInput(codec string, path string, readDepth int, speed float64) *FileDirInput

func (*FileDirInput) Close

func (in *FileDirInput) Close() error

func (*FileDirInput) Read

func (in *FileDirInput) Read() (msg *protocol.Message, err error)

type FileDirOutput

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

func NewFileDirOutput

func NewFileDirOutput(codec string, path string, cf *FileDirOutputConfig) *FileDirOutput

func (*FileDirOutput) Close

func (o *FileDirOutput) Close() error

func (*FileDirOutput) Write

func (o *FileDirOutput) Write(msg *protocol.Message) (err error)

type FileDirOutputConfig

type FileDirOutputConfig struct {
	// MaxSize is the maximum size in megabytes of the log file before it gets rotated.
	MaxSize int `json:"maxSize"`
	// MaxBackups is the maximum number of old log files to retain.
	MaxBackups int `json:"maxBackups"`
	// MaxAge is the maximum number of days to retain old log files based on the
	// timestamp encoded in their filename.
	MaxAge int `json:"maxAge"`
}

type GRPCOutput

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

func NewGRPCOutput

func NewGRPCOutput(addr string) *GRPCOutput

func (*GRPCOutput) Close

func (o *GRPCOutput) Close() error

func (*GRPCOutput) Write

func (o *GRPCOutput) Write(msg *protocol.Message) (err error)

type PsdHeader

type PsdHeader struct {
	SrcAddr   uint32
	DstAddr   uint32
	Zero      uint8
	ProtoType uint8
	TcpLength uint16
}

type RAWInput

type RAWInput struct {
	Processor *http2.Processor
	// contains filtered or unexported fields
}

RAWInput used for intercepting traffic for given address

func NewRAWInput

func NewRAWInput(address string) (*RAWInput, error)

NewRAWInput constructor for RAWInput. Accepts raw input config as arguments.

func (*RAWInput) Close

func (i *RAWInput) Close() error

Close closes the input raw listener

func (*RAWInput) Listen

func (i *RAWInput) Listen()

func (*RAWInput) Read

func (i *RAWInput) Read() (*protocol.Message, error)

PluginRead reads meassage from this plugin

type ReinforcedReader

type ReinforcedReader struct {
	sync.Mutex

	EOF bool
	// contains filtered or unexported fields
}

func NewReinforcedReader

func NewReinforcedReader(filepaths []string, codec protocol.Codec) *ReinforcedReader

func (*ReinforcedReader) Close

func (r *ReinforcedReader) Close() error

func (*ReinforcedReader) NextFile

func (r *ReinforcedReader) NextFile() error

func (*ReinforcedReader) ReadMessage

func (r *ReinforcedReader) ReadMessage() (*protocol.Message, error)

type RocketMQInput added in v0.0.5

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

func NewRocketMQInput added in v0.0.5

func NewRocketMQInput(nameServers []string, topic, groupName string, accessKey, secretKey string) (*RocketMQInput, error)

func (*RocketMQInput) Close added in v0.0.5

func (in *RocketMQInput) Close() error

func (*RocketMQInput) Read added in v0.0.5

func (in *RocketMQInput) Read() (*protocol.Message, error)

type RocketMQOutput added in v0.0.5

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

func NewRocketMQOutput added in v0.0.5

func NewRocketMQOutput(nameServers []string, topic, accessKey, secretKey string) (*RocketMQOutput, error)

func (*RocketMQOutput) Close added in v0.0.5

func (o *RocketMQOutput) Close() error

func (*RocketMQOutput) Write added in v0.0.5

func (o *RocketMQOutput) Write(msg *protocol.Message) (err error)

type StdOutput

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

func NewStdOutput

func NewStdOutput(codec string) *StdOutput

func (*StdOutput) Close

func (o *StdOutput) Close() error

func (*StdOutput) Write

func (o *StdOutput) Write(msg *protocol.Message) (err error)

type TCPHeader

type TCPHeader struct {
	SrcPort   uint16
	DstPort   uint16
	SeqNum    uint32
	AckNum    uint32
	Offset    uint8
	Flag      uint8
	Window    uint16
	Checksum  uint16
	UrgentPtr uint16
}

Jump to

Keyboard shortcuts

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