⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net.h

📁 bind 9.3结合mysql数据库
💻 H
字号:
/* * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003  Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. *//* $Id: net.h,v 1.15.12.10 2004/04/29 01:31:23 marka Exp $ */#ifndef ISC_NET_H#define ISC_NET_H 1/* * Also define LWRES_IPV6_H to keep it from being included if liblwres is * being used, or redefinition errors will occur. */#define LWRES_IPV6_H 1/***** ***** Module Info *****//* * Basic Networking Types * * This module is responsible for defining the following basic networking * types: * *		struct in_addr *		struct in6_addr *		struct in6_pktinfo *		struct sockaddr *		struct sockaddr_in *		struct sockaddr_in6 *		in_port_t * * It ensures that the AF_ and PF_ macros are defined. * * It declares ntoh[sl]() and hton[sl](). * * It declares inet_aton(), inet_ntop(), and inet_pton(). * * It ensures that INADDR_ANY, IN6ADDR_ANY_INIT, in6addr_any, and * in6addr_loopback are available. * * It ensures that IN_MULTICAST() is available to check for multicast * addresses. * * MP: *	No impact. * * Reliability: *	No anticipated impact. * * Resources: *	N/A. * * Security: *	No anticipated impact. * * Standards: *	BSD Socket API *	RFC 2553 *//*** *** Imports. ***/#include <isc/platform.h>/* * Because of some sort of problem in the MS header files, this cannot * be simple "#include <winsock2.h>", because winsock2.h tries to include * windows.h, which then generates an error out of mswsock.h.  _You_ * figure it out. */#ifndef _WINSOCKAPI_#define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */#endif#include <winsock2.h>#include <sys/types.h>#include <isc/lang.h>#include <isc/types.h>#include <ws2tcpip.h>#include <isc/ipv6.h>/* * This is here because named client, interfacemgr.c, etc. use the name as * a variable */#undef interface #ifndef INADDR_LOOPBACK#define INADDR_LOOPBACK 0x7f000001UL#endif#ifndef ISC_PLATFORM_HAVEIN6PKTINFOstruct in6_pktinfo {	struct in6_addr ipi6_addr;    /* src/dst IPv6 address */	unsigned int    ipi6_ifindex; /* send/recv interface index */};#endif#if _MSC_VER < 1300#define in6addr_any isc_in6addr_any#define in6addr_loopback isc_in6addr_loopback#endif/* * Ensure type in_port_t is defined. */#ifdef ISC_PLATFORM_NEEDPORTTtypedef isc_uint16_t in_port_t;#endif/* * If this system does not have MSG_TRUNC (as returned from recvmsg()) * ISC_PLATFORM_RECVOVERFLOW will be defined.  This will enable the MSG_TRUNC * faking code in socket.c. */#ifndef MSG_TRUNC#define ISC_PLATFORM_RECVOVERFLOW#endif#define ISC__IPADDR(x)	((isc_uint32_t)htonl((isc_uint32_t)(x)))#define ISC_IPADDR_ISMULTICAST(i) \		(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \		 == ISC__IPADDR(0xe0000000))#define ISC_IPADDR_ISEXPERIMENTAL(i) \		(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \		 == ISC__IPADDR(0xf0000000))/* * Fix the FD_SET and FD_CLR Macros to properly cast */#undef FD_CLR#define FD_CLR(fd, set) do { \    u_int __i; \    for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \        if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET) fd) { \            while (__i < ((fd_set FAR *)(set))->fd_count-1) { \                ((fd_set FAR *)(set))->fd_array[__i] = \                    ((fd_set FAR *)(set))->fd_array[__i+1]; \                __i++; \            } \            ((fd_set FAR *)(set))->fd_count--; \            break; \        } \    } \} while (0)#undef FD_SET#define FD_SET(fd, set) do { \    u_int __i; \    for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \        if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET)(fd)) { \            break; \        } \    } \    if (__i == ((fd_set FAR *)(set))->fd_count) { \        if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \            ((fd_set FAR *)(set))->fd_array[__i] = (SOCKET)(fd); \            ((fd_set FAR *)(set))->fd_count++; \        } \    } \} while (0)/* * Windows Sockets errors redefined as regular Berkeley error constants. * These are usually commented out in Windows NT to avoid conflicts with errno.h. * Use the WSA constants instead. */#define EWOULDBLOCK             WSAEWOULDBLOCK#define EINPROGRESS             WSAEINPROGRESS#define EALREADY                WSAEALREADY#define ENOTSOCK                WSAENOTSOCK#define EDESTADDRREQ            WSAEDESTADDRREQ#define EMSGSIZE                WSAEMSGSIZE#define EPROTOTYPE              WSAEPROTOTYPE#define ENOPROTOOPT             WSAENOPROTOOPT#define EPROTONOSUPPORT         WSAEPROTONOSUPPORT#define ESOCKTNOSUPPORT         WSAESOCKTNOSUPPORT#define EOPNOTSUPP              WSAEOPNOTSUPP#define EPFNOSUPPORT            WSAEPFNOSUPPORT#define EAFNOSUPPORT            WSAEAFNOSUPPORT#define EADDRINUSE              WSAEADDRINUSE#define EADDRNOTAVAIL           WSAEADDRNOTAVAIL#define ENETDOWN                WSAENETDOWN#define ENETUNREACH             WSAENETUNREACH#define ENETRESET               WSAENETRESET#define ECONNABORTED            WSAECONNABORTED#define ECONNRESET              WSAECONNRESET#define ENOBUFS                 WSAENOBUFS#define EISCONN                 WSAEISCONN#define ENOTCONN                WSAENOTCONN#define ESHUTDOWN               WSAESHUTDOWN#define ETOOMANYREFS            WSAETOOMANYREFS#define ETIMEDOUT               WSAETIMEDOUT#define ECONNREFUSED            WSAECONNREFUSED#define ELOOP                   WSAELOOP#define EHOSTDOWN               WSAEHOSTDOWN#define EHOSTUNREACH            WSAEHOSTUNREACH#define EPROCLIM                WSAEPROCLIM#define EUSERS                  WSAEUSERS#define EDQUOT                  WSAEDQUOT#define ESTALE                  WSAESTALE#define EREMOTE                 WSAEREMOTE/*** *** Functions. ***/ISC_LANG_BEGINDECLSisc_result_tisc_net_probeipv4(void);/* * Check if the system's kernel supports IPv4. * * Returns: * *	ISC_R_SUCCESS		IPv4 is supported. *	ISC_R_NOTFOUND		IPv4 is not supported. *	ISC_R_DISABLED		IPv4 is disabled. *	ISC_R_UNEXPECTED */isc_result_tisc_net_probeipv6(void);/* * Check if the system's kernel supports IPv6. * * Returns: * *	ISC_R_SUCCESS		IPv6 is supported. *	ISC_R_NOTFOUND		IPv6 is not supported. *	ISC_R_DISABLED		IPv6 is disabled. *	ISC_R_UNEXPECTED */isc_result_tisc_net_probe_ipv6only(void);/* * Check if the system's kernel supports the IPV6_V6ONLY socket option. * * Returns: * *	ISC_R_SUCCESS		the option is supported for both TCP and UDP. *	ISC_R_NOTFOUND		IPv6 itself or the option is not supported. *	ISC_R_UNEXPECTED */isc_result_tisc_net_probe_ipv6pktinfo(void);/* * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option * for UDP sockets. * * Returns: * *	ISC_R_SUCCESS		the option is supported. *	ISC_R_NOTFOUND		IPv6 itself or the option is not supported. *	ISC_R_UNEXPECTED */voidisc_net_disableipv4(void);voidisc_net_disableipv6(void);voidisc_net_enableipv4(void);voidisc_net_enableipv6(void);#ifdef ISC_PLATFORM_NEEDNTOPconst char *isc_net_ntop(int af, const void *src, char *dst, size_t size);#define inet_ntop isc_net_ntop#endif#ifdef ISC_PLATFORM_NEEDPTONintisc_net_pton(int af, const char *src, void *dst);#define inet_pton isc_net_pton#endif#ifdef ISC_PLATFORM_NEEDATONintisc_net_aton(const char *cp, struct in_addr *addr);#define inet_aton isc_net_aton#endifISC_LANG_ENDDECLS#endif /* ISC_NET_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -