本文整理汇总了C++中Packet::AddRLCHeader方法的典型用法代码示例。如果您正苦于以下问题:C++ Packet::AddRLCHeader方法的具体用法?C++ Packet::AddRLCHeader怎么用?C++ Packet::AddRLCHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet::AddRLCHeader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Packet
Packet*
Packet::Copy (void)
{
Packet *p = new Packet ();
p->m_id = m_id;
p->m_timeStamp = m_timeStamp;
if (m_UDPHeader != NULL)
{
UDPHeader *udp = new UDPHeader (GetSourcePort(), GetDestinationPort());
p->AddUDPHeader(udp);
}
if (m_IPHeader != NULL)
{
IPHeader *ip = new IPHeader (GetSourceID(), GetDestinationID());
p->AddIPHeader(ip);
}
if (m_PDCPHeader != NULL)
{
PDCPHeader *pdcp = new PDCPHeader ();
p->AddPDCPHeader (pdcp);
}
if (m_RLCHeader != NULL)
{
RLCHeader *rlc = new RLCHeader ();
if (GetRLCHeader ()->IsAFragment ())
rlc->SetAFragment (true);
if (!GetRLCHeader ()->IsTheLatestFragment ())
rlc->SetTheLatestFragment (false);
rlc->SetFragmentNumber (GetRLCHeader ()->GetFragmentNumber());
rlc->SetRlcEntityIndex (GetRLCHeader ()->GetRlcEntityIndex ());
rlc->SetRlcPduSequenceNumber (GetRLCHeader ()->GetRlcPduSequenceNumber());
rlc->SetStartByte (GetRLCHeader ()->GetStartByte ());
rlc->SetEndByte (GetRLCHeader ()->GetEndByte ());
p->AddRLCHeader (rlc);
}
if (m_MACHeader != NULL)
{
MACHeader *mac = new MACHeader (GetSourceMAC (), GetDestinationMAC ());
p->AddMACHeader(mac);
}
if (m_tags != NULL)
{
PacketTAGs *tags = new PacketTAGs ();
tags->SetApplicationType(GetPacketTags()->GetApplicationType());
tags->SetFrameNumber (GetPacketTags ()->GetFrameNuber ());
tags->SetStartByte (GetPacketTags ()->GetStartByte ());
tags->SetEndByte (GetPacketTags ()->GetEndByte ());
tags->SetApplicationSize (GetPacketTags ()->GetApplicationSize ());
p->SetPacketTags(tags);
}
p->m_size = m_size;
return p;
}
示例2: Packet
Packet*
RadioBearer::CreatePacket (int bytes)
{
Packet *p = new Packet ();
p->SetID(Simulator::Init()->GetUID ());
p->SetTimeStamp(Simulator::Init()->Now ());
UDPHeader *udp = new UDPHeader (GetClassifierParameters ()->GetSourcePort(),
GetClassifierParameters ()->GetDestinationPort ());
p->AddUDPHeader(udp);
IPHeader *ip = new IPHeader (GetClassifierParameters ()->GetSourceID (),
GetClassifierParameters ()->GetDestinationID());
p->AddIPHeader(ip);
PDCPHeader *pdcp = new PDCPHeader ();
p->AddPDCPHeader (pdcp);
RLCHeader *rlc = new RLCHeader ();
p->AddRLCHeader(rlc);
PacketTAGs *tags = new PacketTAGs ();
tags->SetApplicationType(PacketTAGs::APPLICATION_TYPE_INFINITE_BUFFER);
p->SetPacketTags(tags);
if (_APP_TRACING_)
{
/*
* Trace format:
*
* TX APPLICATION_TYPE BEARER_ID SIZE SRC_ID DST_ID TIME
*/
UserEquipment* ue = (UserEquipment*) GetApplication ()->GetDestination ();
std::cout << "TX";
switch (p->GetPacketTags ()->GetApplicationType ())
{
case Application::APPLICATION_TYPE_VOIP:
{
std::cout << " VOIP";
break;
}
case Application::APPLICATION_TYPE_TRACE_BASED:
{
std::cout << " VIDEO";
break;
}
case Application::APPLICATION_TYPE_CBR:
{
std::cout << " CBR";
break;
}
case Application::APPLICATION_TYPE_INFINITE_BUFFER:
{
std::cout << " INF_BUF";
break;
}
default:
{
std::cout << " UNDEFINED";
break;
}
}
if (bytes > 1490) bytes = 1490;
else bytes = bytes - 13;
std::cout << " ID " << p->GetID ()
<< " B " << GetRlcEntity ()->GetRlcEntityIndex ()
<< " SIZE " << bytes
<< " SRC " << GetSource ()->GetIDNetworkNode ()
<< " DST " << GetDestination ()->GetIDNetworkNode ()
<< " T " << Simulator::Init()->Now()
<< " " << ue->IsIndoor () << std::endl;
}
return p;
}