Documentation
¶
Overview ¶
Package arpme is a simple arp scanning library.
An example:
scanner, err := New(Config{
HandlerFunc: func(resp Response) {
log.Printf("response: [%s] :: %s :: %s", resp.SourceHardwareAddr.String(), resp.SourceIP.String(), resp.Host)
},
})
if err != nil {
panic(err)
}
log.Println(scanner.Run())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DisallowInterfaceError will cause Start() to return an error if it can't
// listen to an interface.
DisallowInterfaceError bool
// Delay is the time between each loop of arp requests.
Delay time.Duration
// Interfaces to send/listen for arp requests. If this is empty, it will
// attempt to listen to all known interfaces.
Interfaces []net.Interface
// HandlerFunc is executed when we receive a valid arp response. It is
// executed in its own goroutine.
HandlerFunc func(Response)
// Debug is an optional writer which will be used for debug output.
Debug io.Writer
}
Config is the configuration struct you should pass to New().
type Response ¶
type Response struct {
// SourceIP is the IP of the source that responded to the arp request.
SourceIP net.IP
// SourceHardwareAddr is the MAC of the source that responded to the arp request.
SourceHardwareAddr net.HardwareAddr
// Host is the first rDNS entry returned for the source IP, if one exists.
Host string
// Timestamp is when the request was received.
Timestamp time.Time
}
Response is the tailored response output from the arp packets we received.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a arp scanning client.
func (*Scanner) Close ¶
func (s *Scanner) Close()
Close sends a request to close all goroutines and listeners.
func (*Scanner) Run ¶
Run calls Start(), and then Wait(). It blocks until there is an error, or nil if Close() is called.
Click to show internal directories.
Click to hide internal directories.
