The definition of structure dates back to the era before C supports void * (or void in general or prototypes). In those days, char * was a "universal pointer". This explains some of the oddities of network function interfaces.
This also refers to the era when there were many different network systems (IPX / SPX, SNA, TCP / IP, ...). TCP / IP is dominant these days, but even now you may have an IPv4 array or an array of returned IPv6 addresses, so specifying a struct in_addr or struct in6_addr can cause problems.
It was assumed that you would have an array of pointers to the corresponding structure types. Currently, void **h_addr_list would be written - an array of void * . But this parameter was not available when the structures were first defined, and the rest is history (you do not change the interface after standardization, if you can avoid it).
Jonathan leffler
source share