1#ifndef NDNPH_APP_PING_SERVER_HPP
2#define NDNPH_APP_PING_SERVER_HPP
4#include "../face/packet-handler.hpp"
5#include "../keychain/digest.hpp"
19 , m_prefix(std::move(prefix))
24 if (!m_prefix.
isPrefixOf(interest.getName())) {
31 data.
setName(interest.getName());
Data packet.
Definition data.hpp:136
void setName(const Name &v)
Definition data.hpp:144
Signed sign(const PrivateKey &key, DSigInfo sigInfo=DSigInfo()) const
Sign the packet with a private key.
Definition data.hpp:254
void setFreshnessPeriod(uint32_t v)
Definition data.hpp:160
static const DigestKey & get()
Definition digest.hpp:16
Network layer face.
Definition face.hpp:12
Interest packet.
Definition interest.hpp:284
Name.
Definition name.hpp:14
bool isPrefixOf(const Name &other) const
Determine if this name is a prefix of other.
Definition name.hpp:239
Base class to receive packets from Face.
Definition packet-handler.hpp:10
bool reply(Arg &&... arg)
Synchronously transmit a packet in reply to current processing packet.
Definition packet-handler.hpp:119
Respond to every incoming Interest with empty Data.
Definition ping-server.hpp:10
bool processInterest(Interest interest) final
Override to receive Interest packets.
Definition ping-server.hpp:23
PingServer(Name prefix, Face &face, const PrivateKey &signer=DigestKey::get())
Constructor.
Definition ping-server.hpp:17
Private key.
Definition private-key.hpp:9
RefType create(Arg &&... arg)
Allocate and create an object, and return its reference.
Definition region.hpp:90
Region with statically allocated memory.
Definition region.hpp:143
#define NDNPH_ASSERT(x)
Definition common.hpp:30