src/node/node.h
changeset 1341 f685d4bf320f
parent 1333 c0d66de933e9
child 1364 7866d4dd9e64
equal deleted inserted replaced
1340:a8d774560c2b 1341:f685d4bf320f
    83   Node(uint32_t systemId);
    83   Node(uint32_t systemId);
    84 
    84 
    85   virtual ~Node();
    85   virtual ~Node();
    86 
    86 
    87   /**
    87   /**
    88    * \returns a newly-created TraceResolver. The caller takes
       
    89    *          ownership of the returned pointer.
       
    90    *
       
    91    * Request the Node to create a trace resolver. This method
       
    92    * could be used directly by a user who needs access to very low-level
       
    93    * trace configuration.
       
    94    */
       
    95   Ptr<TraceResolver> CreateTraceResolver (void);
       
    96 
       
    97   /**
       
    98    * \returns the unique id of this node.
    88    * \returns the unique id of this node.
    99    * 
    89    * 
   100    * This unique id happens to be also the index of the Node into
    90    * This unique id happens to be also the index of the Node into
   101    * the NodeList. 
    91    * the NodeList. 
   102    */
    92    */
   180    * be invoked anymore.
   170    * be invoked anymore.
   181    */
   171    */
   182   void UnregisterProtocolHandler (ProtocolHandler handler);
   172   void UnregisterProtocolHandler (ProtocolHandler handler);
   183 
   173 
   184 protected:
   174 protected:
       
   175   virtual Ptr<TraceResolver> GetTraceResolver (void);
   185   /**
   176   /**
   186    * The dispose method. Subclasses must override this method
   177    * The dispose method. Subclasses must override this method
   187    * and must chain up to it by calling Node::DoDispose at the
   178    * and must chain up to it by calling Node::DoDispose at the
   188    * end of their own DoDispose method.
   179    * end of their own DoDispose method.
   189    */
   180    */
   190   virtual void DoDispose (void);
   181   virtual void DoDispose (void);
   191   /**
       
   192    * \param resolver the resolver to store trace sources in.
       
   193    *
       
   194    * If a subclass wants to add new traces to a Node, it needs
       
   195    * to override this method and record the new trace sources
       
   196    * in the input resolver. Subclasses also _must_ chain up to
       
   197    * their parent's DoFillTraceResolver method prior
       
   198    * to recording they own trace sources.
       
   199    */
       
   200   virtual void DoFillTraceResolver (CompositeTraceResolver &resolver);
       
   201 private:
   182 private:
       
   183 
   202   /**
   184   /**
   203    * \param device the device added to this Node.
   185    * \param device the device added to this Node.
   204    *
   186    *
   205    * This method is invoked whenever a user calls Node::AddDevice.
   187    * This method is invoked whenever a user calls Node::AddDevice.
   206    * Subclasses are expected to call NetDevice::SetReceiveCallback
   188    * Subclasses are expected to call NetDevice::SetReceiveCallback
   210   virtual void NotifyDeviceAdded (Ptr<NetDevice> device);
   192   virtual void NotifyDeviceAdded (Ptr<NetDevice> device);
   211 
   193 
   212   bool ReceiveFromDevice (Ptr<NetDevice> device, const Packet &packet, 
   194   bool ReceiveFromDevice (Ptr<NetDevice> device, const Packet &packet, 
   213                           uint16_t protocol, const Address &from);
   195                           uint16_t protocol, const Address &from);
   214   void Construct (void);
   196   void Construct (void);
   215   Ptr<TraceResolver> CreateDevicesTraceResolver (void);
       
   216 
   197 
   217   struct ProtocolHandlerEntry {
   198   struct ProtocolHandlerEntry {
   218     ProtocolHandler handler;
   199     ProtocolHandler handler;
   219     uint16_t protocol;
   200     uint16_t protocol;
   220     Ptr<NetDevice> device;
   201     Ptr<NetDevice> device;