netdb.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #ifndef _NETDB_H_
  2. /*
  3. * <MFS> Modified for Streamit
  4. * Added NutGetDnsServers()
  5. *
  6. * Copyright (C) 2002 by egnite Software GmbH. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  25. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. *
  36. * -
  37. * Copyright (c) 1980, 1983, 1988, 1993
  38. * The Regents of the University of California. All rights reserved.
  39. *
  40. * Redistribution and use in source and binary forms, with or without
  41. * modification, are permitted provided that the following conditions
  42. * are met:
  43. * 1. Redistributions of source code must retain the above copyright
  44. * notice, this list of conditions and the following disclaimer.
  45. * 2. Redistributions in binary form must reproduce the above copyright
  46. * notice, this list of conditions and the following disclaimer in the
  47. * documentation and/or other materials provided with the distribution.
  48. * 3. Neither the name of the University nor the names of its contributors
  49. * may be used to endorse or promote products derived from this software
  50. * without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  53. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  54. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  55. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  56. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  57. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  58. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  59. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  60. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  61. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  62. * SUCH DAMAGE.
  63. *
  64. * -
  65. * Portions Copyright (c) 1993 by Digital Equipment Corporation.
  66. *
  67. * Permission to use, copy, modify, and distribute this software for any
  68. * purpose with or without fee is hereby granted, provided that the above
  69. * copyright notice and this permission notice appear in all copies, and that
  70. * the name of Digital Equipment Corporation not be used in advertising or
  71. * publicity pertaining to distribution of the document or software without
  72. * specific, written prior permission.
  73. *
  74. * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  75. * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  76. * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
  77. * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  78. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  79. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  80. * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  81. * SOFTWARE.
  82. */
  83. /*
  84. * $Log: netdb.h,v $
  85. * Revision 1.6 2005/07/26 15:49:59 haraldkipp
  86. * Cygwin support added.
  87. *
  88. * Revision 1.5 2005/04/04 19:33:40 freckle
  89. * added creation of include/netdb_orig.h, include/sys/socket_orig.h and
  90. * include/netinet/in_orig.h to allow unix emulation to use tcp/ip sockets
  91. *
  92. * Revision 1.4 2004/04/15 19:28:02 drsung
  93. * New function NutDnsGetMxByDomain to request
  94. * an MX record from DNS server.
  95. *
  96. * Revision 1.3 2004/03/16 16:48:27 haraldkipp
  97. * Added Jan Dubiec's H8/300 port.
  98. *
  99. * Revision 1.2 2003/07/20 18:26:41 haraldkipp
  100. * Support secondary DNS.
  101. *
  102. * Revision 1.1.1.1 2003/05/09 14:41:03 haraldkipp
  103. * Initial using 3.2.1
  104. *
  105. * Revision 1.5 2003/05/06 18:38:33 harald
  106. * Cleanup
  107. *
  108. * Revision 1.4 2003/02/04 18:00:36 harald
  109. * Version 3 released
  110. *
  111. * Revision 1.3 2002/06/26 17:29:14 harald
  112. * First pre-release with 2.4 stack
  113. *
  114. */
  115. /* use native version on unix emulation */
  116. #if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__)
  117. #include <netdb_orig.h>
  118. /* assure _NETDB_H_ is set */
  119. #undef _NETDB_H_
  120. #define _NETDB_H_
  121. #else /* unix emulation */
  122. #define _NETDB_H_
  123. #include <sys/types.h>
  124. __BEGIN_DECLS
  125. /*
  126. * Error return codes.
  127. */
  128. #define NETDB_INTERNAL -1 /* see errno */
  129. #define NETDB_SUCCESS 0 /* no problem */
  130. #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
  131. #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
  132. #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  133. #define NO_DATA 4 /* Valid name, no data record of requested type */
  134. #define NO_ADDRESS NO_DATA /* no address, look for MX record */
  135. __END_DECLS
  136. #endif /* unix emulation */
  137. __BEGIN_DECLS
  138. extern void NutDnsConfig2(u_char * hostname, u_char * domain, u_long pdnsip, u_long sdnsip);
  139. extern void NutDnsConfig(CONST u_char *hostname, CONST u_char *domain, u_long dnsip);
  140. extern u_long NutDnsGetHostByName(CONST u_char *hostname);
  141. extern u_long NutDnsGetMxByDomain(CONST u_char * hostname);
  142. extern void NutGetDnsServers(u_long *pdnsip, u_long *sdnsip);
  143. __END_DECLS
  144. #endif