ipp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PluginClass = "ipp"

PluginClass registered

Variables

This section is empty.

Functions

func Builder

func Builder() builder.BuildPluginFn

Builder returns a builder function

Types

type Action

type Action interface {
	nfqueue.Action
	Register(*Hooks)
}

Action defines interface action

type CbClose

type CbClose func() error

CbClose defines callback for cleanups

type CbPacketIPv4

type CbPacketIPv4 func(gopacket.Packet, *layers.IPv4, time.Time) (nfqueue.Verdict, error)

CbPacketIPv4 defines a callback on packet

type CbPacketIPv6

type CbPacketIPv6 func(gopacket.Packet, *layers.IPv6, time.Time) (nfqueue.Verdict, error)

CbPacketIPv6 defines a callback on packet

type CbTick

type CbTick func(time.Time, time.Time) error

CbTick defines callback for tick routines

type Config

type Config struct {
	Actions []Action
}

Config stores configuration for plugin creation

type Hooks

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

Hooks is responsible for ip packet processing

func NewHooks

func NewHooks() *Hooks

NewHooks returns a new hooks collection

func (*Hooks) OnClose

func (h *Hooks) OnClose(fn CbClose)

OnClose adds a callback function when closes source

func (*Hooks) OnPacketIPv4

func (h *Hooks) OnPacketIPv4(fn CbPacketIPv4)

OnPacketIPv4 adds a callback function on new packet

func (*Hooks) OnPacketIPv6

func (h *Hooks) OnPacketIPv6(fn CbPacketIPv6)

OnPacketIPv6 adds a callback function on new packet

func (*Hooks) OnTick

func (h *Hooks) OnTick(fn CbTick)

OnTick adds a callback function on each tick

type Plugin

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

Plugin implementation

func New

func New(pname string, cfg Config, l yalogi.Logger) (*Plugin, error)

New returns a new plugin instance

func (*Plugin) Class

func (p *Plugin) Class() string

Class implements nfqueue.Plugin interface

func (*Plugin) CleanUp

func (p *Plugin) CleanUp()

CleanUp implements nfqueue.Plugin interface

func (*Plugin) Layers

func (p *Plugin) Layers() []gopacket.LayerType

Layers implements nfqueue.Plugin interface

func (*Plugin) Name

func (p *Plugin) Name() string

Name implements nfqueue.Plugin interface

func (*Plugin) Register

func (p *Plugin) Register(hooks *nfqueue.Hooks)

Register implements nfqueue.Plugin interface

Directories

Path Synopsis
actions

Jump to

Keyboard shortcuts

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