Add a typedef to the UDP header struct declaration.
Improve error message.
Manually add IP header to packet.