All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
Echo Class Reference

The Echo class extends ElementListenerLite and has an onReceivedElement to process the incoming Interest packet by sending an echo Data packet. More...

Inheritance diagram for Echo:
ndn::ElementListenerLite ndn_ElementListener

Public Member Functions

 Echo (const NameLite &prefix, const RsaPrivateKeyLite &privateKey, const NameLite &certificateName, TcpTransportLite &transport)
 Create an Echo. More...
 
void onReceivedElement (const uint8_t *element, size_t elementLength)
 This is called when an entire packet is received. More...
 
 Echo (KeyChain &keyChain, const Name &certificateName)
 
void operator() (const ptr_lib::shared_ptr< const Name > &prefix, const ptr_lib::shared_ptr< const Interest > &interest, Face &face, uint64_t interestFilterId, const ptr_lib::shared_ptr< const InterestFilter > &filter)
 
void operator() (const ptr_lib::shared_ptr< const Name > &prefix)
 
- Public Member Functions inherited from ndn::ElementListenerLite
 ElementListenerLite (OnReceivedElementLite onReceivedElement)
 Create an ElementListenerLite to use the onReceivedElement function pointer. More...
 

Public Attributes

int responseCount_
 
KeyChain keyChain_
 
Name certificateName_
 

Detailed Description

The Echo class extends ElementListenerLite and has an onReceivedElement to process the incoming Interest packet by sending an echo Data packet.

Constructor & Destructor Documentation

Echo::Echo ( const NameLite prefix,
const RsaPrivateKeyLite privateKey,
const NameLite certificateName,
TcpTransportLite transport 
)
inline

Create an Echo.

Parameters
prefixThe prefix used for register prefix so that onReceivedElement can check if the incoming Interest packet matches. This does not make a copy; the referenced object must remain valid.
privateKeyThe private key for signing. This does not make a copy; the referenced object must remain valid.
certificateNameThe name for the KeyLocator. This does not make a copy; the referenced object must remain valid.
transportThis calls transport.send.

Member Function Documentation

void Echo::onReceivedElement ( const uint8_t *  element,
size_t  elementLength 
)

This is called when an entire packet is received.

If this is an Interest for the prefix, create and send the echo Data packet.

Parameters
elementpointer to the element. This buffer is only valid during this call. If you need the data later, you must copy.
elementLengthlength of element

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