Documentation ¶
Overview ¶
Package network is generated by Handlergenerator tooling Make sure to insert real Description here
Package network is generated by Handlergenerator tooling OpenPcap will open up a pcap and output all network packets to the next processor
Index ¶
- Variables
- func FindDevices() ([]pcap.Interface, error)
- func NewNetworkInterfaceHandler() handlers.Handler
- func NewOpenPcapHandler() handlers.Handler
- type NetworkInterface
- func (a *NetworkInterface) GetConfiguration() *property.Configuration
- func (a *NetworkInterface) GetErrorChannel() chan error
- func (a *NetworkInterface) GetHandlerName() string
- func (a *NetworkInterface) Handle(ctx context.Context, input payload.Payload, topics ...string) error
- func (a *NetworkInterface) SetMetricProvider(p metric.Provider, prefix string) error
- func (a *NetworkInterface) Subscriptionless() bool
- func (a *NetworkInterface) ValidateConfiguration() (bool, []string)
- type OpenPcap
- func (a *OpenPcap) GetConfiguration() *property.Configuration
- func (a *OpenPcap) GetErrorChannel() chan error
- func (a *OpenPcap) GetHandlerName() string
- func (a *OpenPcap) Handle(ctx context.Context, input payload.Payload, topics ...string) error
- func (a *OpenPcap) SetMetricProvider(p metric.Provider, prefix string) error
- func (a *OpenPcap) Subscriptionless() bool
- func (a *OpenPcap) ValidateConfiguration() (bool, []string)
Constants ¶
This section is empty.
Variables ¶
var ( //ErrNoDevicesFound is when the system has no network interfaces to sniff on ErrNoDevicesFound = errors.New("no sniffable devices found on the system") //ErrConfiguredInterface is thrown when the wanted interface does not exist ErrConfiguredInterface = errors.New("there is no such interface, try checking your systems network interfaces names") )
Functions ¶
func FindDevices ¶
FindDevices prints all network interface info
func NewNetworkInterfaceHandler ¶
NewNetworkInterfaceHandler generates a new NetworkInterface Handler
func NewOpenPcapHandler ¶
NewOpenPcapHandler generates a new OpenPcap Handler
Types ¶
type NetworkInterface ¶
type NetworkInterface struct { // Cfg is values needed to properly run the Handle func Cfg *property.Configuration `json:"configs" yaml:"configs"` // Name is sort of like an ID used to load data back should be the same that is used to register the Handler Name string `json:"handler_name" yaml:"handler_name"` // MetricPayloadOut is how many payloads the processor has outputted MetricPayloadOut string // MetricPayloadIn is how many payloads the processor has inputted MetricPayloadIn string // contains filtered or unexported fields }
NetworkInterface is used to read packets from a network interface
func (*NetworkInterface) GetConfiguration ¶
func (a *NetworkInterface) GetConfiguration() *property.Configuration
GetConfiguration will return the CFG for the Handler
func (*NetworkInterface) GetErrorChannel ¶
func (a *NetworkInterface) GetErrorChannel() chan error
GetErrorChannel will return a channel that the Handler can output eventual errors onto
func (*NetworkInterface) GetHandlerName ¶
func (a *NetworkInterface) GetHandlerName() string
GetHandlerName should return the name of the handler that was used in register
func (*NetworkInterface) Handle ¶
func (a *NetworkInterface) Handle(ctx context.Context, input payload.Payload, topics ...string) error
Handle is used to sniff network packets on a interface and output all packets
func (*NetworkInterface) SetMetricProvider ¶
func (a *NetworkInterface) SetMetricProvider(p metric.Provider, prefix string) error
SetMetricProvider is used to change what metrics provider is used by the handler
func (*NetworkInterface) Subscriptionless ¶
func (a *NetworkInterface) Subscriptionless() bool
Subscriptionless will return true/false if the Handler is genereating payloads itself
func (*NetworkInterface) ValidateConfiguration ¶
func (a *NetworkInterface) ValidateConfiguration() (bool, []string)
ValidateConfiguration is used to see that all needed configurations are assigned before starting
type OpenPcap ¶
type OpenPcap struct { // Cfg is values needed to properly run the Handle func Cfg *property.Configuration `json:"configs" yaml:"configs"` // Name is sort of like an ID used to load data back should be the same that is used to register the Handler Name string `json:"handler_name" yaml:"handler_name"` // MetricPayloadOut is how many payloads the processor has outputted MetricPayloadOut string // MetricPayloadIn is how many payloads the processor has inputted MetricPayloadIn string // contains filtered or unexported fields }
OpenPcap is used to open up a PCAP and Read the packets from the pcap.
func (*OpenPcap) GetConfiguration ¶
func (a *OpenPcap) GetConfiguration() *property.Configuration
GetConfiguration will return the CFG for the Handler
func (*OpenPcap) GetErrorChannel ¶
GetErrorChannel will return a channel that the Handler can output eventual errors onto
func (*OpenPcap) GetHandlerName ¶
GetHandlerName should return the name of the handler that was used in register
func (*OpenPcap) SetMetricProvider ¶
SetMetricProvider is used to change what metrics provider is used by the handler
func (*OpenPcap) Subscriptionless ¶
Subscriptionless will return true/false if the Handler is genereating payloads itself
func (*OpenPcap) ValidateConfiguration ¶
ValidateConfiguration is used to see that all needed configurations are assigned before starting