header flags fixed
authorBorovkova Elena <borovkovaes@iitp.ru>
Wed, 15 Jul 2009 15:41:42 +0400
changeset 5587 7441c907cdee
parent 5586 18b0f80bbab7
child 5589 47c14f3cdab6
header flags fixed
src/routing/aodv/aodv-packet.cc
src/routing/aodv/aodv-routing-protocol.cc
--- a/src/routing/aodv/aodv-packet.cc	Wed Jul 15 15:09:14 2009 +0400
+++ b/src/routing/aodv/aodv-packet.cc	Wed Jul 15 15:41:42 2009 +0400
@@ -233,42 +233,42 @@
 void 
 RreqHeader::SetGratiousRrep (bool f)
 {
-  if (f) rq_flags |= (1 << 2);
-  else   rq_flags &= ~(1 << 2);
+  if (f) rq_flags |= (1 << 5);
+  else   rq_flags &= ~(1 << 5);
 }
 
 bool 
 RreqHeader::GetGratiousRrep () const
 {
-  return (rq_flags & (1 << 2));
+  return (rq_flags & (1 << 5));
 }
 
 void 
 RreqHeader::SetDestinationOnly (bool f)
 {
+  if (f) rq_flags |= (1 << 4);
+  else   rq_flags &= ~(1 << 4);
+}
+
+bool 
+RreqHeader::GetDestinationOnly () const
+{
+  return (rq_flags & (1 << 4));
+}
+
+void 
+RreqHeader::SetUnknownSeqno (bool f)
+{
   if (f) rq_flags |= (1 << 3);
   else   rq_flags &= ~(1 << 3);
 }
 
 bool 
-RreqHeader::GetDestinationOnly () const
+RreqHeader::GetUnknownSeqno () const
 {
   return (rq_flags & (1 << 3));
 }
 
-void 
-RreqHeader::SetUnknownSeqno (bool f)
-{
-  if (f) rq_flags |= (1 << 4);
-  else   rq_flags &= ~(1 << 4);
-}
-
-bool 
-RreqHeader::GetUnknownSeqno () const
-{
-  return (rq_flags & (1 << 4));
-}
-
 bool
 RreqHeader::operator==(RreqHeader const & o) const
 {
@@ -394,14 +394,14 @@
 void
 RrepHeader::SetAckRequired (bool f)
 {
-  if (f) rp_flags |= (1 << 1);
-  else   rp_flags &= ~(1 << 1);
+  if (f) rp_flags |= (1 << 6);
+  else   rp_flags &= ~(1 << 6);
 }
 
 bool
 RrepHeader::GetAckRequired () const
 {
-  return (rp_flags & (1 << 1));
+  return (rp_flags & (1 << 6));
 }
 
 void
--- a/src/routing/aodv/aodv-routing-protocol.cc	Wed Jul 15 15:09:14 2009 +0400
+++ b/src/routing/aodv/aodv-routing-protocol.cc	Wed Jul 15 15:41:42 2009 +0400
@@ -330,6 +330,7 @@
       rreqHeader.SetOrigin (iface.GetLocal());
       InsertBroadcastId (iface.GetLocal(), bid);
       
+
       packet->AddHeader (rreqHeader);
       packet->AddHeader (tHeader);
       socket->Send (packet);
@@ -533,6 +534,7 @@
   rrepHeader.SetDst(rreqHeader.GetDst());
   rrepHeader.SetLifeTime(MY_ROUTE_TIMEOUT);
 
+
   Ptr<Packet> packet = Create<Packet> ();
   packet->AddHeader(rrepHeader);
   TypeHeader tHeader(AODVTYPE_RREP);