2.2.2.2 SOCKADDR_STORAGE

SOCKADDR_STORAGE is a 128-byte structure that is formatted as follows.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Family

Buffer (variable)

...

Reserved (variable)

...

Family (2 bytes): The address family of the socket. This field MUST contain one of the following values.

Value

Meaning

InterNetwork

0x0002

When set, this indicates an IPv4 address in the socket.

InterNetworkV6

0x0017

When set, this indicates an IPv6 address in the socket.

Buffer (variable): A variable-length buffer that contains the socket address information. If the value of the Family field is 0x0002, this field MUST be interpreted as SOCKADDR_IN (section 2.2.2.2.1). Otherwise, if the value of the Family field is 0x0017, this field MUST be interpreted as SOCKADDR_IN6 (section 2.2.2.2.2).

Reserved (variable): The remaining bytes within the size of the SOCKADDR_STORAGE structure (128 bytes) MUST NOT be used and MUST be reserved. The server SHOULD set this to zero, and the client MUST ignore it on receipt.