mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okini3939 0:10bcaa7c2253 1 /*
okini3939 0:10bcaa7c2253 2 * Redistribution and use in source and binary forms, with or without modification,
okini3939 0:10bcaa7c2253 3 * are permitted provided that the following conditions are met:
okini3939 0:10bcaa7c2253 4 *
okini3939 0:10bcaa7c2253 5 * 1. Redistributions of source code must retain the above copyright notice,
okini3939 0:10bcaa7c2253 6 * this list of conditions and the following disclaimer.
okini3939 0:10bcaa7c2253 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
okini3939 0:10bcaa7c2253 8 * this list of conditions and the following disclaimer in the documentation
okini3939 0:10bcaa7c2253 9 * and/or other materials provided with the distribution.
okini3939 0:10bcaa7c2253 10 * 3. The name of the author may not be used to endorse or promote products
okini3939 0:10bcaa7c2253 11 * derived from this software without specific prior written permission.
okini3939 0:10bcaa7c2253 12 *
okini3939 0:10bcaa7c2253 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
okini3939 0:10bcaa7c2253 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
okini3939 0:10bcaa7c2253 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
okini3939 0:10bcaa7c2253 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
okini3939 0:10bcaa7c2253 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
okini3939 0:10bcaa7c2253 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
okini3939 0:10bcaa7c2253 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
okini3939 0:10bcaa7c2253 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
okini3939 0:10bcaa7c2253 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
okini3939 0:10bcaa7c2253 22 * OF SUCH DAMAGE.
okini3939 0:10bcaa7c2253 23 *
okini3939 0:10bcaa7c2253 24 * This file is part of the lwIP TCP/IP stack.
okini3939 0:10bcaa7c2253 25 *
okini3939 0:10bcaa7c2253 26 * Author: Simon Goldschmidt
okini3939 0:10bcaa7c2253 27 *
okini3939 0:10bcaa7c2253 28 */
okini3939 0:10bcaa7c2253 29 #ifndef __LWIP_NETDB_H__
okini3939 0:10bcaa7c2253 30 #define __LWIP_NETDB_H__
okini3939 0:10bcaa7c2253 31
okini3939 0:10bcaa7c2253 32 #include "lwip/opt.h"
okini3939 0:10bcaa7c2253 33
okini3939 0:10bcaa7c2253 34 #if LWIP_DNS && LWIP_SOCKET
okini3939 0:10bcaa7c2253 35
okini3939 0:10bcaa7c2253 36 #include <stddef.h> /* for size_t */
okini3939 0:10bcaa7c2253 37
okini3939 0:10bcaa7c2253 38 #include "lwip/inet.h"
okini3939 0:10bcaa7c2253 39 #include "lwip/sockets.h"
okini3939 0:10bcaa7c2253 40
okini3939 0:10bcaa7c2253 41 /* some rarely used options */
okini3939 0:10bcaa7c2253 42 #ifndef LWIP_DNS_API_DECLARE_H_ERRNO
okini3939 0:10bcaa7c2253 43 #define LWIP_DNS_API_DECLARE_H_ERRNO 1
okini3939 0:10bcaa7c2253 44 #endif
okini3939 0:10bcaa7c2253 45
okini3939 0:10bcaa7c2253 46 #ifndef LWIP_DNS_API_DEFINE_ERRORS
okini3939 0:10bcaa7c2253 47 #define LWIP_DNS_API_DEFINE_ERRORS 1
okini3939 0:10bcaa7c2253 48 #endif
okini3939 0:10bcaa7c2253 49
okini3939 0:10bcaa7c2253 50 #ifndef LWIP_DNS_API_DECLARE_STRUCTS
okini3939 0:10bcaa7c2253 51 #define LWIP_DNS_API_DECLARE_STRUCTS 1
okini3939 0:10bcaa7c2253 52 #endif
okini3939 0:10bcaa7c2253 53
okini3939 0:10bcaa7c2253 54 #if LWIP_DNS_API_DEFINE_ERRORS
okini3939 0:10bcaa7c2253 55 /** Errors used by the DNS API functions, h_errno can be one of them */
okini3939 0:10bcaa7c2253 56 #define EAI_NONAME 200
okini3939 0:10bcaa7c2253 57 #define EAI_SERVICE 201
okini3939 0:10bcaa7c2253 58 #define EAI_FAIL 202
okini3939 0:10bcaa7c2253 59 #define EAI_MEMORY 203
okini3939 0:10bcaa7c2253 60
okini3939 0:10bcaa7c2253 61 #define HOST_NOT_FOUND 210
okini3939 0:10bcaa7c2253 62 #define NO_DATA 211
okini3939 0:10bcaa7c2253 63 #define NO_RECOVERY 212
okini3939 0:10bcaa7c2253 64 #define TRY_AGAIN 213
okini3939 0:10bcaa7c2253 65 #endif /* LWIP_DNS_API_DEFINE_ERRORS */
okini3939 0:10bcaa7c2253 66
okini3939 0:10bcaa7c2253 67 #if LWIP_DNS_API_DECLARE_STRUCTS
okini3939 0:10bcaa7c2253 68 struct hostent {
okini3939 0:10bcaa7c2253 69 char *h_name; /* Official name of the host. */
okini3939 0:10bcaa7c2253 70 char **h_aliases; /* A pointer to an array of pointers to alternative host names,
okini3939 0:10bcaa7c2253 71 terminated by a null pointer. */
okini3939 0:10bcaa7c2253 72 int h_addrtype; /* Address type. */
okini3939 0:10bcaa7c2253 73 int h_length; /* The length, in bytes, of the address. */
okini3939 0:10bcaa7c2253 74 char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
okini3939 0:10bcaa7c2253 75 network byte order) for the host, terminated by a null pointer. */
okini3939 0:10bcaa7c2253 76 #define h_addr h_addr_list[0] /* for backward compatibility */
okini3939 0:10bcaa7c2253 77 };
okini3939 0:10bcaa7c2253 78
okini3939 0:10bcaa7c2253 79 struct addrinfo {
okini3939 0:10bcaa7c2253 80 int ai_flags; /* Input flags. */
okini3939 0:10bcaa7c2253 81 int ai_family; /* Address family of socket. */
okini3939 0:10bcaa7c2253 82 int ai_socktype; /* Socket type. */
okini3939 0:10bcaa7c2253 83 int ai_protocol; /* Protocol of socket. */
okini3939 0:10bcaa7c2253 84 socklen_t ai_addrlen; /* Length of socket address. */
okini3939 0:10bcaa7c2253 85 struct sockaddr *ai_addr; /* Socket address of socket. */
okini3939 0:10bcaa7c2253 86 char *ai_canonname; /* Canonical name of service location. */
okini3939 0:10bcaa7c2253 87 struct addrinfo *ai_next; /* Pointer to next in list. */
okini3939 0:10bcaa7c2253 88 };
okini3939 0:10bcaa7c2253 89 #endif /* LWIP_DNS_API_DECLARE_STRUCTS */
okini3939 0:10bcaa7c2253 90
okini3939 0:10bcaa7c2253 91 #if LWIP_DNS_API_DECLARE_H_ERRNO
okini3939 0:10bcaa7c2253 92 /* application accessable error code set by the DNS API functions */
okini3939 0:10bcaa7c2253 93 extern int h_errno;
okini3939 0:10bcaa7c2253 94 #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/
okini3939 0:10bcaa7c2253 95
okini3939 0:10bcaa7c2253 96 struct hostent *lwip_gethostbyname(const char *name);
okini3939 0:10bcaa7c2253 97 int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
okini3939 0:10bcaa7c2253 98 size_t buflen, struct hostent **result, int *h_errnop);
okini3939 0:10bcaa7c2253 99 void lwip_freeaddrinfo(struct addrinfo *ai);
okini3939 0:10bcaa7c2253 100 int lwip_getaddrinfo(const char *nodename,
okini3939 0:10bcaa7c2253 101 const char *servname,
okini3939 0:10bcaa7c2253 102 const struct addrinfo *hints,
okini3939 0:10bcaa7c2253 103 struct addrinfo **res);
okini3939 0:10bcaa7c2253 104
okini3939 0:10bcaa7c2253 105 #if LWIP_COMPAT_SOCKETS
okini3939 0:10bcaa7c2253 106 #define gethostbyname(name) lwip_gethostbyname(name)
okini3939 0:10bcaa7c2253 107 #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
okini3939 0:10bcaa7c2253 108 lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
okini3939 0:10bcaa7c2253 109 #define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
okini3939 0:10bcaa7c2253 110 #define getaddrinfo(nodname, servname, hints, res) \
okini3939 0:10bcaa7c2253 111 lwip_getaddrinfo(nodname, servname, hints, res)
okini3939 0:10bcaa7c2253 112 #endif /* LWIP_COMPAT_SOCKETS */
okini3939 0:10bcaa7c2253 113
okini3939 0:10bcaa7c2253 114 #endif /* LWIP_DNS && LWIP_SOCKET */
okini3939 0:10bcaa7c2253 115
okini3939 0:10bcaa7c2253 116 #endif /* __LWIP_NETDB_H__ */