NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
face-status-publisher.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "fw/face-table.hpp"
27 
28 #include <boost/range/adaptor/reversed.hpp>
29 #include <ndn-cxx/management/nfd-face-status.hpp>
30 
31 namespace nfd {
32 
34  AppFace& face,
35  const Name& prefix,
36  ndn::KeyChain& keyChain)
37  : SegmentPublisher(face, prefix, keyChain)
38  , m_faceTable(faceTable)
39 {
40 }
41 
43 {
44 }
45 
46 size_t
48 {
49  size_t totalLength = 0;
50 
51  for (const shared_ptr<Face>& face : m_faceTable | boost::adaptors::reversed) {
52  ndn::nfd::FaceStatus status = face->getFaceStatus();
53  totalLength += status.wireEncode(outBuffer);
54  }
55  return totalLength;
56 }
57 
58 } // namespace nfd
provides a publisher of Status Dataset or other segmented octet stream
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend FaceStatus to the encoder
container of all Faces
Definition: face-table.hpp:38
EncodingImpl< EncoderTag > EncodingBuffer
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
virtual size_t generate(ndn::EncodingBuffer &outBuffer)
In a derived class, write the octets into outBuffer.
FaceStatusPublisher(const FaceTable &faceTable, AppFace &face, const Name &prefix, ndn::KeyChain &keyChain)
represents Face status
Name abstraction to represent an absolute name.
Definition: name.hpp:46