src/devices/point-to-point/point-to-point-net-device.h
changeset 1867 16deaedc0380
parent 1793 20bd909c62b5
parent 1866 e7dbcc4df546
child 1870 67b3d2dea3d5
equal deleted inserted replaced
1803:4078e5efdfc6 1867:16deaedc0380
   142    * arrived at the device.
   142    * arrived at the device.
   143    *
   143    *
   144    * @see PointToPointChannel
   144    * @see PointToPointChannel
   145    * @param p a reference to the received packet
   145    * @param p a reference to the received packet
   146    */
   146    */
   147   void Receive (Packet& p);
   147   void Receive (Ptr<Packet> p);
   148 
   148 
   149 private:
   149 private:
   150   /**
   150   /**
   151    * Create a Trace Resolver for events in the net device.
   151    * Create a Trace Resolver for events in the net device.
   152    *
   152    *
   191 private:
   191 private:
   192   /**
   192   /**
   193    * Adds the necessary headers and trailers to a packet of data in order to
   193    * Adds the necessary headers and trailers to a packet of data in order to
   194    * respect the protocol implemented by the agent.
   194    * respect the protocol implemented by the agent.
   195    */
   195    */
   196   void AddHeader(Packet& p, uint16_t protocolNumber);
   196   void AddHeader(Ptr<Packet> p, uint16_t protocolNumber);
   197   /**
   197   /**
   198    * Removes, from a packet of data, all headers and trailers that
   198    * Removes, from a packet of data, all headers and trailers that
   199    * relate to the protocol implemented by the agent
   199    * relate to the protocol implemented by the agent
   200    * \return Returns true if the packet should be forwarded up the
   200    * \return Returns true if the packet should be forwarded up the
   201    * protocol stack.
   201    * protocol stack.
   202    */
   202    */
   203   bool ProcessHeader(Packet& p, uint16_t& param);
   203   bool ProcessHeader(Ptr<Packet> p, uint16_t& param);
   204   /**
   204   /**
   205    * Send a Packet Down the Wire.
   205    * Send a Packet Down the Wire.
   206    *
   206    *
   207    * The SendTo method is defined as the standard way that the level three
   207    * The SendTo method is defined as the standard way that the level three
   208    * protocol uses to tell a NetDevice to send a packet.  SendTo is declared
   208    * protocol uses to tell a NetDevice to send a packet.  SendTo is declared
   212    * @param p a reference to the packet to send
   212    * @param p a reference to the packet to send
   213    * @param dest a reference to the Address of the destination device
   213    * @param dest a reference to the Address of the destination device
   214    * @param protocolNumber Protocol Number used to find protocol touse
   214    * @param protocolNumber Protocol Number used to find protocol touse
   215    * @returns true if success, false on failure
   215    * @returns true if success, false on failure
   216    */
   216    */
   217   virtual bool SendTo (const Packet& p, const Address& dest, 
   217   virtual bool SendTo (Ptr<Packet> p, const Address& dest, 
   218                        uint16_t protocolNumber);
   218                        uint16_t protocolNumber);
   219   /**
   219   /**
   220    * Start Sending a Packet Down the Wire.
   220    * Start Sending a Packet Down the Wire.
   221    *
   221    *
   222    * The TransmitStart method is the method that is used internally in the
   222    * The TransmitStart method is the method that is used internally in the
   229    * @see PointToPointChannel::TransmitStart ()
   229    * @see PointToPointChannel::TransmitStart ()
   230    * @see TransmitCompleteEvent ()
   230    * @see TransmitCompleteEvent ()
   231    * @param p a reference to the packet to send
   231    * @param p a reference to the packet to send
   232    * @returns true if success, false on failure
   232    * @returns true if success, false on failure
   233    */
   233    */
   234   bool TransmitStart (Packet &p);
   234   bool TransmitStart (Ptr<Packet> p);
   235   /**
   235   /**
   236    * Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
   236    * Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
   237    *
   237    *
   238    * The TransmitComplete method is used internally to finish the process
   238    * The TransmitComplete method is used internally to finish the process
   239    * of sending a packet out on the channel.
   239    * of sending a packet out on the channel.
   285    * fire.
   285    * fire.
   286    *
   286    *
   287    * @see class CallBackTraceSource
   287    * @see class CallBackTraceSource
   288    * @see class TraceResolver
   288    * @see class TraceResolver
   289    */
   289    */
   290   CallbackTraceSource<const Packet &> m_rxTrace;
   290   CallbackTraceSource<Ptr<const Packet> > m_rxTrace;
   291   /** 
   291   /** 
   292    * Default data rate.  Used for all newly created p2p net devices
   292    * Default data rate.  Used for all newly created p2p net devices
   293    */
   293    */
   294    static DataRateDefaultValue g_defaultRate;
   294    static DataRateDefaultValue g_defaultRate;
   295 
   295