sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
ip6_frag.h
Go to the documentation of this file.
1
7
8
/*
9
* Copyright (c) 2010 Inico Technologies Ltd.
10
* All rights reserved.
11
*
12
* Redistribution and use in source and binary forms, with or without modification,
13
* are permitted provided that the following conditions are met:
14
*
15
* 1. Redistributions of source code must retain the above copyright notice,
16
* this list of conditions and the following disclaimer.
17
* 2. Redistributions in binary form must reproduce the above copyright notice,
18
* this list of conditions and the following disclaimer in the documentation
19
* and/or other materials provided with the distribution.
20
* 3. The name of the author may not be used to endorse or promote products
21
* derived from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
24
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
26
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
32
* OF SUCH DAMAGE.
33
*
34
* This file is part of the lwIP TCP/IP stack.
35
*
36
* Author: Ivan Delamer <delamer@inicotech.com>
37
*
38
*
39
* Please coordinate changes and requests with Ivan Delamer
40
* <delamer@inicotech.com>
41
*/
42
#ifndef LWIP_HDR_IP6_FRAG_H
43
#define LWIP_HDR_IP6_FRAG_H
44
45
#include "
lwip/opt.h
"
46
#include "
lwip/pbuf.h
"
47
#include "
lwip/ip6_addr.h
"
48
#include "
lwip/ip6.h
"
49
#include "
lwip/netif.h
"
50
51
#ifdef __cplusplus
52
extern
"C"
{
53
#endif
54
55
56
#if LWIP_IPV6 && LWIP_IPV6_REASS
/* don't build if not configured for use in lwipopts.h */
57
59
#define IP6_REASS_TMR_INTERVAL 1000
60
71
#ifndef IPV6_FRAG_COPYHEADER
72
#define IPV6_FRAG_COPYHEADER 0
73
#endif
74
75
/* With IPV6_FRAG_COPYHEADER==1, a helper structure may (or, depending on the
76
* presence of extensions, may not) overwrite part of the IP header. Therefore,
77
* we copy the fields that we need from the IP header for as long as the helper
78
* structure may still be in place. This is easier than temporarily restoring
79
* those fields in the IP header each time we need to perform checks on them. */
80
#if IPV6_FRAG_COPYHEADER
81
#define IPV6_FRAG_SRC(ipr) ((ipr)->src)
82
#define IPV6_FRAG_DEST(ipr) ((ipr)->dest)
83
#else
/* IPV6_FRAG_COPYHEADER */
84
#define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
85
#define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
86
#endif
/* IPV6_FRAG_COPYHEADER */
87
91
struct
ip6_reassdata {
92
struct
ip6_reassdata *next;
93
struct
pbuf *p;
94
struct
ip6_hdr *iphdr;
/* pointer to the first (original) IPv6 header */
95
#if IPV6_FRAG_COPYHEADER
96
ip6_addr_p_t src;
/* copy of the source address in the IP header */
97
ip6_addr_p_t dest;
/* copy of the destination address in the IP header */
98
/* This buffer (for the part of the original header that we overwrite) will
99
* be slightly oversized, but we cannot compute the exact size from here. */
100
u8_t orig_hdr[
sizeof
(
struct
ip6_frag_hdr) + sizeof(void*)];
101
#else
/* IPV6_FRAG_COPYHEADER */
102
/* In this case we still need the buffer, for sending ICMPv6 replies. */
103
u8_t orig_hdr[
sizeof
(
struct
ip6_frag_hdr)];
104
#endif
/* IPV6_FRAG_COPYHEADER */
105
u32_t identification;
106
u16_t datagram_len;
107
u8_t nexth;
108
u8_t timer;
109
#if LWIP_IPV6_SCOPES
110
u8_t src_zone;
/* zone of original packet's source address */
111
u8_t dest_zone;
/* zone of original packet's destination address */
112
#endif
/* LWIP_IPV6_SCOPES */
113
};
114
115
#define ip6_reass_init()
/* Compatibility define */
116
void
ip6_reass_tmr(
void
);
117
struct
pbuf
*ip6_reass(
struct
pbuf
*p);
118
119
#endif
/* LWIP_IPV6 && LWIP_IPV6_REASS */
120
121
#if LWIP_IPV6 && LWIP_IPV6_FRAG
/* don't build if not configured for use in lwipopts.h */
122
123
#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED
124
#define LWIP_PBUF_CUSTOM_REF_DEFINED
128
struct
pbuf_custom_ref {
130
struct
pbuf_custom pc;
132
struct
pbuf *original;
133
};
134
#endif
/* LWIP_PBUF_CUSTOM_REF_DEFINED */
135
136
err_t ip6_frag(
struct
pbuf
*p,
struct
netif
*
netif
,
const
ip6_addr_t
*dest);
137
138
#endif
/* LWIP_IPV6 && LWIP_IPV6_FRAG */
139
140
141
#ifdef __cplusplus
142
}
143
#endif
144
145
#endif
/* LWIP_HDR_IP6_FRAG_H */
ip6_addr_t
struct ip6_addr ip6_addr_t
Definition
tcpip.h:434
ip6.h
ip6_addr.h
netif.h
opt.h
pbuf.h
netif
Definition
tcpip.h:1271
pbuf
Definition
tcpip.h:234
core
ps2ip
include
lwip_include
lwip
ip6_frag.h
Generated by
1.18.0