Brandon Fictorie / Mbed 2 deprecated BF_Websocket

Dependencies:   mbed

Committer:
bfictorie
Date:
Sun Mar 25 17:26:30 2012 +0000
Revision:
0:8cdad1c73e8e

        

Who changed what in which revision?

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