pcap

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

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReceiverQueueSize is default queue size of channel from packet server to packet processor.
	DefaultReceiverQueueSize = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PacketProcessor

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

func NewPacketProcessor

func NewPacketProcessor(metloAPI *metloapi.Metlo, interfaceName string) (*PacketProcessor, error)

func (*PacketProcessor) Put

func (x *PacketProcessor) Put(pkt *packetData) error

func (*PacketProcessor) Setup

func (x *PacketProcessor) Setup() error

func (*PacketProcessor) Shutdown

func (x *PacketProcessor) Shutdown() error

func (*PacketProcessor) Tick

func (x *PacketProcessor) Tick(now time.Time) error

type Pcap

type Pcap struct {
	QueueSize int
	// contains filtered or unexported fields
}

VXCap is one of main components of the package

func New

func New(captureInterface string) *Pcap

New is constructor of VXCap

func (*Pcap) Start

func (x *Pcap) Start(proc Processor) error

Start invokes packet listener and forwards captured packets to processor.

type Processor

type Processor interface {
	Setup() error
	Put(pkt *packetData) error
	Tick(now time.Time) error
	Shutdown() error
}

Jump to

Keyboard shortcuts

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