lib

package
v0.0.0-...-c43bf85 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCustomARPPacket

func BuildCustomARPPacket(arpData ARPPacket) (result gopacket.SerializeBuffer)

BuildCustomARPPacket writes up a custom package forged for a specific network interface and can be customized by changing the Source MAC address, the Destination MAC address the Source IP address and the Destination IP address

func CalculateIPs

func CalculateIPs(n *net.IPNet) (out []net.IP)

CalculateIPs is a simple and not very good method for getting all IPv4 addresses from a net.IPNet. It returns all IPs it can over the channel it sends back, closing the channel when done.

func ReadARP

func ReadARP(waitGroup *sync.WaitGroup, handle *pcap.Handle, networkInterface *net.Interface, stop <-chan os.Signal)

readARP watches a handle for incoming ARP responses we might care about, and prints them. note: loops until 'stop' receives data.

func WriteARP

func WriteARP(handle *pcap.Handle, networkInterface *net.Interface, addr *net.IPNet) error

WriteARP writes an ARP request for the broadcast address to the pcap handle.

func WriteARPOnInterval

func WriteARPOnInterval(interval string, stopChannel <-chan os.Signal, waitGroup *sync.WaitGroup, handle *pcap.Handle, networkInterface *net.Interface, validAddress *net.IPNet)

Types

type ARPPacket

type ARPPacket struct {
	SourceMACAddress      []byte
	SourceIPAddress       []byte
	DestinationMACAddress []byte
	DestinationIPAddress  []byte
}

Jump to

Keyboard shortcuts

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