src/dsr/model/dsr-option-header.cc
changeset 8752 2da1fab73114
parent 8751 efad81f3cb47
child 8756 9a34e618f40b
--- a/src/dsr/model/dsr-option-header.cc	Fri Jan 27 15:15:48 2012 -0800
+++ b/src/dsr/model/dsr-option-header.cc	Sun May 06 20:52:24 2012 -0700
@@ -38,7 +38,6 @@
 #include "ns3/packet.h"
 #include "ns3/enum.h"
 
-
 namespace ns3 {
 namespace dsr {
 NS_LOG_COMPONENT_DEFINE ("DsrOptionHeader");
@@ -681,7 +680,7 @@
     m_errorLength (4)
 {
   SetType (3);
-  SetLength (14);
+  SetLength (18);
 }
 
 DsrOptionRerrHeader::~DsrOptionRerrHeader ()
@@ -738,7 +737,7 @@
 
 uint32_t DsrOptionRerrHeader::GetSerializedSize () const
 {
-  return 16;
+  return 20;
 }
 
 void DsrOptionRerrHeader::Serialize (Buffer::Iterator start) const
@@ -799,10 +798,10 @@
 
 DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader ()
   :    m_reserved (0),
-    m_salvage (0)
+       m_salvage (0)
 {
   SetType (3);
-  SetLength (14);
+  SetLength (18);
   SetErrorType (1);
 }
 
@@ -850,6 +849,16 @@
   return m_unreachNode;
 }
 
+void DsrOptionRerrUnreachHeader::SetOriginalDst (Ipv4Address originalDst)
+{
+  m_originalDst = originalDst;
+}
+
+Ipv4Address DsrOptionRerrUnreachHeader::GetOriginalDst () const
+{
+  return m_originalDst;
+}
+
 void DsrOptionRerrUnreachHeader::Print (std::ostream &os) const
 {
   os << "( type = " << (uint32_t)GetType () << " length = " << (uint32_t)GetLength ()
@@ -860,7 +869,7 @@
 
 uint32_t DsrOptionRerrUnreachHeader::GetSerializedSize () const
 {
-  return 16;
+  return 20;
 }
 
 void DsrOptionRerrUnreachHeader::Serialize (Buffer::Iterator start) const
@@ -874,7 +883,7 @@
   WriteTo (i, m_errorSrcAddress);
   WriteTo (i, m_errorDstAddress);
   WriteTo (i, m_unreachNode);
-
+  WriteTo (i, m_originalDst);
 }
 
 uint32_t DsrOptionRerrUnreachHeader::Deserialize (Buffer::Iterator start)
@@ -888,6 +897,7 @@
   ReadFrom (i, m_errorSrcAddress);
   ReadFrom (i, m_errorDstAddress);
   ReadFrom (i, m_unreachNode);
+  ReadFrom (i, m_originalDst);
 
   return GetSerializedSize ();
 }