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