Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Committer:
dcoban
Date:
Tue Apr 03 18:43:13 2012 +0000
Revision:
0:1a61c61d0845

        

Who changed what in which revision?

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