Netservices modded to read fragmented HTTP respsonse/payload from special purpose server - 180 bytes only

Committer:
RodColeman
Date:
Thu Sep 08 10:48:09 2011 +0000
Revision:
0:850eacf3e945
revised fixed length to 178 bytes

Who changed what in which revision?

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