Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(tp ethernet.EtherType, arppd ProtocolDealer) error
Register registers a ProtocolDealer to be the ARP manager for a specific EtherType.
func Request ¶
func Request(tp ethernet.EtherType, raddr ProtocolAddress) (*ethernet.MACAddress, error)
Request will send an ARP request for a given EtherType and ProtocolAddress. It will then block until it receives a response, or until a timeout occurs. To function properly, a ProtocolDealer must be Registered for the EtherType.
Types ¶
type ProtocolAddress ¶
type ProtocolAddress interface {
Marshal() ([]byte, error)
Len() uint8
ARPEqual(ProtocolAddress) bool
}
The ProtocolAddress represents a protocol address.
type ProtocolDealer ¶
type ProtocolDealer interface {
Lookup(ProtocolAddress) (*ethernet.MACAddress, error)
Request(ProtocolAddress) (*ethernet.MACAddress, error)
// TODO add discover (probe) function to broadcast ARP requests
// TODO support ARP announcements
Add(ProtocolAddress, *ethernet.MACAddress) error
GetReplyNotifier() *notifiers.Notifier
Unmarshal([]byte) ProtocolAddress
GetAddress() ProtocolAddress
}
The ProtocolDealer is provided by a client during Registration for an EtherType. It provides this ARP package with all the EtherType specific address settings and functions.
Click to show internal directories.
Click to hide internal directories.