00001 #ifndef _NETDB_H_ 00002 00003 /* 00004 * Copyright (C) 2002 by egnite Software GmbH. All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 3. Neither the name of the copyright holders nor the names of 00016 * contributors may be used to endorse or promote products derived 00017 * from this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00020 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00022 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00023 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00024 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00025 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00026 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00027 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00028 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00029 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00030 * SUCH DAMAGE. 00031 * 00032 * For additional information see http://www.ethernut.de/ 00033 * 00034 * - 00035 * Copyright (c) 1980, 1983, 1988, 1993 00036 * The Regents of the University of California. All rights reserved. 00037 * 00038 * Redistribution and use in source and binary forms, with or without 00039 * modification, are permitted provided that the following conditions 00040 * are met: 00041 * 1. Redistributions of source code must retain the above copyright 00042 * notice, this list of conditions and the following disclaimer. 00043 * 2. Redistributions in binary form must reproduce the above copyright 00044 * notice, this list of conditions and the following disclaimer in the 00045 * documentation and/or other materials provided with the distribution. 00046 * 3. Neither the name of the University nor the names of its contributors 00047 * may be used to endorse or promote products derived from this software 00048 * without specific prior written permission. 00049 * 00050 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00051 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00052 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00053 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00054 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00055 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00056 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00057 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00058 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00059 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00060 * SUCH DAMAGE. 00061 * 00062 * - 00063 * Portions Copyright (c) 1993 by Digital Equipment Corporation. 00064 * 00065 * Permission to use, copy, modify, and distribute this software for any 00066 * purpose with or without fee is hereby granted, provided that the above 00067 * copyright notice and this permission notice appear in all copies, and that 00068 * the name of Digital Equipment Corporation not be used in advertising or 00069 * publicity pertaining to distribution of the document or software without 00070 * specific, written prior permission. 00071 * 00072 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL 00073 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES 00074 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT 00075 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 00076 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 00077 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 00078 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 00079 * SOFTWARE. 00080 */ 00081 00082 /* 00083 * $Log: netdb.h,v $ 00084 * Revision 1.8 2008/08/11 06:59:58 haraldkipp 00085 * BSD types replaced by stdint types (feature request #1282721). 00086 * 00087 * Revision 1.7 2008/02/15 17:07:09 haraldkipp 00088 * Added routine to query DNS IP settings. 00089 * 00090 * Revision 1.6 2005/07/26 15:49:59 haraldkipp 00091 * Cygwin support added. 00092 * 00093 * Revision 1.5 2005/04/04 19:33:40 freckle 00094 * added creation of include/netdb_orig.h, include/sys/socket_orig.h and 00095 * include/netinet/in_orig.h to allow unix emulation to use tcp/ip sockets 00096 * 00097 * Revision 1.4 2004/04/15 19:28:02 drsung 00098 * New function NutDnsGetMxByDomain to request 00099 * an MX record from DNS server. 00100 * 00101 * Revision 1.3 2004/03/16 16:48:27 haraldkipp 00102 * Added Jan Dubiec's H8/300 port. 00103 * 00104 * Revision 1.2 2003/07/20 18:26:41 haraldkipp 00105 * Support secondary DNS. 00106 * 00107 * Revision 1.1.1.1 2003/05/09 14:41:03 haraldkipp 00108 * Initial using 3.2.1 00109 * 00110 * Revision 1.5 2003/05/06 18:38:33 harald 00111 * Cleanup 00112 * 00113 * Revision 1.4 2003/02/04 18:00:36 harald 00114 * Version 3 released 00115 * 00116 * Revision 1.3 2002/06/26 17:29:14 harald 00117 * First pre-release with 2.4 stack 00118 * 00119 */ 00120 00121 /* use native version on unix emulation */ 00122 #if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) 00123 #include <netdb_orig.h> 00124 /* assure _NETDB_H_ is set */ 00125 #undef _NETDB_H_ 00126 #define _NETDB_H_ 00127 #else /* unix emulation */ 00128 00129 #define _NETDB_H_ 00130 #include <sys/types.h> 00131 #include <stdint.h> 00132 00133 __BEGIN_DECLS 00134 00135 /* 00136 * Error return codes. 00137 */ 00138 #define NETDB_INTERNAL -1 /* see errno */ 00139 #define NETDB_SUCCESS 0 /* no problem */ 00140 #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */ 00141 #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */ 00142 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ 00143 #define NO_DATA 4 /* Valid name, no data record of requested type */ 00144 #define NO_ADDRESS NO_DATA /* no address, look for MX record */ 00145 00146 __END_DECLS 00147 00148 #endif /* unix emulation */ 00149 00150 __BEGIN_DECLS 00151 00152 extern void NutDnsConfig2(uint8_t * hostname, uint8_t * domain, uint32_t pdnsip, uint32_t sdnsip); 00153 extern void NutDnsGetConfig2(char ** hostname, char ** domain, uint32_t *pdnsip, uint32_t *sdnsip); 00154 extern void NutDnsConfig(CONST uint8_t *hostname, CONST uint8_t *domain, uint32_t dnsip); 00155 extern uint32_t NutDnsGetHostByName(CONST uint8_t *hostname); 00156 extern uint32_t NutDnsGetMxByDomain(CONST uint8_t * hostname); 00157 00158 __END_DECLS 00159 00160 #endif