コード例 #1
0
ファイル: qodPacket.cpp プロジェクト: daemonSlayer/qosManet
        uint32_t
        RrepHeader::Deserialize (Buffer::Iterator start)
        {
            Buffer::Iterator i = start;

            m_flags = i.ReadU8 ();
            m_prefixSize = i.ReadU8 ();
            m_hopCount = i.ReadU8 ();
            ReadFrom (i, m_dst);
            m_dstSeqNo = i.ReadNtohU32 ();
            ReadFrom (i, m_origin);
            m_lifeTime = i.ReadNtohU32 ();

            uint32_t dist = i.GetDistanceFrom (start);
            NS_ASSERT (dist == GetSerializedSize ());
            return dist;
        }
コード例 #2
0
ファイル: qodPacket.cpp プロジェクト: daemonSlayer/qosManet
        uint32_t
        RerrHeader::Deserialize (Buffer::Iterator start )
        {
            Buffer::Iterator i = start;
            m_flag = i.ReadU8 ();
            m_reserved = i.ReadU8 ();
            uint8_t dest = i.ReadU8 ();
            m_unreachableDstSeqNo.clear ();
            Ipv4Address address;
            uint32_t seqNo;
            for (uint8_t k = 0; k < dest; ++k)
            {
                ReadFrom (i, address);
                seqNo = i.ReadNtohU32 ();
                m_unreachableDstSeqNo.insert (std::make_pair (address, seqNo));
            }

            uint32_t dist = i.GetDistanceFrom (start);
            NS_ASSERT (dist == GetSerializedSize ());
            return dist;
        }