Geiger counter http://geigermaps.jp/Create/Tutorials/mbed_geiger/ja

Dependencies:   mbed

Committer:
okini3939
Date:
Fri Apr 15 16:51:30 2011 +0000
Revision:
0:5b2e60110d9b

        

Who changed what in which revision?

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