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

Committer:
RodColeman
Date:
Thu Sep 08 10:41:36 2011 +0000
Revision:
0:8f5825f330b0
setDataLen hacked to 180bytes

Who changed what in which revision?

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