I, along with my nephew, are trying to make a DHCP server from scratch to teach ourselves some networking along with arduino programming paradigm.
A DHCP server need to accept both
(1) Broadcast packet (Dest MAC: FF-FF-FF-FF-FF-FF, and Dest IP: 255:255:255:255)
(2) Unicast IP (Dest MAC: DHCP Server's HW Address, Dest IP: DHCP Server's IP Address)
I have read Wiznet 5100 datasheet, and Ethernet library code. I am not able to understand how to make the shield do both (1) and (2) above. It seems to me that I always have to one of the 4 socket structure to receive any packet from W5100. If I use server(67) and server.begin(), it will receive packets that has dest MAC= Card's MAC, dest IP = Card's IP and dest port = 67. How would I setup a socket to receive packet that has Dest MAC: FF-FF-FF-FF-FF-FF, Dest IP: 255:255:255:255 and Dest port: 67?
Also, EthernetServer::begin() uses TCP only. I did not find any overload of this function to support UDP.
I am okay to tweak the library, or write my own. I just need to know how to set up W5100 registers.
I picked up W5100 datasheet from Sparkfun.
I really appreciate any help.