5106 lines · 126.3 KB · C
RawDownload
#ifdef	SO_RCVLOWAT	PyModule_AddIntConstant(m, "SO_RCVLOWAT", SO_RCVLOWAT);#endif#ifdef	SO_SNDTIMEO	PyModule_AddIntConstant(m, "SO_SNDTIMEO", SO_SNDTIMEO);#endif#ifdef	SO_RCVTIMEO	PyModule_AddIntConstant(m, "SO_RCVTIMEO", SO_RCVTIMEO);#endif#ifdef	SO_ERROR	PyModule_AddIntConstant(m, "SO_ERROR", SO_ERROR);#endif#ifdef	SO_TYPE	PyModule_AddIntConstant(m, "SO_TYPE", SO_TYPE);#endif 	/* Maximum number of connections for "listen" */#ifdef	SOMAXCONN	PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);#else	PyModule_AddIntConstant(m, "SOMAXCONN", 5); /* Common value */#endif 	/* Flags for send, recv */#ifdef	MSG_OOB	PyModule_AddIntConstant(m, "MSG_OOB", MSG_OOB);#endif#ifdef	MSG_PEEK	PyModule_AddIntConstant(m, "MSG_PEEK", MSG_PEEK);#endif#ifdef	MSG_DONTROUTE	PyModule_AddIntConstant(m, "MSG_DONTROUTE", MSG_DONTROUTE);#endif#ifdef	MSG_DONTWAIT	PyModule_AddIntConstant(m, "MSG_DONTWAIT", MSG_DONTWAIT);#endif#ifdef	MSG_EOR	PyModule_AddIntConstant(m, "MSG_EOR", MSG_EOR);#endif#ifdef	MSG_TRUNC	PyModule_AddIntConstant(m, "MSG_TRUNC", MSG_TRUNC);#endif#ifdef	MSG_CTRUNC	PyModule_AddIntConstant(m, "MSG_CTRUNC", MSG_CTRUNC);#endif#ifdef	MSG_WAITALL	PyModule_AddIntConstant(m, "MSG_WAITALL", MSG_WAITALL);#endif#ifdef	MSG_BTAG	PyModule_AddIntConstant(m, "MSG_BTAG", MSG_BTAG);#endif#ifdef	MSG_ETAG	PyModule_AddIntConstant(m, "MSG_ETAG", MSG_ETAG);#endif 	/* Protocol level and numbers, usable for [gs]etsockopt */#ifdef	SOL_SOCKET	PyModule_AddIntConstant(m, "SOL_SOCKET", SOL_SOCKET);#endif#ifdef	SOL_IP	PyModule_AddIntConstant(m, "SOL_IP", SOL_IP);#else	PyModule_AddIntConstant(m, "SOL_IP", 0);#endif#ifdef	SOL_IPX	PyModule_AddIntConstant(m, "SOL_IPX", SOL_IPX);#endif#ifdef	SOL_AX25	PyModule_AddIntConstant(m, "SOL_AX25", SOL_AX25);#endif#ifdef	SOL_ATALK	PyModule_AddIntConstant(m, "SOL_ATALK", SOL_ATALK);#endif#ifdef	SOL_NETROM	PyModule_AddIntConstant(m, "SOL_NETROM", SOL_NETROM);#endif#ifdef	SOL_ROSE	PyModule_AddIntConstant(m, "SOL_ROSE", SOL_ROSE);#endif#ifdef	SOL_TCP	PyModule_AddIntConstant(m, "SOL_TCP", SOL_TCP);#else	PyModule_AddIntConstant(m, "SOL_TCP", 6);#endif#ifdef	SOL_UDP	PyModule_AddIntConstant(m, "SOL_UDP", SOL_UDP);#else	PyModule_AddIntConstant(m, "SOL_UDP", 17);#endif#ifdef	IPPROTO_IP	PyModule_AddIntConstant(m, "IPPROTO_IP", IPPROTO_IP);#else	PyModule_AddIntConstant(m, "IPPROTO_IP", 0);#endif#ifdef	IPPROTO_HOPOPTS	PyModule_AddIntConstant(m, "IPPROTO_HOPOPTS", IPPROTO_HOPOPTS);#endif#ifdef	IPPROTO_ICMP	PyModule_AddIntConstant(m, "IPPROTO_ICMP", IPPROTO_ICMP);#else	PyModule_AddIntConstant(m, "IPPROTO_ICMP", 1);#endif#ifdef	IPPROTO_IGMP	PyModule_AddIntConstant(m, "IPPROTO_IGMP", IPPROTO_IGMP);#endif#ifdef	IPPROTO_GGP	PyModule_AddIntConstant(m, "IPPROTO_GGP", IPPROTO_GGP);#endif#ifdef	IPPROTO_IPV4	PyModule_AddIntConstant(m, "IPPROTO_IPV4", IPPROTO_IPV4);#endif#ifdef	IPPROTO_IPV6	PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6);#endif#ifdef	IPPROTO_IPIP	PyModule_AddIntConstant(m, "IPPROTO_IPIP", IPPROTO_IPIP);#endif#ifdef	IPPROTO_TCP	PyModule_AddIntConstant(m, "IPPROTO_TCP", IPPROTO_TCP);#else	PyModule_AddIntConstant(m, "IPPROTO_TCP", 6);#endif#ifdef	IPPROTO_EGP	PyModule_AddIntConstant(m, "IPPROTO_EGP", IPPROTO_EGP);#endif#ifdef	IPPROTO_PUP	PyModule_AddIntConstant(m, "IPPROTO_PUP", IPPROTO_PUP);#endif#ifdef	IPPROTO_UDP	PyModule_AddIntConstant(m, "IPPROTO_UDP", IPPROTO_UDP);#else	PyModule_AddIntConstant(m, "IPPROTO_UDP", 17);#endif#ifdef	IPPROTO_IDP	PyModule_AddIntConstant(m, "IPPROTO_IDP", IPPROTO_IDP);#endif#ifdef	IPPROTO_HELLO	PyModule_AddIntConstant(m, "IPPROTO_HELLO", IPPROTO_HELLO);#endif#ifdef	IPPROTO_ND	PyModule_AddIntConstant(m, "IPPROTO_ND", IPPROTO_ND);#endif#ifdef	IPPROTO_TP	PyModule_AddIntConstant(m, "IPPROTO_TP", IPPROTO_TP);#endif#ifdef	IPPROTO_IPV6	PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6);#endif#ifdef	IPPROTO_ROUTING	PyModule_AddIntConstant(m, "IPPROTO_ROUTING", IPPROTO_ROUTING);#endif#ifdef	IPPROTO_FRAGMENT	PyModule_AddIntConstant(m, "IPPROTO_FRAGMENT", IPPROTO_FRAGMENT);#endif#ifdef	IPPROTO_RSVP	PyModule_AddIntConstant(m, "IPPROTO_RSVP", IPPROTO_RSVP);#endif#ifdef	IPPROTO_GRE	PyModule_AddIntConstant(m, "IPPROTO_GRE", IPPROTO_GRE);#endif#ifdef	IPPROTO_ESP	PyModule_AddIntConstant(m, "IPPROTO_ESP", IPPROTO_ESP);#endif#ifdef	IPPROTO_AH	PyModule_AddIntConstant(m, "IPPROTO_AH", IPPROTO_AH);#endif#ifdef	IPPROTO_MOBILE	PyModule_AddIntConstant(m, "IPPROTO_MOBILE", IPPROTO_MOBILE);#endif#ifdef	IPPROTO_ICMPV6	PyModule_AddIntConstant(m, "IPPROTO_ICMPV6", IPPROTO_ICMPV6);#endif#ifdef	IPPROTO_NONE	PyModule_AddIntConstant(m, "IPPROTO_NONE", IPPROTO_NONE);#endif#ifdef	IPPROTO_DSTOPTS	PyModule_AddIntConstant(m, "IPPROTO_DSTOPTS", IPPROTO_DSTOPTS);#endif#ifdef	IPPROTO_XTP	PyModule_AddIntConstant(m, "IPPROTO_XTP", IPPROTO_XTP);#endif#ifdef	IPPROTO_EON	PyModule_AddIntConstant(m, "IPPROTO_EON", IPPROTO_EON);#endif#ifdef	IPPROTO_PIM	PyModule_AddIntConstant(m, "IPPROTO_PIM", IPPROTO_PIM);#endif#ifdef	IPPROTO_IPCOMP	PyModule_AddIntConstant(m, "IPPROTO_IPCOMP", IPPROTO_IPCOMP);#endif#ifdef	IPPROTO_VRRP	PyModule_AddIntConstant(m, "IPPROTO_VRRP", IPPROTO_VRRP);#endif#ifdef	IPPROTO_BIP	PyModule_AddIntConstant(m, "IPPROTO_BIP", IPPROTO_BIP);#endif/**/#ifdef	IPPROTO_RAW	PyModule_AddIntConstant(m, "IPPROTO_RAW", IPPROTO_RAW);#else	PyModule_AddIntConstant(m, "IPPROTO_RAW", 255);#endif#ifdef	IPPROTO_MAX	PyModule_AddIntConstant(m, "IPPROTO_MAX", IPPROTO_MAX);#endif 	/* Some port configuration */#ifdef	IPPORT_RESERVED	PyModule_AddIntConstant(m, "IPPORT_RESERVED", IPPORT_RESERVED);#else	PyModule_AddIntConstant(m, "IPPORT_RESERVED", 1024);#endif#ifdef	IPPORT_USERRESERVED	PyModule_AddIntConstant(m, "IPPORT_USERRESERVED", IPPORT_USERRESERVED);#else	PyModule_AddIntConstant(m, "IPPORT_USERRESERVED", 5000);#endif 	/* Some reserved IP v.4 addresses */#ifdef	INADDR_ANY	PyModule_AddIntConstant(m, "INADDR_ANY", INADDR_ANY);#else	PyModule_AddIntConstant(m, "INADDR_ANY", 0x00000000);#endif#ifdef	INADDR_BROADCAST	PyModule_AddIntConstant(m, "INADDR_BROADCAST", INADDR_BROADCAST);#else	PyModule_AddIntConstant(m, "INADDR_BROADCAST", 0xffffffff);#endif#ifdef	INADDR_LOOPBACK	PyModule_AddIntConstant(m, "INADDR_LOOPBACK", INADDR_LOOPBACK);#else	PyModule_AddIntConstant(m, "INADDR_LOOPBACK", 0x7F000001);#endif#ifdef	INADDR_UNSPEC_GROUP	PyModule_AddIntConstant(m, "INADDR_UNSPEC_GROUP", INADDR_UNSPEC_GROUP);#else	PyModule_AddIntConstant(m, "INADDR_UNSPEC_GROUP", 0xe0000000);#endif#ifdef	INADDR_ALLHOSTS_GROUP	PyModule_AddIntConstant(m, "INADDR_ALLHOSTS_GROUP",				INADDR_ALLHOSTS_GROUP);#else	PyModule_AddIntConstant(m, "INADDR_ALLHOSTS_GROUP", 0xe0000001);#endif#ifdef	INADDR_MAX_LOCAL_GROUP	PyModule_AddIntConstant(m, "INADDR_MAX_LOCAL_GROUP",				INADDR_MAX_LOCAL_GROUP);#else	PyModule_AddIntConstant(m, "INADDR_MAX_LOCAL_GROUP", 0xe00000ff);#endif#ifdef	INADDR_NONE	PyModule_AddIntConstant(m, "INADDR_NONE", INADDR_NONE);#else	PyModule_AddIntConstant(m, "INADDR_NONE", 0xffffffff);#endif 	/* IPv4 [gs]etsockopt options */#ifdef	IP_OPTIONS	PyModule_AddIntConstant(m, "IP_OPTIONS", IP_OPTIONS);#endif#ifdef	IP_HDRINCL	PyModule_AddIntConstant(m, "IP_HDRINCL", IP_HDRINCL);#endif#ifdef	IP_TOS	PyModule_AddIntConstant(m, "IP_TOS", IP_TOS);#endif#ifdef	IP_TTL	PyModule_AddIntConstant(m, "IP_TTL", IP_TTL);#endif#ifdef	IP_RECVOPTS	PyModule_AddIntConstant(m, "IP_RECVOPTS", IP_RECVOPTS);#endif#ifdef	IP_RECVRETOPTS	PyModule_AddIntConstant(m, "IP_RECVRETOPTS", IP_RECVRETOPTS);#endif#ifdef	IP_RECVDSTADDR	PyModule_AddIntConstant(m, "IP_RECVDSTADDR", IP_RECVDSTADDR);#endif#ifdef	IP_RETOPTS	PyModule_AddIntConstant(m, "IP_RETOPTS", IP_RETOPTS);#endif#ifdef	IP_MULTICAST_IF	PyModule_AddIntConstant(m, "IP_MULTICAST_IF", IP_MULTICAST_IF);#endif#ifdef	IP_MULTICAST_TTL	PyModule_AddIntConstant(m, "IP_MULTICAST_TTL", IP_MULTICAST_TTL);#endif#ifdef	IP_MULTICAST_LOOP	PyModule_AddIntConstant(m, "IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);#endif#ifdef	IP_ADD_MEMBERSHIP	PyModule_AddIntConstant(m, "IP_ADD_MEMBERSHIP", IP_ADD_MEMBERSHIP);#endif#ifdef	IP_DROP_MEMBERSHIP	PyModule_AddIntConstant(m, "IP_DROP_MEMBERSHIP", IP_DROP_MEMBERSHIP);#endif#ifdef	IP_DEFAULT_MULTICAST_TTL	PyModule_AddIntConstant(m, "IP_DEFAULT_MULTICAST_TTL",				IP_DEFAULT_MULTICAST_TTL);#endif#ifdef	IP_DEFAULT_MULTICAST_LOOP	PyModule_AddIntConstant(m, "IP_DEFAULT_MULTICAST_LOOP",				IP_DEFAULT_MULTICAST_LOOP);#endif#ifdef	IP_MAX_MEMBERSHIPS	PyModule_AddIntConstant(m, "IP_MAX_MEMBERSHIPS", IP_MAX_MEMBERSHIPS);#endif 	/* IPv6 [gs]etsockopt options, defined in RFC2553 */#ifdef	IPV6_JOIN_GROUP	PyModule_AddIntConstant(m, "IPV6_JOIN_GROUP", IPV6_JOIN_GROUP);#endif#ifdef	IPV6_LEAVE_GROUP	PyModule_AddIntConstant(m, "IPV6_LEAVE_GROUP", IPV6_LEAVE_GROUP);#endif#ifdef	IPV6_MULTICAST_HOPS	PyModule_AddIntConstant(m, "IPV6_MULTICAST_HOPS", IPV6_MULTICAST_HOPS);#endif#ifdef	IPV6_MULTICAST_IF	PyModule_AddIntConstant(m, "IPV6_MULTICAST_IF", IPV6_MULTICAST_IF);#endif#ifdef	IPV6_MULTICAST_LOOP	PyModule_AddIntConstant(m, "IPV6_MULTICAST_LOOP", IPV6_MULTICAST_LOOP);#endif#ifdef	IPV6_UNICAST_HOPS	PyModule_AddIntConstant(m, "IPV6_UNICAST_HOPS", IPV6_UNICAST_HOPS);#endif        /* Additional IPV6 socket options, defined in RFC 3493 */#ifdef IPV6_V6ONLY	PyModule_AddIntConstant(m, "IPV6_V6ONLY", IPV6_V6ONLY);#endif	/* Advanced IPV6 socket options, from RFC 3542 */#ifdef IPV6_CHECKSUM	PyModule_AddIntConstant(m, "IPV6_CHECKSUM", IPV6_CHECKSUM);#endif#ifdef IPV6_DONTFRAG	PyModule_AddIntConstant(m, "IPV6_DONTFRAG", IPV6_DONTFRAG);#endif#ifdef IPV6_DSTOPTS	PyModule_AddIntConstant(m, "IPV6_DSTOPTS", IPV6_DSTOPTS);#endif#ifdef IPV6_HOPLIMIT	PyModule_AddIntConstant(m, "IPV6_HOPLIMIT", IPV6_HOPLIMIT);#endif#ifdef IPV6_HOPOPTS	PyModule_AddIntConstant(m, "IPV6_HOPOPTS", IPV6_HOPOPTS);#endif#ifdef IPV6_NEXTHOP	PyModule_AddIntConstant(m, "IPV6_NEXTHOP", IPV6_NEXTHOP);#endif#ifdef IPV6_PATHMTU	PyModule_AddIntConstant(m, "IPV6_PATHMTU", IPV6_PATHMTU);#endif#ifdef IPV6_PKTINFO	PyModule_AddIntConstant(m, "IPV6_PKTINFO", IPV6_PKTINFO);#endif#ifdef IPV6_RECVDSTOPTS	PyModule_AddIntConstant(m, "IPV6_RECVDSTOPTS", IPV6_RECVDSTOPTS);#endif#ifdef IPV6_RECVHOPLIMIT	PyModule_AddIntConstant(m, "IPV6_RECVHOPLIMIT", IPV6_RECVHOPLIMIT);#endif#ifdef IPV6_RECVHOPOPTS	PyModule_AddIntConstant(m, "IPV6_RECVHOPOPTS", IPV6_RECVHOPOPTS);#endif#ifdef IPV6_RECVPKTINFO	PyModule_AddIntConstant(m, "IPV6_RECVPKTINFO", IPV6_RECVPKTINFO);#endif#ifdef IPV6_RECVRTHDR	PyModule_AddIntConstant(m, "IPV6_RECVRTHDR", IPV6_RECVRTHDR);#endif#ifdef IPV6_RECVTCLASS	PyModule_AddIntConstant(m, "IPV6_RECVTCLASS", IPV6_RECVTCLASS);#endif#ifdef IPV6_RTHDR	PyModule_AddIntConstant(m, "IPV6_RTHDR", IPV6_RTHDR);#endif#ifdef IPV6_RTHDRDSTOPTS	PyModule_AddIntConstant(m, "IPV6_RTHDRDSTOPTS", IPV6_RTHDRDSTOPTS);#endif#ifdef IPV6_RTHDR_TYPE_0	PyModule_AddIntConstant(m, "IPV6_RTHDR_TYPE_0", IPV6_RTHDR_TYPE_0);#endif#ifdef IPV6_RECVPATHMTU	PyModule_AddIntConstant(m, "IPV6_RECVPATHMTU", IPV6_RECVPATHMTU);#endif#ifdef IPV6_TCLASS	PyModule_AddIntConstant(m, "IPV6_TCLASS", IPV6_TCLASS);#endif#ifdef IPV6_USE_MIN_MTU	PyModule_AddIntConstant(m, "IPV6_USE_MIN_MTU", IPV6_USE_MIN_MTU);#endif 	/* TCP options */#ifdef	TCP_NODELAY	PyModule_AddIntConstant(m, "TCP_NODELAY", TCP_NODELAY);#endif#ifdef	TCP_MAXSEG	PyModule_AddIntConstant(m, "TCP_MAXSEG", TCP_MAXSEG);#endif#ifdef	TCP_CORK	PyModule_AddIntConstant(m, "TCP_CORK", TCP_CORK);#endif#ifdef	TCP_KEEPIDLE	PyModule_AddIntConstant(m, "TCP_KEEPIDLE", TCP_KEEPIDLE);#endif#ifdef	TCP_KEEPINTVL	PyModule_AddIntConstant(m, "TCP_KEEPINTVL", TCP_KEEPINTVL);#endif#ifdef	TCP_KEEPCNT	PyModule_AddIntConstant(m, "TCP_KEEPCNT", TCP_KEEPCNT);#endif#ifdef	TCP_SYNCNT	PyModule_AddIntConstant(m, "TCP_SYNCNT", TCP_SYNCNT);#endif#ifdef	TCP_LINGER2	PyModule_AddIntConstant(m, "TCP_LINGER2", TCP_LINGER2);#endif#ifdef	TCP_DEFER_ACCEPT	PyModule_AddIntConstant(m, "TCP_DEFER_ACCEPT", TCP_DEFER_ACCEPT);#endif#ifdef	TCP_WINDOW_CLAMP	PyModule_AddIntConstant(m, "TCP_WINDOW_CLAMP", TCP_WINDOW_CLAMP);#endif#ifdef	TCP_INFO	PyModule_AddIntConstant(m, "TCP_INFO", TCP_INFO);#endif#ifdef	TCP_QUICKACK	PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);#endif  	/* IPX options */#ifdef	IPX_TYPE	PyModule_AddIntConstant(m, "IPX_TYPE", IPX_TYPE);#endif 	/* get{addr,name}info parameters */#ifdef EAI_ADDRFAMILY	PyModule_AddIntConstant(m, "EAI_ADDRFAMILY", EAI_ADDRFAMILY);#endif#ifdef EAI_AGAIN	PyModule_AddIntConstant(m, "EAI_AGAIN", EAI_AGAIN);#endif#ifdef EAI_BADFLAGS	PyModule_AddIntConstant(m, "EAI_BADFLAGS", EAI_BADFLAGS);#endif#ifdef EAI_FAIL	PyModule_AddIntConstant(m, "EAI_FAIL", EAI_FAIL);#endif#ifdef EAI_FAMILY	PyModule_AddIntConstant(m, "EAI_FAMILY", EAI_FAMILY);#endif#ifdef EAI_MEMORY	PyModule_AddIntConstant(m, "EAI_MEMORY", EAI_MEMORY);#endif#ifdef EAI_NODATA	PyModule_AddIntConstant(m, "EAI_NODATA", EAI_NODATA);#endif#ifdef EAI_NONAME	PyModule_AddIntConstant(m, "EAI_NONAME", EAI_NONAME);#endif#ifdef EAI_OVERFLOW	PyModule_AddIntConstant(m, "EAI_OVERFLOW", EAI_OVERFLOW);#endif#ifdef EAI_SERVICE	PyModule_AddIntConstant(m, "EAI_SERVICE", EAI_SERVICE);#endif#ifdef EAI_SOCKTYPE	PyModule_AddIntConstant(m, "EAI_SOCKTYPE", EAI_SOCKTYPE);#endif#ifdef EAI_SYSTEM	PyModule_AddIntConstant(m, "EAI_SYSTEM", EAI_SYSTEM);#endif#ifdef EAI_BADHINTS	PyModule_AddIntConstant(m, "EAI_BADHINTS", EAI_BADHINTS);#endif#ifdef EAI_PROTOCOL	PyModule_AddIntConstant(m, "EAI_PROTOCOL", EAI_PROTOCOL);#endif#ifdef EAI_MAX	PyModule_AddIntConstant(m, "EAI_MAX", EAI_MAX);#endif#ifdef AI_PASSIVE	PyModule_AddIntConstant(m, "AI_PASSIVE", AI_PASSIVE);#endif#ifdef AI_CANONNAME	PyModule_AddIntConstant(m, "AI_CANONNAME", AI_CANONNAME);#endif#ifdef AI_NUMERICHOST	PyModule_AddIntConstant(m, "AI_NUMERICHOST", AI_NUMERICHOST);#endif#ifdef AI_NUMERICSERV	PyModule_AddIntConstant(m, "AI_NUMERICSERV", AI_NUMERICSERV);#endif#ifdef AI_MASK	PyModule_AddIntConstant(m, "AI_MASK", AI_MASK);#endif#ifdef AI_ALL

Lines 4501–5000 of 5106. Previous lines