mbed Phone Platform

Dependencies:   ulaw mbed ConfigFile

Committer:
okini3939
Date:
Sun Dec 26 15:49:07 2010 +0000
Revision:
1:0f82c574096f

        

Who changed what in which revision?

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