In this exercise, you have to create a IPv6 socket, then connect it to the given destination and send a message through the socket.
To create the socket, you have to use the socket() call and provide it with the correct parameters. Make sure to configure it for the IPv6 domain and set its type to support datagrams. Datagrams are simple unreliable messages abstractions.
Setting the socket destination is achieved using the connect() call.
Use the pointer to the destination address that is passed by argument to your function to send a message to the correct destination. The send() call allows sending a message through the socket. For this exercice, send()'s flags argument will not be used.
The message you have to send is the sequence of odd digits as network-ordered integers (int
) in increasing order.
For each of the calls that you use, if one of them were to encounter an error, immediately return -1. All required C headers are already included.
Manpages of interest: