device

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenPcapDevice

func OpenPcapDevice(deviceLnkName string) (*pcap.Handle, error)

func SendBuf

func SendBuf(handle *pcap.Handle, buf []byte) error

Types

type DeviceHandle

type DeviceHandle struct {
	Handle     *pcap.Handle
	IsLoopback bool
}

设备句柄管理

func NewDeviceHandle

func NewDeviceHandle() *DeviceHandle

func (*DeviceHandle) Close

func (p *DeviceHandle) Close()

func (*DeviceHandle) Open

func (p *DeviceHandle) Open(devLnkName string) error

type IPAddress

type IPAddress struct {
	IP          netip.Addr
	NetmaskBits int // 子网掩码位数
}

func (*IPAddress) ToIP

func (p *IPAddress) ToIP() net.IP

Jump to

Keyboard shortcuts

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