src/node/net-device.h
changeset 1303 9856d1175cbb
parent 1266 6b27f6b349ba
child 1304 642d6798feaa
equal deleted inserted replaced
1290:48ebb7788499 1303:9856d1175cbb
   156    *  Called from higher layer to send packet into Network Device
   156    *  Called from higher layer to send packet into Network Device
   157    *  to the specified destination Address
   157    *  to the specified destination Address
   158    * 
   158    * 
   159    * \return whether the Send operation succeeded 
   159    * \return whether the Send operation succeeded 
   160    */
   160    */
   161   bool Send(const Packet& p, const Address& dest, uint16_t protocolNumber);
   161   bool Send(Packet& p, const Address& dest, uint16_t protocolNumber);
   162   /**
   162   /**
   163    * \returns the node base class which contains this network
   163    * \returns the node base class which contains this network
   164    *          interface.
   164    *          interface.
   165    *
   165    *
   166    * When a subclass needs to get access to the underlying node
   166    * When a subclass needs to get access to the underlying node
   185    *        given to the Send method by the user on the sender side.
   185    *        given to the Send method by the user on the sender side.
   186    * \param address the address of the sender
   186    * \param address the address of the sender
   187    * \returns true if the callback could handle the packet successfully, false
   187    * \returns true if the callback could handle the packet successfully, false
   188    *          otherwise.
   188    *          otherwise.
   189    */
   189    */
   190   typedef Callback<bool,Ptr<NetDevice>,const Packet &,uint16_t,const Address &> ReceiveCallback;
   190   typedef Callback<bool,Ptr<NetDevice>,Packet &,uint16_t,const Address &> ReceiveCallback;
   191 
   191 
   192   /**
   192   /**
   193    * \param cb callback to invoke whenever a packet has been received and must
   193    * \param cb callback to invoke whenever a packet has been received and must
   194    *        be forwarded to the higher layers.
   194    *        be forwarded to the higher layers.
   195    *
   195    *
   249    *
   249    *
   250    * When a subclass gets a packet from the channel, it 
   250    * When a subclass gets a packet from the channel, it 
   251    * forwards it to the higher layers by calling this method
   251    * forwards it to the higher layers by calling this method
   252    * which is responsible for passing it up to the Rx callback.
   252    * which is responsible for passing it up to the Rx callback.
   253    */
   253    */
   254   bool ForwardUp (const Packet& p, uint32_t param, const Address &address);
   254   bool ForwardUp (Packet& p, uint32_t param, const Address &address);
   255 
   255 
   256 
   256 
   257   /**
   257   /**
   258    * The dispose method for this NetDevice class.
   258    * The dispose method for this NetDevice class.
   259    * Subclasses are expected to override this method _and_
   259    * Subclasses are expected to override this method _and_
   272    *
   272    *
   273    * This is the private virtual target function of the public Send()
   273    * This is the private virtual target function of the public Send()
   274    * method.  When the link is Up, this method is invoked to ask 
   274    * method.  When the link is Up, this method is invoked to ask 
   275    * subclasses to forward packets. Subclasses MUST override this method.
   275    * subclasses to forward packets. Subclasses MUST override this method.
   276    */
   276    */
   277   virtual bool SendTo (const Packet& p, const Address &dest, uint16_t protocolNumber) = 0;
   277   virtual bool SendTo (Packet& p, const Address &dest, uint16_t protocolNumber) = 0;
   278   /**
   278   /**
   279    * \returns true if this NetDevice needs the higher-layers
   279    * \returns true if this NetDevice needs the higher-layers
   280    *          to perform ARP over it, false otherwise.
   280    *          to perform ARP over it, false otherwise.
   281    *
   281    *
   282    * Subclasses must implement this method.
   282    * Subclasses must implement this method.