Versions in this module Expand all Collapse all v0 v0.0.1 Jan 7, 2021 Changes in this version + var DumpPacketInError = false + var ErrorsBuffer = 20 + var ShowPacketInError = false + type Action interface + Class func() string + Name func() string + PluginClass func() string + type CbClose func() error + type CbPacket func(gopacket.Packet, time.Time) (Verdict, error) + type CbTick func(time.Time, time.Time) error + type Config struct + OnError Verdict + Policy Verdict + Tick time.Duration + type Error struct + func NewError(packet gopacket.Packet, err error) *Error + func (e *Error) Error() string + func (e *Error) String() string + type Hooks struct + func NewHooks() *Hooks + func (h *Hooks) CloseHooks() []CbClose + func (h *Hooks) Layers() []gopacket.LayerType + func (h *Hooks) OnClose(fn CbClose) + func (h *Hooks) OnPacket(layer gopacket.LayerType, fn CbPacket) + func (h *Hooks) OnTick(fn CbTick) + func (h *Hooks) PacketHooks() []OnPacket + func (h *Hooks) PacketHooksByLayer(layer gopacket.LayerType) []OnPacket + func (h *Hooks) TickHooks() []CbTick + type OnPacket struct + Callback CbPacket + Layer gopacket.LayerType + type Option func(*options) + func SetLogger(l yalogi.Logger) Option + type PacketProcessor interface + Process func(qid int, hooks *Hooks) (stop func(), errs <-chan error, err error) + func NewProcessor(cfg Config, logger yalogi.Logger) PacketProcessor + type PacketService struct + func NewService(p PacketProcessor, plugins []Plugin, opt ...Option) *PacketService + func (s *PacketService) Ping() error + func (s *PacketService) Register(qid int) error + func (s *PacketService) Shutdown() + func (s *PacketService) Start() error + func (s *PacketService) Unregister(qid int) error + type Plugin interface + Class func() string + CleanUp func() + Layers func() []gopacket.LayerType + Name func() string + Register func(hooks *Hooks) + type Verdict int + const Accept + const Default + const Drop + func ToVerdict(s string) (Verdict, error) + func (v Verdict) String() string