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 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
RodColeman 0:8f5825f330b0 3 * All rights reserved.
RodColeman 0:8f5825f330b0 4 *
RodColeman 0:8f5825f330b0 5 * Redistribution and use in source and binary forms, with or without modification,
RodColeman 0:8f5825f330b0 6 * are permitted provided that the following conditions are met:
RodColeman 0:8f5825f330b0 7 *
RodColeman 0:8f5825f330b0 8 * 1. Redistributions of source code must retain the above copyright notice,
RodColeman 0:8f5825f330b0 9 * this list of conditions and the following disclaimer.
RodColeman 0:8f5825f330b0 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
RodColeman 0:8f5825f330b0 11 * this list of conditions and the following disclaimer in the documentation
RodColeman 0:8f5825f330b0 12 * and/or other materials provided with the distribution.
RodColeman 0:8f5825f330b0 13 * 3. The name of the author may not be used to endorse or promote products
RodColeman 0:8f5825f330b0 14 * derived from this software without specific prior written permission.
RodColeman 0:8f5825f330b0 15 *
RodColeman 0:8f5825f330b0 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
RodColeman 0:8f5825f330b0 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
RodColeman 0:8f5825f330b0 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
RodColeman 0:8f5825f330b0 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
RodColeman 0:8f5825f330b0 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
RodColeman 0:8f5825f330b0 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
RodColeman 0:8f5825f330b0 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
RodColeman 0:8f5825f330b0 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
RodColeman 0:8f5825f330b0 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
RodColeman 0:8f5825f330b0 25 * OF SUCH DAMAGE.
RodColeman 0:8f5825f330b0 26 *
RodColeman 0:8f5825f330b0 27 * This file is part of the lwIP TCP/IP stack.
RodColeman 0:8f5825f330b0 28 *
RodColeman 0:8f5825f330b0 29 * Author: Adam Dunkels <adam@sics.se>
RodColeman 0:8f5825f330b0 30 *
RodColeman 0:8f5825f330b0 31 */
RodColeman 0:8f5825f330b0 32 #ifndef __LWIP_RAW_H__
RodColeman 0:8f5825f330b0 33 #define __LWIP_RAW_H__
RodColeman 0:8f5825f330b0 34
RodColeman 0:8f5825f330b0 35 #include "lwip/opt.h"
RodColeman 0:8f5825f330b0 36
RodColeman 0:8f5825f330b0 37 #if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
RodColeman 0:8f5825f330b0 38
RodColeman 0:8f5825f330b0 39 #include "lwip/pbuf.h"
RodColeman 0:8f5825f330b0 40 #include "lwip/def.h"
RodColeman 0:8f5825f330b0 41 #include "lwip/ip.h"
RodColeman 0:8f5825f330b0 42 #include "lwip/ip_addr.h"
RodColeman 0:8f5825f330b0 43
RodColeman 0:8f5825f330b0 44 #ifdef __cplusplus
RodColeman 0:8f5825f330b0 45 extern "C" {
RodColeman 0:8f5825f330b0 46 #endif
RodColeman 0:8f5825f330b0 47
RodColeman 0:8f5825f330b0 48 struct raw_pcb;
RodColeman 0:8f5825f330b0 49
RodColeman 0:8f5825f330b0 50 /** Function prototype for raw pcb receive callback functions.
RodColeman 0:8f5825f330b0 51 * @param arg user supplied argument (raw_pcb.recv_arg)
RodColeman 0:8f5825f330b0 52 * @param pcb the raw_pcb which received data
RodColeman 0:8f5825f330b0 53 * @param p the packet buffer that was received
RodColeman 0:8f5825f330b0 54 * @param addr the remote IP address from which the packet was received
RodColeman 0:8f5825f330b0 55 * @return 1 if the packet was 'eaten' (aka. deleted),
RodColeman 0:8f5825f330b0 56 * 0 if the packet lives on
RodColeman 0:8f5825f330b0 57 * If returning 1, the callback is responsible for freeing the pbuf
RodColeman 0:8f5825f330b0 58 * if it's not used any more.
RodColeman 0:8f5825f330b0 59 */
RodColeman 0:8f5825f330b0 60 typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p,
RodColeman 0:8f5825f330b0 61 ip_addr_t *addr);
RodColeman 0:8f5825f330b0 62
RodColeman 0:8f5825f330b0 63 struct raw_pcb {
RodColeman 0:8f5825f330b0 64 /* Common members of all PCB types */
RodColeman 0:8f5825f330b0 65 IP_PCB;
RodColeman 0:8f5825f330b0 66
RodColeman 0:8f5825f330b0 67 struct raw_pcb *next;
RodColeman 0:8f5825f330b0 68
RodColeman 0:8f5825f330b0 69 u8_t protocol;
RodColeman 0:8f5825f330b0 70
RodColeman 0:8f5825f330b0 71 /** receive callback function */
RodColeman 0:8f5825f330b0 72 raw_recv_fn recv;
RodColeman 0:8f5825f330b0 73 /* user-supplied argument for the recv callback */
RodColeman 0:8f5825f330b0 74 void *recv_arg;
RodColeman 0:8f5825f330b0 75 };
RodColeman 0:8f5825f330b0 76
RodColeman 0:8f5825f330b0 77 /* The following functions is the application layer interface to the
RodColeman 0:8f5825f330b0 78 RAW code. */
RodColeman 0:8f5825f330b0 79 struct raw_pcb * raw_new (u8_t proto);
RodColeman 0:8f5825f330b0 80 void raw_remove (struct raw_pcb *pcb);
RodColeman 0:8f5825f330b0 81 err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr);
RodColeman 0:8f5825f330b0 82 err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr);
RodColeman 0:8f5825f330b0 83
RodColeman 0:8f5825f330b0 84 void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg);
RodColeman 0:8f5825f330b0 85 err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr);
RodColeman 0:8f5825f330b0 86 err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
RodColeman 0:8f5825f330b0 87
RodColeman 0:8f5825f330b0 88 /* The following functions are the lower layer interface to RAW. */
RodColeman 0:8f5825f330b0 89 u8_t raw_input (struct pbuf *p, struct netif *inp);
RodColeman 0:8f5825f330b0 90 #define raw_init() /* Compatibility define, not init needed. */
RodColeman 0:8f5825f330b0 91
RodColeman 0:8f5825f330b0 92 #ifdef __cplusplus
RodColeman 0:8f5825f330b0 93 }
RodColeman 0:8f5825f330b0 94 #endif
RodColeman 0:8f5825f330b0 95
RodColeman 0:8f5825f330b0 96 #endif /* LWIP_RAW */
RodColeman 0:8f5825f330b0 97
RodColeman 0:8f5825f330b0 98 #endif /* __LWIP_RAW_H__ */