예제 #1
0
void
PeerLinkFrameStart::Serialize (Buffer::Iterator start) const
{
  Buffer::Iterator i = start;
  NS_ASSERT (m_subtype < 3);
  i = m_protocol.Serialize (i);
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i.WriteHtolsbU16 (m_capability);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype)
    {
      i.WriteHtolsbU16 (m_aid);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i = m_rates.Serialize (i);
      i = m_rates.extended.Serialize (i);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype)
    {
      i = m_meshId.Serialize (i);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i = m_config.Serialize (i);
    }
  else
    {
      i.WriteHtolsbU16 (m_reasonCode);
    }
}
Buffer::Iterator
CapabilityInformation::Serialize (Buffer::Iterator start) const
{
  NS_LOG_FUNCTION (this << &start);
  start.WriteHtolsbU16 (m_capability);
  return start;
}