src/node/net-device.h
changeset 3460 99698bc858e8
parent 3448 0bd851bb1225
child 3464 9e7bd353e7e7
equal deleted inserted replaced
3459:a67df503c7bc 3460:99698bc858e8
   269    * \param packet the packet received
   269    * \param packet the packet received
   270    * \param protocol the 16 bit protocol number associated with this packet.
   270    * \param protocol the 16 bit protocol number associated with this packet.
   271    *        This protocol number is expected to be the same protocol number
   271    *        This protocol number is expected to be the same protocol number
   272    *        given to the Send method by the user on the sender side.
   272    *        given to the Send method by the user on the sender side.
   273    * \param sender the address of the sender
   273    * \param sender the address of the sender
   274    * \param receiver the address of the receiver
       
   275    * \returns true if the callback could handle the packet successfully, false
   274    * \returns true if the callback could handle the packet successfully, false
   276    *          otherwise.
   275    *          otherwise.
   277    */
   276    */
   278   typedef Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &,const Address &, PacketType> ReceiveCallback;
   277   typedef Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &> ReceiveCallback;
   279 
   278 
   280   /**
   279   /**
   281    * \param cb callback to invoke whenever a packet has been received and must
   280    * \param cb callback to invoke whenever a packet has been received and must
   282    *        be forwarded to the higher layers.
   281    *        be forwarded to the higher layers.
   283    *
   282    *
   284    */
   283    */
   285   virtual void SetReceiveCallback (ReceiveCallback cb) = 0;
   284   virtual void SetReceiveCallback (ReceiveCallback cb) = 0;
   286 
   285 
       
   286 
       
   287   /**
       
   288    * \param device a pointer to the net device which is calling this callback
       
   289    * \param packet the packet received
       
   290    * \param protocol the 16 bit protocol number associated with this packet.
       
   291    *        This protocol number is expected to be the same protocol number
       
   292    *        given to the Send method by the user on the sender side.
       
   293    * \param sender the address of the sender
       
   294    * \param receiver the address of the receiver
       
   295    * \param packetType type of packet received (broadcast/multicast/unicast/otherhost)
       
   296    * \returns true if the callback could handle the packet successfully, false
       
   297    *          otherwise.
       
   298    */
       
   299   typedef Callback< bool, Ptr<NetDevice>, Ptr<Packet>, uint16_t,
       
   300                     const Address &, const Address &, PacketType > PromiscReceiveCallback;
       
   301 
       
   302   /**
       
   303    * \param cb callback to invoke whenever a packet has been received in promiscuous mode and must
       
   304    *        be forwarded to the higher layers.
       
   305    * 
       
   306    * Enables netdevice promiscuous mode and sets the callback that
       
   307    * will handle promiscuous mode packets.  Note, promiscuous mode
       
   308    * packets means _all_ packets, including those packets that can be
       
   309    * sensed by the netdevice but which are intended to be received by
       
   310    * other hosts.
       
   311    */
       
   312   virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
       
   313 
       
   314   /**
       
   315    * \return true if this interface supports a promiscuous mode, false otherwise.
       
   316    */
       
   317   virtual bool SupportsPromiscuous (void) const;
       
   318 
   287 };
   319 };
   288 
   320 
   289 } // namespace ns3
   321 } // namespace ns3
   290 
   322 
   291 #endif /* NET_DEVICE_H */
   323 #endif /* NET_DEVICE_H */