Files
eden-sim/contrib/tsn/model/frer-sequence-encode-decode-function.h

57 lines
1.3 KiB
C++

#ifndef FRER_SEQUENCE_ENCODE_DECODE_FUNCTION_H
#define FRER_SEQUENCE_ENCODE_DECODE_FUNCTION_H
#include "ns3/object.h"
#include "ns3/packet.h"
#include "tsn-net-device.h"
namespace ns3
{
class TsnNetDevice;
class SequenceEncodeDecodeFunction : public Object
{
public:
/**
* \brief Get the TypeId
*
* \return The TypeId for this class
*/
static TypeId GetTypeId();
/**
* \brief Create a SequenceEncodeDecodeFunction
*/
SequenceEncodeDecodeFunction();
/**
* Destroy a SequenceEncodeDecodeFunction
*
* This is the destructor for the SequenceEncodeDecodeFunction.
*/
~SequenceEncodeDecodeFunction();
void SetStreamHandle(std::vector<uint32_t> seqEncStreamList);
void SetPort(Ptr<TsnNetDevice> seqEncPort);
bool IsApplicable(uint32_t streamHandle, Ptr<TsnNetDevice> port, bool direction);
void Encode(Ptr<Packet> p, uint16_t seqNumber);
uint16_t Decode(Ptr<Packet> p);
protected:
private:
std::vector<uint32_t> m_frerSeqEncStreamList;
Ptr<TsnNetDevice> m_frerSeqEncPort;
bool m_frerSeqEncDirection;
bool m_frerSeqEncActive;
uint8_t m_frerSeqEncEncapsType = 1; //RTAG encoding (802.1CB-2017 section 10.5.1.5)
};
}
#endif /* FRER_SEQUENCE_ENCODE_DECODE_FUNCTION_H */