Update README and add contrib dir

This commit is contained in:
2025-12-01 15:56:02 +01:00
parent 1b80de2153
commit cd9ba93d58
150 changed files with 25563 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
#include "stream-identification-function.h"
#include "ns3/log.h"
#include "ns3/uinteger.h"
#include "ns3/random-variable-stream.h"
namespace ns3
{
NS_LOG_COMPONENT_DEFINE("StreamIdentificationFunction");
NS_OBJECT_ENSURE_REGISTERED(StreamIdentificationFunction);
TypeId
StreamIdentificationFunction::GetTypeId()
{
static TypeId tid =
TypeId("ns3::StreamIdentificationFunction")
.SetParent<Object>()
.SetGroupName("tsn")
.AddConstructor<StreamIdentificationFunction>()
.AddAttribute("MinLatencyOverhead",
"The minimum latency overhead cause by the identification function hardware implementation",
TimeValue(Seconds(0)),
MakeTimeAccessor(&StreamIdentificationFunction::m_minLatencyOverhead),
MakeTimeChecker())
.AddAttribute("MaxLatencyOverhead",
"The maximun latency overhead cause by the identification function hardware implementation",
TimeValue(Seconds(0)),
MakeTimeAccessor(&StreamIdentificationFunction::m_maxLatencyOverhead),
MakeTimeChecker());
return tid;
}
StreamIdentificationFunction::StreamIdentificationFunction()
{
NS_LOG_FUNCTION(this);
}
StreamIdentificationFunction::~StreamIdentificationFunction()
{
NS_LOG_FUNCTION(this);
}
bool
StreamIdentificationFunction::Match(Ptr<Packet> p)
{
NS_LOG_FUNCTION(this);
return false;
}
void
StreamIdentificationFunction::GetActiveUpdate(Ptr<Packet> p)
{
NS_LOG_FUNCTION(this);
}
Time
StreamIdentificationFunction::GetHardwareLatency()
{
NS_LOG_FUNCTION(this);
Ptr<UniformRandomVariable> randVar = CreateObject<UniformRandomVariable>();
return NanoSeconds(randVar->GetValue(m_minLatencyOverhead.GetNanoSeconds(), m_maxLatencyOverhead.GetNanoSeconds()));
}
}