28 #include "ns3/object.h"
29 #include "ns3/nstime.h"
30 #include "ns3/type-id.h"
31 #include "ns3/traced-callback.h"
32 #include "ns3/ndn-name.h"
72 typedef Callback<void, Ptr<Face>, Ptr<Data> > DataHandler;
77 Face (Ptr<Node> node);
167 SetUp (
bool up =
true);
198 virtual std::ostream&
199 Print (std::ostream &os)
const;
250 Send (Ptr<Packet> packet);
273 DataHandler m_upstreamDataHandler;
281 operator<< (std::ostream& os,
const Face &face);
302 operator < (const Ptr<Face> &lhs,
const Ptr<Face> &rhs)
322 return !(*
this == face);
void SetUp(bool up=true)
These are face states and may be distinct from actual lower-layer device states, such as found in rea...
Ptr< Node > m_node
Smart pointer to Node.
virtual std::ostream & Print(std::ostream &os) const
Print information about the face into the stream.
virtual bool SendData(Ptr< const Data > data)
Send out Dat packet through the face.
bool operator<(const Face &face) const
Compare two faces.
virtual bool SendInterest(Ptr< const Interest > interest)
Send out interest through the face.
virtual bool ReceiveInterest(Ptr< Interest > interest)
Receive interest from application or another node and forward it up to the NDN stack.
uint32_t GetId() const
Get face Id.
uint32_t GetFlags() const
Get face flags.
void SetId(uint32_t id)
Set face Id.
bool operator==(const Face &face) const
Compare two faces.
virtual void UnRegisterProtocolHandlers()
Un-Register callback to call when new packet arrives on the face.
bool operator!=(const Face &face) const
Compare two faces.
virtual void RegisterProtocolHandlers(const InterestHandler &interestHandler, const DataHandler &dataHandler)
Register callback to call when new packet arrives on the face.
Virtual class defining NDN face.
virtual void SetMetric(uint16_t metric)
Assign routing/forwarding metric with face.
virtual bool Receive(Ptr< const Packet > p)
Send packet up to the stack (towards forwarding strategy)
void SetFlags(uint32_t flags)
Set face flags.
virtual uint16_t GetMetric(void) const
Get routing/forwarding metric assigned to the face.
virtual bool Send(Ptr< Packet > packet)
Send packet down to the stack (towards app or network)
Face(Ptr< Node > node)
Default constructor.
Ptr< Node > GetNode() const
Get node to which this face is associated.
Flags
List of currently defined face flags.
virtual bool ReceiveData(Ptr< Data > data)
Receive Data packet from application or another node and forward it up to the NDN stack...
Callback< void, Ptr< Face >, Ptr< Interest > > InterestHandler
NDN protocol handlers.
bool IsUp() const
Returns true if this face is enabled, false otherwise.