src/devices/point-to-point/point-to-point-net-device.h
changeset 1870 67b3d2dea3d5
parent 1820 736919bd4874
parent 1867 16deaedc0380
child 2470 254581fb9e9c
equal deleted inserted replaced
1863:50fa1ca3b26c 1870:67b3d2dea3d5
   164    * arrived at the device.
   164    * arrived at the device.
   165    *
   165    *
   166    * @see PointToPointChannel
   166    * @see PointToPointChannel
   167    * @param p a reference to the received packet
   167    * @param p a reference to the received packet
   168    */
   168    */
   169   void Receive (Packet& p);
   169   void Receive (Ptr<Packet> p);
   170 
   170 
   171 private:
   171 private:
   172   /**
   172   /**
   173    * Create a Trace Resolver for events in the net device.
   173    * Create a Trace Resolver for events in the net device.
   174    *
   174    *
   213 private:
   213 private:
   214   /**
   214   /**
   215    * Adds the necessary headers and trailers to a packet of data in order to
   215    * Adds the necessary headers and trailers to a packet of data in order to
   216    * respect the protocol implemented by the agent.
   216    * respect the protocol implemented by the agent.
   217    */
   217    */
   218   void AddHeader(Packet& p, uint16_t protocolNumber);
   218   void AddHeader(Ptr<Packet> p, uint16_t protocolNumber);
   219   /**
   219   /**
   220    * Removes, from a packet of data, all headers and trailers that
   220    * Removes, from a packet of data, all headers and trailers that
   221    * relate to the protocol implemented by the agent
   221    * relate to the protocol implemented by the agent
   222    * \return Returns true if the packet should be forwarded up the
   222    * \return Returns true if the packet should be forwarded up the
   223    * protocol stack.
   223    * protocol stack.
   224    */
   224    */
   225   bool ProcessHeader(Packet& p, uint16_t& param);
   225   bool ProcessHeader(Ptr<Packet> p, uint16_t& param);
   226   /**
   226   /**
   227    * Send a Packet Down the Wire.
   227    * Send a Packet Down the Wire.
   228    *
   228    *
   229    * The SendTo method is defined as the standard way that the level three
   229    * The SendTo method is defined as the standard way that the level three
   230    * protocol uses to tell a NetDevice to send a packet.  SendTo is declared
   230    * protocol uses to tell a NetDevice to send a packet.  SendTo is declared
   234    * @param p a reference to the packet to send
   234    * @param p a reference to the packet to send
   235    * @param dest a reference to the Address of the destination device
   235    * @param dest a reference to the Address of the destination device
   236    * @param protocolNumber Protocol Number used to find protocol touse
   236    * @param protocolNumber Protocol Number used to find protocol touse
   237    * @returns true if success, false on failure
   237    * @returns true if success, false on failure
   238    */
   238    */
   239   virtual bool SendTo (const Packet& p, const Address& dest, 
   239   virtual bool SendTo (Ptr<Packet> p, const Address& dest, 
   240                        uint16_t protocolNumber);
   240                        uint16_t protocolNumber);
   241   /**
   241   /**
   242    * Start Sending a Packet Down the Wire.
   242    * Start Sending a Packet Down the Wire.
   243    *
   243    *
   244    * The TransmitStart method is the method that is used internally in the
   244    * The TransmitStart method is the method that is used internally in the
   251    * @see PointToPointChannel::TransmitStart ()
   251    * @see PointToPointChannel::TransmitStart ()
   252    * @see TransmitCompleteEvent ()
   252    * @see TransmitCompleteEvent ()
   253    * @param p a reference to the packet to send
   253    * @param p a reference to the packet to send
   254    * @returns true if success, false on failure
   254    * @returns true if success, false on failure
   255    */
   255    */
   256   bool TransmitStart (Packet &p);
   256   bool TransmitStart (Ptr<Packet> p);
   257   /**
   257   /**
   258    * Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
   258    * Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
   259    *
   259    *
   260    * The TransmitComplete method is used internally to finish the process
   260    * The TransmitComplete method is used internally to finish the process
   261    * of sending a packet out on the channel.
   261    * of sending a packet out on the channel.
   307    * fire.
   307    * fire.
   308    *
   308    *
   309    * @see class CallBackTraceSource
   309    * @see class CallBackTraceSource
   310    * @see class TraceResolver
   310    * @see class TraceResolver
   311    */
   311    */
   312   CallbackTraceSource<const Packet &> m_rxTrace;
   312   CallbackTraceSource<Ptr<const Packet> > m_rxTrace;
   313   /**
   313   /**
   314    * The trace source for the packet drop events that the device can
   314    * The trace source for the packet drop events that the device can
   315    * fire.
   315    * fire.
   316    *
   316    *
   317    * @see class CallBackTraceSource
   317    * @see class CallBackTraceSource
   318    * @see class TraceResolver
   318    * @see class TraceResolver
   319    */
   319    */
   320   CallbackTraceSource<const Packet &> m_dropTrace;
   320   CallbackTraceSource<Ptr<const Packet> > m_dropTrace;
   321   /** 
   321   /** 
   322    * Default data rate.  Used for all newly created p2p net devices
   322    * Default data rate.  Used for all newly created p2p net devices
   323    */
   323    */
   324    static DataRateDefaultValue g_defaultRate;
   324    static DataRateDefaultValue g_defaultRate;
   325 
   325