scan

package
v0.0.0-...-c7cde22 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultInterface

func DefaultInterface() string

DefaultInterface 获取默认网卡名称

func Supported

func Supported() bool

Supported 检测当前系统是否支持 eBPF

Types

type Event

type Event struct {
	SourceIP  string
	Port      uint16
	Protocol  string // "tcp" / "udp"
	Timestamp time.Time
}

Event 扫描事件

type InterfaceInfo

type InterfaceInfo struct {
	Name   string   `json:"name"`
	IPs    []string `json:"ips"`
	Status string   `json:"status"` // "up" / "down"
}

InterfaceInfo 网卡信息

func ListInterfaces

func ListInterfaces() ([]InterfaceInfo, error)

ListInterfaces 列出可用网卡

type Scanner

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

Scanner eBPF 扫描检测器

func New

func New(ifaces []string, log *slog.Logger) (*Scanner, error)

New 创建 Scanner,加载 eBPF 程序并挂载到指定网卡

func (*Scanner) Close

func (s *Scanner) Close() error

Close 卸载 eBPF 程序并清理资源

func (*Scanner) Events

func (s *Scanner) Events() <-chan Event

Events 返回事件通道

Jump to

Keyboard shortcuts

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