25 #include "ns3/packet.h"
27 #include "ns3/lte-rlc-am-header.h"
44 uint32_t psize = pkt->
GetSize ();
45 uint8_t buffer[psize];
46 std::ostringstream oss (std::ostringstream::out);
48 for (uint32_t i = 0; i < psize; i++)
50 oss << std::setfill (
'0') << std::setw (2) << std::hex << (uint32_t) buffer[i];
58 uint32_t psize = pkt->
GetSize ();
59 uint8_t buffer[psize];
60 std::ostringstream oss (std::ostringstream::out);
62 for (uint32_t i = 0; i < psize; i++)
64 oss << (std::bitset<8> (buffer[i]));
66 return std::string (oss.str () +
"\n");
72 NS_LOG_DEBUG (
"---- SERIALIZED PACKET CONTENTS (HEX): -------");
80 NS_LOG_DEBUG (
"--------- " << s.data () <<
" INFO: -------");
81 std::ostringstream oss (std::ostringstream::out);
92 std::list<SequenceNumber10> nackSnList,
96 virtual void DoRun (
void);
106 std::list<SequenceNumber10> nackSnList ,
110 m_nackSnList (nackSnList),
126 for (std::list<SequenceNumber10>::iterator it =
m_nackSnList.begin ();
130 h.PushNack (it->GetValue ());
143 for (std::list<SequenceNumber10>::iterator it =
m_nackSnList.begin ();
169 std::list<SequenceNumber10> nackSnList;
170 std::string hex (
"0020");
176 std::list<SequenceNumber10> nackSnList;
177 std::string hex (
"0da4");
183 std::list<SequenceNumber10> nackSnList;
185 std::string hex (
"000bb480");
192 std::list<SequenceNumber10> nackSnList;
195 std::string hex (
"000bfed790");
202 std::list<SequenceNumber10> nackSnList;
206 std::string hex (
"000bfed795d980");
213 std::list<SequenceNumber10> nackSnList;
218 std::string hex (
"000bfed795d9cad8");
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static void LogPacketContents(Ptr< Packet > pkt)
static void LogPacketInfo(T source, std::string s)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
static std::string sprintPacketContentsHex(Ptr< Packet > pkt)
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
RlcAmStatusPduTestCase(SequenceNumber10 ackSn, std::list< SequenceNumber10 > nackSnList, std::string hex)
ns3::LteRlcHeaderTestSuite staticLteRlcHeaderTestSuiteInstance
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
static std::string sprintPacketContentsBin(Ptr< Packet > pkt)
std::list< SequenceNumber10 > m_nackSnList
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
void AddHeader(const Header &header)
Add header to this packet.