summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c442
1 files changed, 1 insertions, 441 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 53d4506b798..16442b444b7 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -2643,445 +2643,5 @@ Init_socket()
/* constants */
mConst = rb_define_module_under(rb_cSocket, "Constants");
- sock_define_const("SOCK_STREAM", SOCK_STREAM);
- sock_define_const("SOCK_DGRAM", SOCK_DGRAM);
-#ifdef SOCK_RAW
- sock_define_const("SOCK_RAW", SOCK_RAW);
-#endif
-#ifdef SOCK_RDM
- sock_define_const("SOCK_RDM", SOCK_RDM);
-#endif
-#ifdef SOCK_SEQPACKET
- sock_define_const("SOCK_SEQPACKET", SOCK_SEQPACKET);
-#endif
-#ifdef SOCK_PACKET
- sock_define_const("SOCK_PACKET", SOCK_PACKET);
-#endif
-
- sock_define_const("AF_INET", AF_INET);
-#ifdef PF_INET
- sock_define_const("PF_INET", PF_INET);
-#endif
-#ifdef AF_UNIX
- sock_define_const("AF_UNIX", AF_UNIX);
- sock_define_const("PF_UNIX", PF_UNIX);
-#endif
-#ifdef AF_AX25
- sock_define_const("AF_AX25", AF_AX25);
- sock_define_const("PF_AX25", PF_AX25);
-#endif
-#ifdef AF_IPX
- sock_define_const("AF_IPX", AF_IPX);
- sock_define_const("PF_IPX", PF_IPX);
-#endif
-#ifdef AF_APPLETALK
- sock_define_const("AF_APPLETALK", AF_APPLETALK);
- sock_define_const("PF_APPLETALK", PF_APPLETALK);
-#endif
-#ifdef AF_UNSPEC
- sock_define_const("AF_UNSPEC", AF_UNSPEC);
- sock_define_const("PF_UNSPEC", PF_UNSPEC);
-#endif
-#ifdef INET6
- sock_define_const("AF_INET6", AF_INET6);
-#endif
-#ifdef INET6
- sock_define_const("PF_INET6", PF_INET6);
-#endif
-
- sock_define_const("MSG_OOB", MSG_OOB);
-#ifdef MSG_PEEK
- sock_define_const("MSG_PEEK", MSG_PEEK);
-#endif
-#ifdef MSG_DONTROUTE
- sock_define_const("MSG_DONTROUTE", MSG_DONTROUTE);
-#endif
-
- sock_define_const("SOL_SOCKET", SOL_SOCKET);
-#ifdef SOL_IP
- sock_define_const("SOL_IP", SOL_IP);
-#endif
-#ifdef SOL_IPX
- sock_define_const("SOL_IPX", SOL_IPX);
-#endif
-#ifdef SOL_AX25
- sock_define_const("SOL_AX25", SOL_AX25);
-#endif
-#ifdef SOL_ATALK
- sock_define_const("SOL_ATALK", SOL_ATALK);
-#endif
-#ifdef SOL_TCP
- sock_define_const("SOL_TCP", SOL_TCP);
-#endif
-#ifdef SOL_UDP
- sock_define_const("SOL_UDP", SOL_UDP);
-#endif
-
-#ifdef IPPROTO_IP
- sock_define_const("IPPROTO_IP", IPPROTO_IP);
-#else
- sock_define_const("IPPROTO_IP", 0);
-#endif
-#ifdef IPPROTO_ICMP
- sock_define_const("IPPROTO_ICMP", IPPROTO_ICMP);
-#else
- sock_define_const("IPPROTO_ICMP", 1);
-#endif
-#ifdef IPPROTO_IGMP
- sock_define_const("IPPROTO_IGMP", IPPROTO_IGMP);
-#endif
-#ifdef IPPROTO_GGP
- sock_define_const("IPPROTO_GGP", IPPROTO_GGP);
-#endif
-#ifdef IPPROTO_TCP
- sock_define_const("IPPROTO_TCP", IPPROTO_TCP);
-#else
- sock_define_const("IPPROTO_TCP", 6);
-#endif
-#ifdef IPPROTO_EGP
- sock_define_const("IPPROTO_EGP", IPPROTO_EGP);
-#endif
-#ifdef IPPROTO_PUP
- sock_define_const("IPPROTO_PUP", IPPROTO_PUP);
-#endif
-#ifdef IPPROTO_UDP
- sock_define_const("IPPROTO_UDP", IPPROTO_UDP);
-#else
- sock_define_const("IPPROTO_UDP", 17);
-#endif
-#ifdef IPPROTO_IDP
- sock_define_const("IPPROTO_IDP", IPPROTO_IDP);
-#endif
-#ifdef IPPROTO_HELLO
- sock_define_const("IPPROTO_HELLO", IPPROTO_HELLO);
-#endif
-#ifdef IPPROTO_ND
- sock_define_const("IPPROTO_ND", IPPROTO_ND);
-#endif
-#ifdef IPPROTO_TP
- sock_define_const("IPPROTO_TP", IPPROTO_TP);
-#endif
-#ifdef IPPROTO_XTP
- sock_define_const("IPPROTO_XTP", IPPROTO_XTP);
-#endif
-#ifdef IPPROTO_EON
- sock_define_const("IPPROTO_EON", IPPROTO_EON);
-#endif
-#ifdef IPPROTO_BIP
- sock_define_const("IPPROTO_BIP", IPPROTO_BIP);
-#endif
-/**/
-#ifdef IPPROTO_RAW
- sock_define_const("IPPROTO_RAW", IPPROTO_RAW);
-#else
- sock_define_const("IPPROTO_RAW", 255);
-#endif
-#ifdef IPPROTO_MAX
- sock_define_const("IPPROTO_MAX", IPPROTO_MAX);
-#endif
-
- /* Some port configuration */
-#ifdef IPPORT_RESERVED
- sock_define_const("IPPORT_RESERVED", IPPORT_RESERVED);
-#else
- sock_define_const("IPPORT_RESERVED", 1024);
-#endif
-#ifdef IPPORT_USERRESERVED
- sock_define_const("IPPORT_USERRESERVED", IPPORT_USERRESERVED);
-#else
- sock_define_const("IPPORT_USERRESERVED", 5000);
-#endif
- /* Some reserved IP v.4 addresses */
-#ifdef INADDR_ANY
- sock_define_const("INADDR_ANY", INADDR_ANY);
-#else
- sock_define_const("INADDR_ANY", 0x00000000);
-#endif
-#ifdef INADDR_BROADCAST
- sock_define_const("INADDR_BROADCAST", INADDR_BROADCAST);
-#else
- sock_define_const("INADDR_BROADCAST", 0xffffffff);
-#endif
-#ifdef INADDR_LOOPBACK
- sock_define_const("INADDR_LOOPBACK", INADDR_LOOPBACK);
-#else
- sock_define_const("INADDR_LOOPBACK", 0x7F000001);
-#endif
-#ifdef INADDR_UNSPEC_GROUP
- sock_define_const("INADDR_UNSPEC_GROUP", INADDR_UNSPEC_GROUP);
-#else
- sock_define_const("INADDR_UNSPEC_GROUP", 0xe0000000);
-#endif
-#ifdef INADDR_ALLHOSTS_GROUP
- sock_define_const("INADDR_ALLHOSTS_GROUP", INADDR_ALLHOSTS_GROUP);
-#else
- sock_define_const("INADDR_ALLHOSTS_GROUP", 0xe0000001);
-#endif
-#ifdef INADDR_MAX_LOCAL_GROUP
- sock_define_const("INADDR_MAX_LOCAL_GROUP", INADDR_MAX_LOCAL_GROUP);
-#else
- sock_define_const("INADDR_MAX_LOCAL_GROUP", 0xe00000ff);
-#endif
-#ifdef INADDR_NONE
- sock_define_const("INADDR_NONE", INADDR_NONE);
-#else
- sock_define_const("INADDR_NONE", 0xffffffff);
-#endif
- /* IP [gs]etsockopt options */
-#ifdef IP_OPTIONS
- sock_define_const("IP_OPTIONS", IP_OPTIONS);
-#endif
-#ifdef IP_HDRINCL
- sock_define_const("IP_HDRINCL", IP_HDRINCL);
-#endif
-#ifdef IP_TOS
- sock_define_const("IP_TOS", IP_TOS);
-#endif
-#ifdef IP_TTL
- sock_define_const("IP_TTL", IP_TTL);
-#endif
-#ifdef IP_RECVOPTS
- sock_define_const("IP_RECVOPTS", IP_RECVOPTS);
-#endif
-#ifdef IP_RECVRETOPTS
- sock_define_const("IP_RECVRETOPTS", IP_RECVRETOPTS);
-#endif
-#ifdef IP_RECVDSTADDR
- sock_define_const("IP_RECVDSTADDR", IP_RECVDSTADDR);
-#endif
-#ifdef IP_RETOPTS
- sock_define_const("IP_RETOPTS", IP_RETOPTS);
-#endif
-#ifdef IP_MULTICAST_IF
- sock_define_const("IP_MULTICAST_IF", IP_MULTICAST_IF);
-#endif
-#ifdef IP_MULTICAST_TTL
- sock_define_const("IP_MULTICAST_TTL", IP_MULTICAST_TTL);
-#endif
-#ifdef IP_MULTICAST_LOOP
- sock_define_const("IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
-#endif
-#ifdef IP_ADD_MEMBERSHIP
- sock_define_const("IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);
-#endif
-#ifdef IP_DROP_MEMBERSHIP
- sock_define_const("IP_DROP_MEMBERSHIP", IP_DROP_MEMBERSHIP);
-#endif
-#ifdef IP_DEFAULT_MULTICAST_TTL
- sock_define_const("IP_DEFAULT_MULTICAST_TTL", IP_DEFAULT_MULTICAST_TTL);
-#endif
-#ifdef IP_DEFAULT_MULTICAST_LOOP
- sock_define_const("IP_DEFAULT_MULTICAST_LOOP", IP_DEFAULT_MULTICAST_LOOP);
-#endif
-#ifdef IP_MAX_MEMBERSHIPS
- sock_define_const("IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);
-#endif
-#ifdef SO_DEBUG
- sock_define_const("SO_DEBUG", SO_DEBUG);
-#endif
- sock_define_const("SO_REUSEADDR", SO_REUSEADDR);
-#ifdef SO_TYPE
- sock_define_const("SO_TYPE", SO_TYPE);
-#endif
-#ifdef SO_ERROR
- sock_define_const("SO_ERROR", SO_ERROR);
-#endif
-#ifdef SO_DONTROUTE
- sock_define_const("SO_DONTROUTE", SO_DONTROUTE);
-#endif
-#ifdef SO_BROADCAST
- sock_define_const("SO_BROADCAST", SO_BROADCAST);
-#endif
-#ifdef SO_SNDBUF
- sock_define_const("SO_SNDBUF", SO_SNDBUF);
-#endif
-#ifdef SO_RCVBUF
- sock_define_const("SO_RCVBUF", SO_RCVBUF);
-#endif
-#ifdef SO_KEEPALIVE
- sock_define_const("SO_KEEPALIVE", SO_KEEPALIVE);
-#endif
-#ifdef SO_OOBINLINE
- sock_define_const("SO_OOBINLINE", SO_OOBINLINE);
-#endif
-#ifdef SO_NO_CHECK
- sock_define_const("SO_NO_CHECK", SO_NO_CHECK);
-#endif
-#ifdef SO_PRIORITY
- sock_define_const("SO_PRIORITY", SO_PRIORITY);
-#endif
-#ifdef SO_LINGER
- sock_define_const("SO_LINGER", SO_LINGER);
-#endif
-#ifdef SO_PASSCRED
- sock_define_const("SO_PASSCRED", SO_PASSCRED);
-#endif
-#ifdef SO_PEERCRED
- sock_define_const("SO_PEERCRED", SO_PEERCRED);
-#endif
-#ifdef SO_RCVLOWAT
- sock_define_const("SO_RCVLOWAT", SO_RCVLOWAT);
-#endif
-#ifdef SO_SNDLOWAT
- sock_define_const("SO_SNDLOWAT", SO_SNDLOWAT);
-#endif
-#ifdef SO_RCVTIMEO
- sock_define_const("SO_RCVTIMEO", SO_RCVTIMEO);
-#endif
-#ifdef SO_SNDTIMEO
- sock_define_const("SO_SNDTIMEO", SO_SNDTIMEO);
-#endif
-
-#ifdef SO_SECURITY_AUTHENTICATION
- sock_define_const("SO_SECURITY_AUTHENTICATION", SO_SECURITY_AUTHENTICATION);
-#endif
-#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
- sock_define_const("SO_SECURITY_ENCRYPTION_TRANSPORT", SO_SECURITY_ENCRYPTION_TRANSPORT);
-#endif
-#ifdef SO_SECURITY_ENCRYPTION_NETWORK
- sock_define_const("SO_SECURITY_ENCRYPTION_NETWORK", SO_SECURITY_ENCRYPTION_NETWORK);
-#endif
-
-#ifdef SO_BINDTODEVICE
- sock_define_const("SO_BINDTODEVICE", SO_BINDTODEVICE);
-#endif
-#ifdef SO_ATTACH_FILTER
- sock_define_const("SO_ATTACH_FILTER", SO_ATTACH_FILTER);
-#endif
-#ifdef SO_DETACH_FILTER
- sock_define_const("SO_DETACH_FILTER", SO_DETACH_FILTER);
-#endif
-#ifdef SO_PEERNAME
- sock_define_const("SO_PEERNAME", SO_PEERNAME);
-#endif
-#ifdef SO_TIMESTAMP
- sock_define_const("SO_TIMESTAMP", SO_TIMESTAMP);
-#endif
-
-#ifdef SOPRI_INTERACTIVE
- sock_define_const("SOPRI_INTERACTIVE", SOPRI_INTERACTIVE);
-#endif
-#ifdef SOPRI_NORMAL
- sock_define_const("SOPRI_NORMAL", SOPRI_NORMAL);
-#endif
-#ifdef SOPRI_BACKGROUND
- sock_define_const("SOPRI_BACKGROUND", SOPRI_BACKGROUND);
-#endif
-
-#ifdef IPX_TYPE
- sock_define_const("IPX_TYPE", IPX_TYPE);
-#endif
-
-#ifdef TCP_NODELAY
- sock_define_const("TCP_NODELAY", TCP_NODELAY);
-#endif
-#ifdef TCP_MAXSEG
- sock_define_const("TCP_MAXSEG", TCP_MAXSEG);
-#endif
-
-#ifdef EAI_ADDRFAMILY
- sock_define_const("EAI_ADDRFAMILY", EAI_ADDRFAMILY);
-#endif
-#ifdef EAI_AGAIN
- sock_define_const("EAI_AGAIN", EAI_AGAIN);
-#endif
-#ifdef EAI_BADFLAGS
- sock_define_const("EAI_BADFLAGS", EAI_BADFLAGS);
-#endif
-#ifdef EAI_FAIL
- sock_define_const("EAI_FAIL", EAI_FAIL);
-#endif
-#ifdef EAI_FAMILY
- sock_define_const("EAI_FAMILY", EAI_FAMILY);
-#endif
-#ifdef EAI_MEMORY
- sock_define_const("EAI_MEMORY", EAI_MEMORY);
-#endif
-#ifdef EAI_NODATA
- sock_define_const("EAI_NODATA", EAI_NODATA);
-#endif
-#ifdef EAI_NONAME
- sock_define_const("EAI_NONAME", EAI_NONAME);
-#endif
-#ifdef EAI_SERVICE
- sock_define_const("EAI_SERVICE", EAI_SERVICE);
-#endif
-#ifdef EAI_SOCKTYPE
- sock_define_const("EAI_SOCKTYPE", EAI_SOCKTYPE);
-#endif
-#ifdef EAI_SYSTEM
- sock_define_const("EAI_SYSTEM", EAI_SYSTEM);
-#endif
-#ifdef EAI_BADHINTS
- sock_define_const("EAI_BADHINTS", EAI_BADHINTS);
-#endif
-#ifdef EAI_PROTOCOL
- sock_define_const("EAI_PROTOCOL", EAI_PROTOCOL);
-#endif
-#ifdef EAI_MAX
- sock_define_const("EAI_MAX", EAI_MAX);
-#endif
-#ifdef AI_PASSIVE
- sock_define_const("AI_PASSIVE", AI_PASSIVE);
-#endif
-#ifdef AI_CANONNAME
- sock_define_const("AI_CANONNAME", AI_CANONNAME);
-#endif
-#ifdef AI_NUMERICHOST
- sock_define_const("AI_NUMERICHOST", AI_NUMERICHOST);
-#endif
-#ifdef AI_MASK
- sock_define_const("AI_MASK", AI_MASK);
-#endif
-#ifdef AI_ALL
- sock_define_const("AI_ALL", AI_ALL);
-#endif
-#ifdef AI_V4MAPPED_CFG
- sock_define_const("AI_V4MAPPED_CFG", AI_V4MAPPED_CFG);
-#endif
-#ifdef AI_ADDRCONFIG
- sock_define_const("AI_ADDRCONFIG", AI_ADDRCONFIG);
-#endif
-#ifdef AI_V4MAPPED
- sock_define_const("AI_V4MAPPED", AI_V4MAPPED);
-#endif
-#ifdef AI_DEFAULT
- sock_define_const("AI_DEFAULT", AI_DEFAULT);
-#endif
-#ifdef NI_MAXHOST
- sock_define_const("NI_MAXHOST", NI_MAXHOST);
-#endif
-#ifdef NI_MAXSERV
- sock_define_const("NI_MAXSERV", NI_MAXSERV);
-#endif
-#ifdef NI_NOFQDN
- sock_define_const("NI_NOFQDN", NI_NOFQDN);
-#endif
-#ifdef NI_NUMERICHOST
- sock_define_const("NI_NUMERICHOST", NI_NUMERICHOST);
-#endif
-#ifdef NI_NAMEREQD
- sock_define_const("NI_NAMEREQD", NI_NAMEREQD);
-#endif
-#ifdef NI_NUMERICSERV
- sock_define_const("NI_NUMERICSERV", NI_NUMERICSERV);
-#endif
-#ifdef NI_DGRAM
- sock_define_const("NI_DGRAM", NI_DGRAM);
-#endif
-#ifdef SHUT_RD
- sock_define_const("SHUT_RD", SHUT_RD);
-#else
- sock_define_const("SHUT_RD", 0);
-#endif
-#ifdef SHUT_WR
- sock_define_const("SHUT_WR", SHUT_WR);
-#else
- sock_define_const("SHUT_WR", 1);
-#endif
-#ifdef SHUT_RDWR
- sock_define_const("SHUT_RDWR", SHUT_RDWR);
-#else
- sock_define_const("SHUT_RDWR", 2);
-#endif
+ #include "constants.h"
}