modules

package
v0.0.0-...-e40cc08 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeIntegrationStatus

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

func ChangePort

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

func ConfigureCollectorFirstTime

func ConfigureCollectorFirstTime() error

func IsPortAvailable

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

func ModulesUp

func ModulesUp(h *logger.Logger)

func ValidateChangeInPort

func ValidateChangeInPort(newPort string, dataType configuration.LogType) bool

Return 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 CollectorConfigurationOld

type CollectorConfigurationOld struct {
	LogCollectorIsenabled bool                         `json:"log_collector_enabled"`
	Integrations          map[string]ProtocolListenOld `json:"integrations"`
}

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)
	DisablePort(proto string)
}

func GetModule

func GetModule(typ configuration.LogType, h *logger.Logger) 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
	// contains filtered or unexported fields
}

func GetNetflowModule

func GetNetflowModule(h *logger.Logger) *NetflowModule

func (*NetflowModule) DisablePort

func (m *NetflowModule) DisablePort(proto string)

func (*NetflowModule) EnablePort

func (m *NetflowModule) EnablePort(proto string)

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(proto string, port string)

type Port

type Port struct {
	IsListen bool   `json:"enabled"`
	Port     string `json:"value"`
}

type ProtocolListenOld

type ProtocolListenOld struct {
	Enabled bool   `json:"enabled"`
	UDP     string `json:"UDP,omitempty"`
	TCP     string `json:"TCP,omitempty"`
	TLS     string `json:"TLS,omitempty"`
}

type SyslogModule

type SyslogModule struct {
	DataType    string
	TCPListener listenerTCP
	UDPListener listenerUDP
	Parser      parser.Parser
	// contains filtered or unexported fields
}

func GetSyslogModule

func GetSyslogModule(dataType string, protoPorts configuration.ProtoPort, h *logger.Logger) *SyslogModule

func (*SyslogModule) DisablePort

func (m *SyslogModule) DisablePort(proto string)

func (*SyslogModule) EnablePort

func (m *SyslogModule) EnablePort(proto string)

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