Trial code integration web page update with analogue data and ntp support

Dependencies:   NTPClient_NetServices mbed

Committer:
pmr1
Date:
Fri Aug 06 17:57:45 2010 +0000
Revision:
0:8cc2035bebfc

        

Who changed what in which revision?

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