Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
authorPavel Boyko <boyko@iitp.ru>
Thu, 30 Apr 2009 11:53:19 +0400
changeset 4993 464ce7d8a940
parent 4992 1de79102c3dd
child 4994 2c25f9c66604
Route requests queueing moved from base MeshL2RoutingProtocol to derived HwmpRoutingProtocol
src/devices/mesh/dot11s/hwmp-protocol.cc
src/devices/mesh/dot11s/hwmp-protocol.h
src/devices/mesh/mesh-l2-routing-protocol.h
--- a/src/devices/mesh/dot11s/hwmp-protocol.cc	Thu Apr 30 10:57:22 2009 +0400
+++ b/src/devices/mesh/dot11s/hwmp-protocol.cc	Thu Apr 30 11:53:19 2009 +0400
@@ -689,7 +689,7 @@
   return true;
 }
 
-MeshL2RoutingProtocol::QueuedPacket
+HwmpProtocol::QueuedPacket
 HwmpProtocol::DequeueFirstPacketByDst (Mac48Address dst)
 {
   QueuedPacket retval;
@@ -703,7 +703,8 @@
     }
   return retval;
 }
-MeshL2RoutingProtocol::QueuedPacket
+
+HwmpProtocol::QueuedPacket
 HwmpProtocol::DequeueFirstPacket ()
 {
   QueuedPacket retval;
@@ -715,6 +716,7 @@
   }
   return retval;
 }
+
 void
 HwmpProtocol::ReactivePathResolved (Mac48Address dst)
 {
--- a/src/devices/mesh/dot11s/hwmp-protocol.h	Thu Apr 30 10:57:22 2009 +0400
+++ b/src/devices/mesh/dot11s/hwmp-protocol.h	Thu Apr 30 11:53:19 2009 +0400
@@ -115,9 +115,21 @@
   bool DropDataFrame(uint32_t, Mac48Address);
   //\}
 private:
+  /// Packet waiting its routing information
+  struct QueuedPacket {
+    Ptr<Packet> pkt; ///< the packet
+    Mac48Address src; ///< src address
+    Mac48Address dst; ///< dst address
+    uint16_t protocol; ///< protocol number
+    uint32_t inInterface; ///< incoming device interface ID. (if packet has come from upper layers, this is Mesh point ID)
+    RouteReplyCallback reply; ///< how to reply
+    
+    QueuedPacket () : pkt(0), protocol(0), inInterface(0) {}
+  };
+  
   ///\name Methods related to Queue/Dequeue procedures
   //\{
-  bool QueuePacket (MeshL2RoutingProtocol::QueuedPacket packet);
+  bool QueuePacket (QueuedPacket packet);
   QueuedPacket  DequeueFirstPacketByDst (Mac48Address dst);
   QueuedPacket  DequeueFirstPacket ();
   void ReactivePathResolved (Mac48Address dst);
@@ -126,7 +138,6 @@
   
   ///\name Methods responsible for path discovery retry procedure:
   //\{
-  
   /** 
    * \brief checks when the last path discovery procedure was started for a given destination. 
    * 
--- a/src/devices/mesh/mesh-l2-routing-protocol.h	Thu Apr 30 10:57:22 2009 +0400
+++ b/src/devices/mesh/mesh-l2-routing-protocol.h	Thu Apr 30 11:53:19 2009 +0400
@@ -101,33 +101,6 @@
   /// Each mesh protocol must be installed on the mesh point to work.
   Ptr<MeshPointDevice> GetMeshPoint () const; 
 protected:
-  ///\name Route request queue API, supposed to be implemented in subclasses
-  //\{
-  /// Packet waiting its routing information, supposed to be used by all implementations to correctly implement timeouts.
-  struct QueuedPacket {
-    Ptr<Packet> pkt; ///< the packet
-    Mac48Address src; ///< src address
-    Mac48Address dst; ///< dst address
-    uint16_t protocol; ///< protocol number
-    uint32_t inInterface; ///< incoming device interface ID. (if packet has come from upper layers, this is Mesh point ID)
-    RouteReplyCallback reply; ///< how to reply
-    
-    QueuedPacket () : pkt(0), protocol(0), inInterface(0) {}
-  };
-  /**
-   * \brief Queue route request packet with 'Ethernet header'
-   * \return false if the queue is full.
-   */
-  virtual bool QueuePacket (QueuedPacket packet) = 0;
-  /**
-   * \brief Deque packet with 'Ethernet header'
-   * \param destination The destination address, which identifyes queue.
-   * \return Ptr<packet> (0 if queue is empty), src, dst, protocol ID, incoming port ID, and reply callback
-   */
-  virtual QueuedPacket DequeueFirstPacketByDst (Mac48Address destination) = 0;
-  virtual QueuedPacket DequeueFirstPacket () = 0;
-  //\}
-protected:
   /// Host mesh point
   Ptr<MeshPointDevice> m_mp;
 };