arpzebra

package
v0.0.0-...-fdae50d Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewARPReply

func NewARPReply(src *Address, dst *Address) ([]byte, error)

新建ARP应答包

func NewARPRequest

func NewARPRequest(src *Address, dst *Address) ([]byte, error)

新建ARP请求包

Types

type ARPZebra

type ARPZebra struct {

	//DNS目标
	DNSTargets []*DNSTarget `yaml:"targets"`

	/* 网关的MAC地址 */
	GatewayMAC net.HardwareAddr
	// contains filtered or unexported fields
}

func NewARPZebra

func NewARPZebra(ifacename string, waitInterval time.Duration, stop chan struct{}) (*ARPZebra, error)

新建ARP欺骗器

func (*ARPZebra) Add

func (t *ARPZebra) Add(ip net.IP, hwaddr net.HardwareAddr)

将目标地址加入欺骗

func (*ARPZebra) Close

func (self *ARPZebra) Close()

关闭网口

func (*ARPZebra) Delete

func (t *ARPZebra) Delete(ip net.IP)

将目标地址从欺骗列表中删除

func (*ARPZebra) Get

func (t *ARPZebra) Get(ip net.IP) net.HardwareAddr

获取IP对应的MAC,如果不存在则返回nil

func (*ARPZebra) Run

func (self *ARPZebra) Run()

监听所有数据包

type Address

type Address struct {
	IP           net.IP
	HardwareAddr net.HardwareAddr
}

type DNSTarget

type DNSTarget struct {
	Matches []string `yaml:"matches"`
	Address string   `yaml:"address"`
}

Jump to

Keyboard shortcuts

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