Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EtherTable ¶
type EtherTable struct {
SrcIp net.IP `yaml:"src_ip"` // 源IP地址
Device string `yaml:"device"` // 网卡设备名称
SrcMac SelfMac `yaml:"src_mac"` // 源MAC地址
DstMac SelfMac `yaml:"dst_mac"` // 目标MAC地址(通常是网关)
}
EtherTable 存储网卡信息的数据结构
func AutoGetDevices ¶
func AutoGetDevices(userDNS []string) (*EtherTable, error)
func AutoGetDevicesWithDNS ¶
func AutoGetDevicesWithDNS(validDNS []string) *EtherTable
AutoGetDevicesWithDNS 使用指定DNS自动获取外网发包网卡 如果传入的DNS无效,则尝试使用系统DNS
func ReadConfig ¶
func ReadConfig(filename string) (*EtherTable, error)
ReadConfig 从文件读取EtherTable配置
func (*EtherTable) SaveConfig ¶
func (e *EtherTable) SaveConfig(filename string) error
SaveConfig 保存EtherTable配置到文件
type SelfMac ¶
type SelfMac net.HardwareAddr
func (SelfMac) HardwareAddr ¶
func (d SelfMac) HardwareAddr() net.HardwareAddr
func (SelfMac) MarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.