device

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIpv4Devices

func GetIpv4Devices() (keys []string, data map[string]net.IP)

func PcapInit

func PcapInit(devicename string) (*pcap.Handle, error)

Types

type EtherTable

type EtherTable struct {
	SrcIp  net.IP  `yaml:"src_ip"`
	Device string  `yaml:"device"`
	SrcMac SelfMac `yaml:"src_mac"`
	DstMac SelfMac `yaml:"dst_mac"`
}

func AutoGetDevices

func AutoGetDevices() *EtherTable

func ReadConfig

func ReadConfig(filename string) (*EtherTable, error)

func (*EtherTable) SaveConfig

func (e *EtherTable) SaveConfig(filename string) error

type SelfMac

type SelfMac net.HardwareAddr

func (SelfMac) HardwareAddr

func (d SelfMac) HardwareAddr() net.HardwareAddr

func (SelfMac) MarshalYAML

func (d SelfMac) MarshalYAML() (interface{}, error)

func (SelfMac) String

func (d SelfMac) String() string

func (*SelfMac) UnmarshalYAML

func (d *SelfMac) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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