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