capture

package
v0.0.0-...-81c6b1d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

捕获包

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Decoder      gopacket.Decoder
	PacketsCount int // 总包数
	TrafficCount int // 总流量
	SessionCount int // 总会话
	OK           bool
)

Functions

func StartCapture

func StartCapture(ctx context.Context, c Config, handler PacketHandler, done chan<- struct{})

StartCapture 开始捕获数据包

Types

type Config

type Config struct {
	OffLine              string
	Nic                  string
	SnapLen              int32
	BerkeleyPacketFilter string
}

type PacketHandler

type PacketHandler interface {
	HandlePacket(packet gopacket.Packet)
}

PacketHandler 处理数据包接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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