39#ifndef IPV4_FRAG_SUPPORT
40 #define IPV4_FRAG_SUPPORT ENABLED
41#elif (IPV4_FRAG_SUPPORT != ENABLED && IPV4_FRAG_SUPPORT != DISABLED)
42 #error IPV4_FRAG_SUPPORT parameter is not valid
46#ifndef IPV4_OVERLAPPING_FRAG_SUPPORT
47 #define IPV4_OVERLAPPING_FRAG_SUPPORT ENABLED
48#elif (IPV4_OVERLAPPING_FRAG_SUPPORT != ENABLED && IPV4_OVERLAPPING_FRAG_SUPPORT != DISABLED)
49 #error IPV4_OVERLAPPING_FRAG_SUPPORT parameter is not valid
53#ifndef IPV4_FRAG_TICK_INTERVAL
54 #define IPV4_FRAG_TICK_INTERVAL 1000
55#elif (IPV4_FRAG_TICK_INTERVAL < 10)
56 #error IPV4_FRAG_TICK_INTERVAL parameter is not valid
61#ifndef IPV4_MAX_FRAG_DATAGRAMS
62 #define IPV4_MAX_FRAG_DATAGRAMS 4
63#elif (IPV4_MAX_FRAG_DATAGRAMS < 1)
64 #error IPV4_MAX_FRAG_DATAGRAMS parameter is not valid
68#ifndef IPV4_MAX_FRAG_DATAGRAM_SIZE
69 #define IPV4_MAX_FRAG_DATAGRAM_SIZE 8192
70#elif (IPV4_MAX_FRAG_DATAGRAM_SIZE < 576)
71 #error IPV4_MAX_FRAG_DATAGRAM_SIZE parameter is not valid
75#ifndef IPV4_FRAG_TIME_TO_LIVE
76 #define IPV4_FRAG_TIME_TO_LIVE 15000
77#elif (IPV4_FRAG_TIME_TO_LIVE < 1000)
78 #error IPV4_FRAG_TIME_TO_LIVE parameter is not valid
82#define IPV4_INFINITY 0xFFFF
91#if defined(__CWCC__) || defined(_WIN32)
109#if defined(__CWCC__) || defined(_WIN32)
121 uint_t maxChunkCount;
122 ChunkDesc chunk[N(IPV4_MAX_FRAG_DATAGRAM_SIZE) + 1];
144error_t ipv4FragmentDatagram(NetInterface *interface,
145 const Ipv4PseudoHeader *pseudoHeader, uint16_t
id,
const NetBuffer *payload,
146 size_t payloadOffset, NetTxAncillary *ancillary);
148void ipv4ReassembleDatagram(NetInterface *interface,
const Ipv4Header *packet,
149 size_t length, NetRxAncillary *ancillary);
151void ipv4FragTick(NetInterface *interface);
153Ipv4FragDesc *ipv4SearchFragQueue(NetInterface *interface,
154 const Ipv4Header *packet);
156void ipv4FlushFragQueue(NetInterface *interface);
158Ipv4HoleDesc *ipv4FindHole(
Ipv4FragDesc *frag, uint16_t offset);
error_t
Error codes.
Definition error.h:43
IPv4 (Internet Protocol Version 4)
typedef __packed_struct
Hole descriptor.
Definition ipv4_frag.h:101
uint32_t systime_t
System time.
Definition os_port_none.h:90
Structure describing a chunk of data.
Definition net_mem.h:77
Fragmented packet descriptor.
Definition ipv4_frag.h:131
systime_t timestamp
Time at which the first fragment was received.
Definition ipv4_frag.h:132
size_t headerLength
Length of the header.
Definition ipv4_frag.h:133
Ipv4ReassemblyBuffer buffer
Buffer containing the reassembled datagram.
Definition ipv4_frag.h:136
size_t dataLen
Length of the payload.
Definition ipv4_frag.h:134
uint16_t firstHole
Index of the first hole.
Definition ipv4_frag.h:135
Reassembly buffer.
Definition ipv4_frag.h:119
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89