I understand that on the wire, most integers are in big endian format.
But why is it the burden of the application to do the byte swapping in structures like sockaddr_in
and not the kernels, where all the low level work actually happens? It would make more sense if the userspace API was more platform agnostic and should not deal with this.
Why was the Berkeley socket API designed like this?