Im trying to send a fake udp (a random mac address, let's say 01:ff:ff:ff:ff:ff) package to be handled by the ServeDHCP on the server side, Im running the following dhcpv4 github repository github.com/krolaw/dhcp4.
The goal of send a discover package, is to check if the dhcp is alive.
In fact I created a new func called check
func (h *DHCPHandler) check () {
con, err = net.Dial("udp", "127.0.0.1:67")
for {
//fake udp package???
time.Sleep(10 * time.Minute)
}
}
in the main of the function, I have the following call go handler.check()
And in the ServeDHCP I should pass these parameters: func (h *DHCPHandler) ServeDHCP(p dhcp.Packet, msgType dhcp.MessageType, options dhcp.Options)
How could I send a fake upd package from the func check?