mbed Phone Platform

Dependencies:   ulaw mbed ConfigFile

Committer:
okini3939
Date:
Sun Dec 26 15:49:07 2010 +0000
Revision:
1:0f82c574096f

        

Who changed what in which revision?

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