HTTPClient using static IP

Dependencies:   mbed

Committer:
mr_q
Date:
Mon May 30 11:53:37 2011 +0000
Revision:
0:d8f2f7d5f31b
v0.01 Draft

Who changed what in which revision?

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