NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::TcpFace Class Reference

Implementation of TCP/IP NDN face. More...

#include <ndn-tcp-face.h>

Inheritance diagram for ns3::ndn::TcpFace:
Collaboration diagram for ns3::ndn::TcpFace:

Public Member Functions

 TcpFace (Ptr< Node > node, Ptr< Socket > socket, Ipv4Address address)
 Constructor. More...
 
void OnTcpConnectionClosed (Ptr< Socket > socket)
 
Ipv4Address GetAddress () const
 
void SetCreateCallback (Callback< void, Ptr< Face > > callback)
 
void OnConnect (Ptr< Socket > socket)
 
virtual void RegisterProtocolHandlers (const InterestHandler &interestHandler, const DataHandler &dataHandler)
 Register callback to call when new packet arrives on the face. More...
 
virtual void UnRegisterProtocolHandlers ()
 Un-Register callback to call when new packet arrives on the face. More...
 
virtual std::ostream & Print (std::ostream &os) const
 Print information about the face into the stream. More...
 
- Public Member Functions inherited from ns3::ndn::Face
 Face (Ptr< Node > node)
 Default constructor. More...
 
Ptr< Node > GetNode () const
 Get node to which this face is associated.
 
virtual bool SendInterest (Ptr< const Interest > interest)
 Send out interest through the face. More...
 
virtual bool SendData (Ptr< const Data > data)
 Send out Dat packet through the face. More...
 
virtual bool ReceiveInterest (Ptr< Interest > interest)
 Receive interest from application or another node and forward it up to the NDN stack. More...
 
virtual bool ReceiveData (Ptr< Data > data)
 Receive Data packet from application or another node and forward it up to the NDN stack. More...
 
virtual void SetMetric (uint16_t metric)
 Assign routing/forwarding metric with face. More...
 
virtual uint16_t GetMetric (void) const
 Get routing/forwarding metric assigned to the face. More...
 
void SetUp (bool up=true)
 These are face states and may be distinct from actual lower-layer device states, such as found in real implementations (where the device may be down but ndn face state is still up). More...
 
bool IsUp () const
 Returns true if this face is enabled, false otherwise.
 
uint32_t GetFlags () const
 Get face flags. More...
 
void SetId (uint32_t id)
 Set face Id. More...
 
uint32_t GetId () const
 Get face Id. More...
 
bool operator== (const Face &face) const
 Compare two faces. More...
 
bool operator!= (const Face &face) const
 Compare two faces. More...
 
bool operator< (const Face &face) const
 Compare two faces. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 
static Ptr< TcpFaceGetFaceByAddress (const Ipv4Address &addr)
 
- Static Public Member Functions inherited from ns3::ndn::Face
static TypeId GetTypeId ()
 

Protected Member Functions

virtual bool Send (Ptr< Packet > p)
 Send packet down to the stack (towards app or network)
 
- Protected Member Functions inherited from ns3::ndn::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.
 

Additional Inherited Members

- Public Types inherited from ns3::ndn::Face
enum  Flags { APPLICATION = 1 }
 List of currently defined face flags. More...
 
typedef Callback< void, Ptr
< Face >, Ptr< Interest > > 
InterestHandler
 NDN protocol handlers. More...
 
typedef Callback< void, Ptr
< Face >, Ptr< Data > > 
DataHandler
 
- Protected Attributes inherited from ns3::ndn::Face
Ptr< Node > m_node
 Smart pointer to Node.
 

Detailed Description

Implementation of TCP/IP NDN face.

See also
NdnAppFace, NdnNetDeviceFace, NdnIpv4Face, NdnUdpFace

Doxygen introspection did not find any typical Config paths.
No Attributes are defined for this type.
No TraceSources are defined for this type.

Definition at line 40 of file ndn-tcp-face.h.

Constructor & Destructor Documentation

ns3::ndn::TcpFace::TcpFace ( Ptr< Node >  node,
Ptr< Socket >  socket,
Ipv4Address  address 
)

Constructor.

By default, Ndn face are created in the "down" state.

Parameters
nodeNode associated with the face

Before becoming useable, the user must invoke SetUp on the face

Definition at line 127 of file ndn-tcp-face.cc.

References ns3::ndn::Face::SetMetric().

Member Function Documentation

std::ostream & ns3::ndn::TcpFace::Print ( std::ostream &  os) const
virtual

Print information about the face into the stream.

Parameters
osstream to write information to

Reimplemented from ns3::ndn::Face.

Definition at line 278 of file ndn-tcp-face.cc.

References ns3::ndn::Face::GetId().

void ns3::ndn::TcpFace::RegisterProtocolHandlers ( const InterestHandler interestHandler,
const DataHandler &  dataHandler 
)
virtual

Register callback to call when new packet arrives on the face.

This method should call protocol-dependent registration function

Reimplemented from ns3::ndn::Face.

Definition at line 147 of file ndn-tcp-face.cc.

References ns3::ndn::Face::RegisterProtocolHandlers().

void ns3::ndn::TcpFace::UnRegisterProtocolHandlers ( )
virtual

Un-Register callback to call when new packet arrives on the face.

This method should call protocol-dependent registration function

Reimplemented from ns3::ndn::Face.

Definition at line 156 of file ndn-tcp-face.cc.

References ns3::ndn::Face::UnRegisterProtocolHandlers().


The documentation for this class was generated from the following files: