UbixOS V2 2.0

ip6_frag.h
Go to the documentation of this file.
1
7 /*
8 * Copyright (c) 2010 Inico Technologies Ltd.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * 3. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31 * OF SUCH DAMAGE.
32 *
33 * This file is part of the lwIP TCP/IP stack.
34 *
35 * Author: Ivan Delamer <delamer@inicotech.com>
36 *
37 *
38 * Please coordinate changes and requests with Ivan Delamer
39 * <delamer@inicotech.com>
40 */
41 #ifndef LWIP_HDR_IP6_FRAG_H
42 #define LWIP_HDR_IP6_FRAG_H
43
44 #include "net/opt.h"
45 #include "net/pbuf.h"
46 #include "net/ip6_addr.h"
47 #include "net/ip6.h"
48 #include "net/netif.h"
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54
55 #if LWIP_IPV6 && LWIP_IPV6_REASS /* don't build if not configured for use in lwipopts.h */
56
60 #ifndef IPV6_FRAG_COPYHEADER
61 #define IPV6_FRAG_COPYHEADER 0
62 #endif
63
65 #define IP6_REASS_TMR_INTERVAL 1000
66
67 /* Copy the complete header of the first fragment to struct ip6_reassdata
68 or just point to its original location in the first pbuf? */
69 #if IPV6_FRAG_COPYHEADER
70 #define IPV6_FRAG_HDRPTR
71 #define IPV6_FRAG_HDRREF(hdr) (&(hdr))
72 #else /* IPV6_FRAG_COPYHEADER */
73 #define IPV6_FRAG_HDRPTR *
74 #define IPV6_FRAG_HDRREF(hdr) (hdr)
75 #endif /* IPV6_FRAG_COPYHEADER */
76
80 struct ip6_reassdata {
81 struct ip6_reassdata *next;
82 struct pbuf *p;
83 struct ip6_hdr IPV6_FRAG_HDRPTR iphdr;
84 u32_t identification;
85 u16_t datagram_len;
86 u8_t nexth;
87 u8_t timer;
88 };
89
90 #define ip6_reass_init() /* Compatibility define */
91 void ip6_reass_tmr(void);
92 struct pbuf *ip6_reass(struct pbuf *p);
93
94 #endif /* LWIP_IPV6 && LWIP_IPV6_REASS */
95
96 #if LWIP_IPV6 && LWIP_IPV6_FRAG /* don't build if not configured for use in lwipopts.h */
97
98 #ifndef LWIP_PBUF_CUSTOM_REF_DEFINED
99 #define LWIP_PBUF_CUSTOM_REF_DEFINED
100
103 struct pbuf_custom_ref {
105 struct pbuf_custom pc;
107 struct pbuf *original;
108 };
109 #endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */
110
111 err_t ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest);
112
113 #endif /* LWIP_IPV6 && LWIP_IPV6_FRAG */
114
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif /* LWIP_HDR_IP6_FRAG_H */
opt.h
pbuf.h
u16_t
uint16_t u16_t
Definition: arch.h:124
u32_t
uint32_t u32_t
Definition: arch.h:126
netif.h
u8_t
uint8_t u8_t
Definition: arch.h:122
netif
Definition: netif.h:233
err_t
s8_t err_t
Definition: err.h:57
ip6_addr.h
ip6_hdr
Definition: ip6.h:80
pbuf
Definition: pbuf.h:142
ip6.h