networking · intermediate · ~15 min
Build sin_addr from octets.
Implement unsigned ipv4_to_be32(int a, int b, int c, int d) packing the dotted quad into one 32-bit value with a in the most-significant byte (network order).
unsigned ipv4_to_be32(int a, int b, int c, int d) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.