arp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const MaxPacketLength = 64

For ARP packets: Ethernet header (14 bytes) + ARP packet (28 bytes) + FCS (4 bytes) = 46 bytes So it is less than Ethernet minimum frame size = 64 bytes

Variables

This section is empty.

Functions

func BPFFilter

func BPFFilter(r *scan.Range) (filter string, maxPacketLength int)

func FillCache

func FillCache(cache *Cache, r io.Reader) error

func NewCacheRequestGenerator

func NewCacheRequestGenerator(reqgen scan.RequestGenerator, gatewayMAC net.HardwareAddr, cache *Cache) scan.RequestGenerator

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (c *Cache) Delete(ip net.IP)

func (*Cache) Get

func (c *Cache) Get(ip net.IP) net.HardwareAddr

func (*Cache) Put

func (c *Cache) Put(ip net.IP, mac net.HardwareAddr)

type PacketFiller

type PacketFiller struct{}

func NewPacketFiller

func NewPacketFiller() *PacketFiller

func (*PacketFiller) Fill

type ScanMethod

type ScanMethod struct {
	scan.PacketSource
	// contains filtered or unexported fields
}

func NewScanMethod

func NewScanMethod(psrc scan.PacketSource, results scan.ResultChan) *ScanMethod

func (*ScanMethod) ProcessPacketData

func (s *ScanMethod) ProcessPacketData(data []byte, _ *gopacket.CaptureInfo) error

func (*ScanMethod) Results

func (s *ScanMethod) Results() <-chan scan.Result

type ScanResult

type ScanResult struct {
	IP     string `json:"ip"`
	MAC    string `json:"mac"`
	Vendor string `json:"vendor"`
}

func (*ScanResult) ID

func (r *ScanResult) ID() string

func (ScanResult) MarshalEasyJSON

func (v ScanResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ScanResult) MarshalJSON

func (v ScanResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ScanResult) String

func (r *ScanResult) String() string

func (*ScanResult) UnmarshalEasyJSON

func (v *ScanResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ScanResult) UnmarshalJSON

func (v *ScanResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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