28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
#ifndef IPPACKETFRAGMENTATION_H
|
|
#define IPPACKETFRAGMENTATION_H
|
|
|
|
#include "IpPacketFragmentation_t.h"
|
|
#include "Ip6Packet_t.h"
|
|
#include "AbstractPacketHandler.h"
|
|
|
|
class IpPacketFragmentation : public AbstractPacketHandler
|
|
{
|
|
|
|
public:
|
|
|
|
IpPacketFragmentation(const size_t newMtu);
|
|
virtual ~IpPacketFragmentation();
|
|
|
|
virtual bool handle(IN const Tins::PDU & pdu, IN IPacketHandler * callBackHandler = nullptr) override;
|
|
private:
|
|
const size_t mtu;
|
|
uint32_t idCounter;
|
|
static const size_t fragmentionHeadersize;
|
|
static void addExtensionHeader(IN const uint8_t NextHeader, IN const uint8_t *startPtr, IN Tins::IPv6 & ipFragmentPdu, IN const size_t headersize);
|
|
bool createAndForwardFragmend(IN const Tins::PDU & pdu, IN const ByteVector::iterator & fragmentStart, IN const ByteVector::iterator & fragmentPosIt, IN FragmentionHeaderStruct * ptrFragmentionHeaderStruct, IN uint8_t * ptrStartFragmentionHeader, IN IPacketHandler * callBackHandler);
|
|
|
|
void initFragmentationHeader(FragmentionHeaderStruct* ptrFragmentionHeaderStruct);
|
|
};
|
|
|
|
#endif // IPPACKETFRAGMENTATION_H
|