Commit d4f7a52a authored by rswindell's avatar rswindell
Browse files

Added WinSock2 and SunOS socket options to socket_option list.

parent b25cd007
......@@ -48,24 +48,46 @@
static socket_option_t socket_options[] = {
{ "TYPE", 0, SOL_SOCKET, SO_TYPE },
{ "ERROR", 0, SOL_SOCKET, SO_ERROR },
{ "DEBUG", 0, SOL_SOCKET, SO_DEBUG },
{ "LINGER", SOCK_STREAM, SOL_SOCKET, SO_LINGER },
{ "SNDBUF", 0, SOL_SOCKET, SO_SNDBUF },
{ "RCVBUF", 0, SOL_SOCKET, SO_RCVBUF },
#ifndef _WINSOCKAPI_
#ifndef _WINSOCKAPI_ /* Defined, but not supported, by WinSock */
{ "SNDLOWAT", 0, SOL_SOCKET, SO_SNDLOWAT },
{ "RCVLOWAT", 0, SOL_SOCKET, SO_RCVLOWAT },
{ "SNDTIMEO", 0, SOL_SOCKET, SO_SNDTIMEO },
{ "RCVTIMEO", 0, SOL_SOCKET, SO_RCVTIMEO },
#ifdef SO_USELOOPBACK /* SunOS */
{ "USELOOPBACK", 0, SOL_SOCKET, SO_USELOOPBACK },
#endif
#endif
{ "REUSEADDR", 0, SOL_SOCKET, SO_REUSEADDR },
{ "KEEPALIVE", SOCK_STREAM, SOL_SOCKET, SO_KEEPALIVE },
{ "DONTROUTE", 0, SOL_SOCKET, SO_DONTROUTE },
{ "BROADCAST", SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST },
{ "OOBINLINE", SOCK_STREAM, SOL_SOCKET, SO_OOBINLINE },
#ifdef SO_ACCEPTCONN
{ "ACCEPTCONN", SOCK_STREAM, SOL_SOCKET, SO_ACCEPTCONN },
#endif
#ifdef SO_PRIORITY /* Linux */
{ "PRIORITY", 0, SOL_SOCKET, SO_PRIORITY },
#endif
#ifdef SO_NO_CHECK /* Linux */
{ "NO_CHECK", 0, SOL_SOCKET, SO_NO_CHECK },
#endif
#ifdef SO_PROTOTYPE /* SunOS */
{ "PROTOTYPE", 0, SOL_SOCKET, SO_PROTOTYPE },
#endif
#ifdef SO_MAX_MSG_SIZE /* WinSock2 */
{ "MAX_MSG_SIZE", SOCK_DGRAM, SOL_SOCKET, SO_MAX_MSG_SIZE },
#endif
#ifdef SO_CONNECT_TIME /* WinSock2 */
{ "CONNECT_TIME", SOCK_STREAM, SOL_SOCKET, SO_CONNECT_TIME },
#endif
/* IPPROTO-level socket options */
{ "TCP_NODELAY", SOCK_STREAM, IPPROTO_TCP, TCP_NODELAY },
......@@ -85,6 +107,9 @@ static socket_option_t socket_options[] = {
#ifdef TCP_KEEPCNT
{ "TCP_KEEPCNT", SOCK_STREAM, IPPROTO_TCP, TCP_KEEPCNT },
#endif
#ifdef TCP_KEEPALIVE /* SunOS */
{ "TCP_KEEPALIVE", SOCK_STREAM, IPPROTO_TCP, TCP_KEEPALIVE },
#endif
#ifdef TCP_SYNCNT
{ "TCP_SYNCNT", SOCK_STREAM, IPPROTO_TCP, TCP_SYNCNT },
#endif
......
......@@ -45,11 +45,11 @@
/***************/
#if defined(_WIN32) /* Use WinSock */
#include <winsock.h> /* socket/bind/etc. */
/* Let's agree on a standard WinSock symbol here, people */
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#include <winsock2.h> /* socket/bind/etc. */
#include <mswsock.h> /* Microsoft WinSock2 extensions */
/* Let's agree on a standard WinSock symbol here, people */
#define _WINSOCKAPI_
#endif
#elif defined __unix__ /* Unix-variant */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment