Some quick code to use UDP-only (no TCP) with mBed. Echos received packets and sends packets when a button is pressed
Core/lwIP/include/ipv4/lwip/ip_frag.h@0:a548a085de55, 2010-03-14 (annotated)
- Committer:
- pehrhovey
- Date:
- Sun Mar 14 00:54:12 2010 +0000
- Revision:
- 0:a548a085de55
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pehrhovey | 0:a548a085de55 | 1 | /* |
pehrhovey | 0:a548a085de55 | 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
pehrhovey | 0:a548a085de55 | 3 | * All rights reserved. |
pehrhovey | 0:a548a085de55 | 4 | * |
pehrhovey | 0:a548a085de55 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
pehrhovey | 0:a548a085de55 | 6 | * are permitted provided that the following conditions are met: |
pehrhovey | 0:a548a085de55 | 7 | * |
pehrhovey | 0:a548a085de55 | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
pehrhovey | 0:a548a085de55 | 9 | * this list of conditions and the following disclaimer. |
pehrhovey | 0:a548a085de55 | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
pehrhovey | 0:a548a085de55 | 11 | * this list of conditions and the following disclaimer in the documentation |
pehrhovey | 0:a548a085de55 | 12 | * and/or other materials provided with the distribution. |
pehrhovey | 0:a548a085de55 | 13 | * 3. The name of the author may not be used to endorse or promote products |
pehrhovey | 0:a548a085de55 | 14 | * derived from this software without specific prior written permission. |
pehrhovey | 0:a548a085de55 | 15 | * |
pehrhovey | 0:a548a085de55 | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
pehrhovey | 0:a548a085de55 | 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
pehrhovey | 0:a548a085de55 | 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
pehrhovey | 0:a548a085de55 | 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
pehrhovey | 0:a548a085de55 | 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
pehrhovey | 0:a548a085de55 | 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
pehrhovey | 0:a548a085de55 | 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
pehrhovey | 0:a548a085de55 | 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
pehrhovey | 0:a548a085de55 | 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
pehrhovey | 0:a548a085de55 | 25 | * OF SUCH DAMAGE. |
pehrhovey | 0:a548a085de55 | 26 | * |
pehrhovey | 0:a548a085de55 | 27 | * This file is part of the lwIP TCP/IP stack. |
pehrhovey | 0:a548a085de55 | 28 | * |
pehrhovey | 0:a548a085de55 | 29 | * Author: Jani Monoses <jani@iv.ro> |
pehrhovey | 0:a548a085de55 | 30 | * |
pehrhovey | 0:a548a085de55 | 31 | */ |
pehrhovey | 0:a548a085de55 | 32 | |
pehrhovey | 0:a548a085de55 | 33 | #ifndef __LWIP_IP_FRAG_H__ |
pehrhovey | 0:a548a085de55 | 34 | #define __LWIP_IP_FRAG_H__ |
pehrhovey | 0:a548a085de55 | 35 | |
pehrhovey | 0:a548a085de55 | 36 | #include "lwip/opt.h" |
pehrhovey | 0:a548a085de55 | 37 | #include "lwip/err.h" |
pehrhovey | 0:a548a085de55 | 38 | #include "lwip/pbuf.h" |
pehrhovey | 0:a548a085de55 | 39 | #include "lwip/netif.h" |
pehrhovey | 0:a548a085de55 | 40 | #include "lwip/ip_addr.h" |
pehrhovey | 0:a548a085de55 | 41 | #include "lwip/ip.h" |
pehrhovey | 0:a548a085de55 | 42 | |
pehrhovey | 0:a548a085de55 | 43 | #ifdef __cplusplus |
pehrhovey | 0:a548a085de55 | 44 | extern "C" { |
pehrhovey | 0:a548a085de55 | 45 | #endif |
pehrhovey | 0:a548a085de55 | 46 | |
pehrhovey | 0:a548a085de55 | 47 | #if IP_REASSEMBLY |
pehrhovey | 0:a548a085de55 | 48 | /* The IP reassembly timer interval in milliseconds. */ |
pehrhovey | 0:a548a085de55 | 49 | #define IP_TMR_INTERVAL 1000 |
pehrhovey | 0:a548a085de55 | 50 | |
pehrhovey | 0:a548a085de55 | 51 | /* IP reassembly helper struct. |
pehrhovey | 0:a548a085de55 | 52 | * This is exported because memp needs to know the size. |
pehrhovey | 0:a548a085de55 | 53 | */ |
pehrhovey | 0:a548a085de55 | 54 | struct ip_reassdata { |
pehrhovey | 0:a548a085de55 | 55 | struct ip_reassdata *next; |
pehrhovey | 0:a548a085de55 | 56 | struct pbuf *p; |
pehrhovey | 0:a548a085de55 | 57 | struct ip_hdr iphdr; |
pehrhovey | 0:a548a085de55 | 58 | u16_t datagram_len; |
pehrhovey | 0:a548a085de55 | 59 | u8_t flags; |
pehrhovey | 0:a548a085de55 | 60 | u8_t timer; |
pehrhovey | 0:a548a085de55 | 61 | }; |
pehrhovey | 0:a548a085de55 | 62 | |
pehrhovey | 0:a548a085de55 | 63 | void ip_reass_init(void); |
pehrhovey | 0:a548a085de55 | 64 | void ip_reass_tmr(void); |
pehrhovey | 0:a548a085de55 | 65 | struct pbuf * ip_reass(struct pbuf *p); |
pehrhovey | 0:a548a085de55 | 66 | #endif /* IP_REASSEMBLY */ |
pehrhovey | 0:a548a085de55 | 67 | |
pehrhovey | 0:a548a085de55 | 68 | #if IP_FRAG |
pehrhovey | 0:a548a085de55 | 69 | err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); |
pehrhovey | 0:a548a085de55 | 70 | #endif /* IP_FRAG */ |
pehrhovey | 0:a548a085de55 | 71 | |
pehrhovey | 0:a548a085de55 | 72 | #ifdef __cplusplus |
pehrhovey | 0:a548a085de55 | 73 | } |
pehrhovey | 0:a548a085de55 | 74 | #endif |
pehrhovey | 0:a548a085de55 | 75 | |
pehrhovey | 0:a548a085de55 | 76 | #endif /* __LWIP_IP_FRAG_H__ */ |