modules

package
v0.0.0-...-5f17d81 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinBufferSize         = 480
	RecommendedBufferSize = 2048
	MaxBufferSize         = 8192
	UDPBufferSize         = 2048
)

Variables

This section is empty.

Functions

func ChangeIntegrationStatus

func ChangeIntegrationStatus(logTyp string, proto string, isEnabled bool, tlsOptions ...bool) (string, error)

func ChangePort

func ChangePort(logTyp string, proto string, port string) (string, error)

func ConfigureCollectorFirstTime

func ConfigureCollectorFirstTime() error

func DisableTLSForIntegration

func DisableTLSForIntegration(logTyp string, proto string) error

func EnableTLSForIntegration

func EnableTLSForIntegration(logTyp string, proto string) (string, error)

func IsPortAvailable

func IsPortAvailable(port string, proto string, cnf *CollectorConfiguration, currentIntegration string) bool

func StartModules

func StartModules()

func ValidateChangeInPort

func ValidateChangeInPort(newPort string, dataType string) bool

ValidateChangeInPort returns true if the port change is allowed

func WriteCollectorConfig

func WriteCollectorConfig(integrations map[string]Integration, filename string) error

func WriteCollectorConfigFromModules

func WriteCollectorConfigFromModules(mod []Module, filename string) error

Types

type CollectorConfiguration

type CollectorConfiguration struct {
	Integrations map[string]Integration `json:"integrations"`
}

func ReadCollectorConfig

func ReadCollectorConfig() (CollectorConfiguration, error)

type FramingMethod

type FramingMethod int
const (
	FramingNewline FramingMethod = iota
	FramingOctetCounting
)

type Integration

type Integration struct {
	TCP Port `json:"tcp_port,omitempty"`
	UDP Port `json:"udp_port,omitempty"`
}

type Module

type Module interface {
	GetDataType() string
	IsPortListen(proto string) bool
	SetNewPort(proto string, port string)
	GetPort(proto string) string
	EnablePort(proto string, enableTLS bool) error
	DisablePort(proto string)
}

func GetModule

func GetModule(typ string) Module

type NetflowModule

type NetflowModule struct {
	DataType  string
	Parser    parser.Parser
	Decoders  map[string]*netflow.Decoder
	Listener  *net.UDPConn
	CTX       context.Context
	Cancel    context.CancelFunc
	IsEnabled bool
}

func GetNetflowModule

func GetNetflowModule() *NetflowModule

func (*NetflowModule) DisablePort

func (m *NetflowModule) DisablePort(proto string)

func (*NetflowModule) EnablePort

func (m *NetflowModule) EnablePort(proto string, enableTLS bool) error

func (*NetflowModule) GetDataType

func (m *NetflowModule) GetDataType() string

func (*NetflowModule) GetPort

func (m *NetflowModule) GetPort(proto string) string

func (*NetflowModule) IsPortListen

func (m *NetflowModule) IsPortListen(proto string) bool

func (*NetflowModule) SetNewPort

func (m *NetflowModule) SetNewPort(_ string, _ string)

type Port

type Port struct {
	IsListen   bool   `json:"enabled"`
	Port       string `json:"value"`
	TLSEnabled bool   `json:"tls_enabled,omitempty"`
}

type SyslogModule

type SyslogModule struct {
	DataType    string
	TCPListener listenerTCP
	UDPListener listenerUDP
	Parser      parser.Parser
}

func GetSyslogModule

func GetSyslogModule(dataType string, protoPorts config.ProtoPort) *SyslogModule

func (*SyslogModule) DisablePort

func (m *SyslogModule) DisablePort(proto string)

func (*SyslogModule) EnablePort

func (m *SyslogModule) EnablePort(proto string, enableTLS bool) error

func (*SyslogModule) GetDataType

func (m *SyslogModule) GetDataType() string

func (*SyslogModule) GetPort

func (m *SyslogModule) GetPort(proto string) string

func (*SyslogModule) IsPortListen

func (m *SyslogModule) IsPortListen(proto string) bool

func (*SyslogModule) SetNewPort

func (m *SyslogModule) SetNewPort(proto string, port string)

Jump to

Keyboard shortcuts

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