Documentation
¶
Index ¶
- Variables
- func GetIPs(iface net.Interface) ([]net.IP, error)
- func GetInterfaces() ([]net.Interface, error)
- func HwAddrFromBytes(b []byte) []byte
- func IPv4(b []byte) net.IP
- type DeviceData
- type RequestData
- type Server
- func (s *Server) Ack(hwAddr net.HardwareAddr, ip net.IP, xid uint32) error
- func (l *Server) Close() error
- func (s *Server) Listen() error
- func (l *Server) Offer(hwAddr net.HardwareAddr, ip net.IP, xid uint32) error
- func (s *Server) OfferRequest(hwAddr net.HardwareAddr, ip net.IP, xid uint32) error
- func (l *Server) Read() (*pkt.Pkt, error)
- func (s *Server) ServeAddress() string
- func (s *Server) SniffMac() (net.HardwareAddr, uint32, error)
- func (s *Server) WaitRequest(hwAddr net.HardwareAddr, ip net.IP, xid uint32) error
- func (l *Server) Write(pkt *pkt.Pkt) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidIP = errors.New("invalid IP address")
Functions ¶
func GetInterfaces ¶
GetInterfaces retrieves all valid interfaces to use for UDP DHCP messaging.
func HwAddrFromBytes ¶
Types ¶
type DeviceData ¶
type DeviceData struct {
HWAddr net.HardwareAddr
IP net.IP
}
DeviceData is a struct that holds the hardware address and IP address of a device
type RequestData ¶
type RequestData struct {
ServerData DeviceData
ClientData DeviceData
XID uint32
}
RequestData is a struct that holds the data from the server and client This data is used for DHCP requests and responses
func RequestDataFromPkt ¶
func RequestDataFromPkt(pkt *pkt.Pkt) RequestData
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) OfferRequest ¶
func (*Server) ServeAddress ¶
func (*Server) WaitRequest ¶
Click to show internal directories.
Click to hide internal directories.