Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Tables A.4 through A.7 list the various socket options and the required parameters. Not all options are size compatible between UNIX types. For example, IP_TTL in Linux allows a type int, but only fills the first byte. IBM's AIX restricts the same option to a char instead.
| Level | Option | Description | * | R | W | Value | Type |
|---|---|---|---|---|---|---|---|
| SOL_SOCKET | SO_ATTACH_FILTER | Attach filter | ? | ? | ? | Integer | int |
| SOL_SOCKET | SO_BINDTODEVICE | Bind to device | ? | ? | ? | String | char* |
| SOL_SOCKET | SO_BROADCAST | Enable broadcast | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_BSDCOMPAT | Request BSD bug-for-bug compatibility | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_DEBUG | Enable socket debugging | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_DETACH_FILTER | Detach filter | ? | ? | ? | Integer | int |
| SOL_SOCKET | SO_DONTROUTE | Forbid routing | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_ERROR | Last error | Y | Y | Y | Integer | int |
| SOL_SOCKET | SO_KEEPALIVE | Enable keeping connection alive | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_LINGER | Linger until data sent | Y | Y | Y | Linger | struct linger |
| SOL_SOCKET | SO_NO_CHECK | No checking | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_OOBINLINE | Place out-of-band inline | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_PASSCRED | Enable passing user credentials | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_PEERCRED | Peer Credentials | Y | Y | Y | Credentials | struct ucred |
| SOL_SOCKET | SO_PRIORITY | Set the queue priority | Y | Y | Y | Integer | int |
| SOL_SOCKET | SO_RCVBUF | Receive buffer size | Y | Y | Y | Integer | int |
| SOL_SOCKET | SO_RCVLOWAT | Receive low water mark | Y | Y | N | Integer | int |
| SOL_SOCKET | SO_RCVTIMEO | Receive Timeout | Y | Y | Y | Time | struct timeval |
| SOL_SOCKET | SO_REUSEADDR | Reuse Address | Y | Y | Y | Boolean | int |
| SOL_SOCKET | SO_REUSEPORT | Reuse Address(multicasting) | N | - | - | Boolean | int |
| SOL_SOCKET | SO_SECURITY_ AUTHENTICATION | Security authentication | N | - | - | Integer | int |
| SOL_SOCKET | SO_SECURITY_ ENCRYPTION_ NETWORK | Security encryption network | N | - | - | Integer | int |
| SOL_SOCKET | SO_SECURITY_ ENCRYPTION_ TRANSPORT | Security encryption transport | N | - | - | Integer | int |
| SOL_SOCKET | SO_SNDBUF | Send buffer size | Y | Y | Y | Integer | int |
| SOL_SOCKET | SO_SNDLOWAT | Send low water mark | Y | Y | Y | Integer | int |
| SOL_SOCKET | SO_SNDTIMEO | Send Timeout | Y | Y | Y | Time | struct timeval |
| SOL_SOCKET | SO_TYPE | Socket Type | Y | Y | Y | Integer | int |