28 #include <boost/range/adaptor/reversed.hpp>
30 #include <ndn-cxx/management/nfd-face-status.hpp>
40 const ndn::nfd::FaceQueryFilter& filter,
41 ndn::KeyChain& keyChain)
43 , m_faceTable(faceTable)
44 , m_faceFilter(filter)
55 if (m_faceFilter.hasFaceId() &&
56 m_faceFilter.getFaceId() !=
static_cast<uint64_t
>(face->getId())) {
60 if (m_faceFilter.hasUriScheme() &&
61 (m_faceFilter.getUriScheme() != face->getRemoteUri().getScheme() ||
62 m_faceFilter.getUriScheme() != face->getLocalUri().getScheme())) {
66 if (m_faceFilter.hasRemoteUri() &&
67 m_faceFilter.getRemoteUri() != face->getRemoteUri().toString()) {
71 if (m_faceFilter.hasLocalUri() && m_faceFilter.getLocalUri() != face->getLocalUri().toString()) {
75 if (m_faceFilter.hasFaceScope() &&
76 (m_faceFilter.getFaceScope() == ndn::nfd::FACE_SCOPE_LOCAL) != face->isLocal()) {
80 if (m_faceFilter.hasFacePersistency() &&
81 (m_faceFilter.getFacePersistency() == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) !=
86 if (m_faceFilter.hasLinkType() &&
87 (m_faceFilter.getLinkType() == ndn::nfd::LINK_TYPE_MULTI_ACCESS) != face->isMultiAccess()) {
97 size_t totalLength = 0;
99 for (
const shared_ptr<Face>& face : m_faceTable | boost::adaptors::reversed) {
101 ndn::nfd::FaceStatus status = face->getFaceStatus();
102 totalLength += status.wireEncode(outBuffer);
provides a publisher of Status Dataset or other segmented octet stream
FaceQueryStatusPublisher(const FaceTable &faceTable, AppFace &face, const Name &prefix, const ndn::nfd::FaceQueryFilter &filter, ndn::KeyChain &keyChain)
virtual ~FaceQueryStatusPublisher()
#define NFD_LOG_INIT(name)
virtual size_t generate(ndn::EncodingBuffer &outBuffer)
In a derived class, write the octets into outBuffer.
bool doesMatchFilter(const shared_ptr< Face > &face)