src/node/arp-header.cc
changeset 286 57e6a2006962
parent 258 df3bca25ae37
child 463 c2082308e01a
equal deleted inserted replaced
285:56866666cc24 286:57e6a2006962
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18  *
    18  *
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    20  */
    20  */
    21 
    21 
    22 #include <cassert>
    22 #include "ns3/assert.h"
    23 #include "arp-header.h"
    23 #include "arp-header.h"
    24 #include "header-utils.h"
    24 #include "header-utils.h"
    25 
    25 
    26 namespace ns3 {
    26 namespace ns3 {
    27 
    27 
    94           << " source ipv4: " << m_ipv4Source
    94           << " source ipv4: " << m_ipv4Source
    95           << " dest ipv4: " << m_ipv4Dest;
    95           << " dest ipv4: " << m_ipv4Dest;
    96     } 
    96     } 
    97   else 
    97   else 
    98     {
    98     {
    99       assert (IsReply ());
    99       NS_ASSERT (IsReply ());
   100       os << " source mac: " << m_macSource
   100       os << " source mac: " << m_macSource
   101           << " source ipv4: " << m_ipv4Source
   101           << " source ipv4: " << m_ipv4Source
   102           << " dest mac: " << m_macDest
   102           << " dest mac: " << m_macDest
   103           << " dest ipv4: " <<m_ipv4Dest;
   103           << " dest ipv4: " <<m_ipv4Dest;
   104     }
   104     }
   112 
   112 
   113 void 
   113 void 
   114 ArpHeader::SerializeTo (Buffer::Iterator start) const
   114 ArpHeader::SerializeTo (Buffer::Iterator start) const
   115 {
   115 {
   116   Buffer::Iterator i = start;
   116   Buffer::Iterator i = start;
   117   assert (m_macSource.GetLength () == m_macDest.GetLength ());
   117   NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ());
   118 
   118 
   119   /* ethernet */
   119   /* ethernet */
   120   i.WriteHtonU16 (0x0001);
   120   i.WriteHtonU16 (0x0001);
   121   /* ipv4 */
   121   /* ipv4 */
   122   i.WriteHtonU16 (0x0800);
   122   i.WriteHtonU16 (0x0800);