I am trying to write a packet sniffer in C. To identify ARP packets, I have defined a structure where the 16 bit integer gives me a hex value which I can compare with the library definition of ARP, i.e ETH_P_ARP from where I can confirm if the packet is ARP.
Structure:
struct ethernet {
unsigned char dest[6];
unsigned char source[6];
uint16_t eth_type;};
I want to do something similar for DHCP, but I am not able to identify it.