plugin

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 35 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) *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 OutputKafkaConfig

type OutputKafkaConfig struct {
	Host       string `json:"output-kafka-host"`
	Topic      string `json:"output-kafka-topic"`
	UseJSON    bool   `json:"output-kafka-json-format"`
	SASLConfig SASLKafkaConfig
	// contains filtered or unexported fields
}

OutputKafkaConfig is the representation of kfka output configuration nolint: unused

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 SASLKafkaConfig

type SASLKafkaConfig struct {
	UseSASL   bool   `json:"input-kafka-use-sasl"`
	Mechanism string `json:"input-kafka-mechanism"`
	Username  string `json:"input-kafka-username"`
	Password  string `json:"input-kafka-password"`
}

SASLKafkaConfig SASL configuration

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