In this exercise, you will implement a server for the protocol detailed in the previous task. Combine the code that you wrote previously and add the missing part for the application to be complete.
For each of the calls that you use, if one of them were to encounter an error, immediately return -1. All require headers are already included.
Manpages of interest:
- http://man7.org/linux/man-pages/man2/socket.2.html
- http://man7.org/linux/man-pages/man7/ipv6.7.html
- http://man7.org/linux/man-pages/man2/bind.2.html
- http://man7.org/linux/man-pages/man2/recvfrom.2.html
- http://man7.org/linux/man-pages/man2/sendto.2.html
- http://man7.org/linux/man-pages/man3/htonl.3.html
- http://man7.org/linux/man-pages/man3/printf.3.html