HP-UX IPv6 Porting Guide (February 2007)
Data Structure Changes
Generic Socket Address Structure
Chapter 316
Generic Socket Address Structure
Header file
<netinet/in.h>
struct sockaddr_storage
The sockaddr_storage data structure simplifies writing portable code across multiple
address families and platforms. This data structure provides the following flexibility and
consistency.
• One simple addition to the sockets API that can help application writers is the struct
sockaddr_storage structure. The structure is large enough to accommodate all
supported protocol-specific address structures.
• sockaddr_storage aligns at an appropriate boundary so that pointers to it - can be cast
as pointers to protocol specific address structures and used to access the fields of those
structures without alignment problems.