NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
face-impl.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013-2019 Regents of the University of California.
4  *
5  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6  *
7  * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later version.
10  *
11  * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13  * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14  *
15  * You should have received copies of the GNU General Public License and GNU Lesser
16  * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17  * <http://www.gnu.org/licenses/>.
18  *
19  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20  */
21 
22 #ifndef NDN_IMPL_FACE_IMPL_HPP
23 #define NDN_IMPL_FACE_IMPL_HPP
24 
25 #include "ndn-cxx/face.hpp"
29 #include "ndn-cxx/lp/packet.hpp"
30 #include "ndn-cxx/lp/tags.hpp"
34 // #include "ndn-cxx/transport/tcp-transport.hpp"
35 // #include "ndn-cxx/transport/unix-transport.hpp"
37 #include "ndn-cxx/util/logger.hpp"
39 #include "ndn-cxx/util/signal.hpp"
40 
42 // INFO level: prefix registration, etc.
43 //
44 // DEBUG level: packet logging.
45 // Each log entry starts with a direction symbol ('<' denotes an outgoing packet, '>' denotes an
46 // incoming packet) and a packet type symbol ('I' denotes an Interest, 'D' denotes a Data, 'N'
47 // denotes a Nack). Interest is printed in its URI string representation, Data is printed as name
48 // only, Nack is printed as the Interest followed by the Nack reason separated by a '~' symbol. A
49 // log line about an incoming packet may be followed by zero or more lines about Interest matching
50 // InterestFilter, Data satisfying Interest, or Nack rejecting Interest, which are also written at
51 // DEBUG level.
52 //
53 // TRACE level: more detailed unstructured messages.
54 
55 namespace ndn {
56 
59 class Face::Impl : noncopyable
60 {
61 public:
65 
66  Impl(Face& face, KeyChain& keyChain)
67  : m_face(face)
68  , m_scheduler(m_face.getIoService())
69  , m_nfdController(m_face, keyChain)
70  {
71  auto postOnEmptyPitOrNoRegisteredPrefixes = [this] {
72  m_scheduler.schedule(time::seconds(0), bind(&Impl::onEmptyPitOrNoRegisteredPrefixes, this));
73  // without this extra "post", transport can get paused (-async_read) and then resumed
74  // (+async_read) from within onInterest/onData callback. After onInterest/onData
75  // finishes, there is another +async_read with the same memory block. A few of such
76  // async_read duplications can cause various effects and result in segfault.
77  };
78 
79  m_pendingInterestTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes);
80  m_registeredPrefixTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes);
81  }
82 
83 public: // consumer
84  void
85  asyncExpressInterest(RecordId id, shared_ptr<const Interest> interest,
86  const DataCallback& afterSatisfied,
87  const NackCallback& afterNacked,
88  const TimeoutCallback& afterTimeout)
89  {
90  NDN_LOG_DEBUG("<I " << *interest);
91  this->ensureConnected(true);
92 
93  const Interest& interest2 = *interest;
94  auto& entry = m_pendingInterestTable.put(id, std::move(interest), afterSatisfied, afterNacked,
95  afterTimeout, ref(m_scheduler));
96 
97  lp::Packet lpPacket;
98  addFieldFromTag<lp::NextHopFaceIdField, lp::NextHopFaceIdTag>(lpPacket, interest2);
99  addFieldFromTag<lp::CongestionMarkField, lp::CongestionMarkTag>(lpPacket, interest2);
100 
101  entry.recordForwarding();
102  m_face.m_transport->send(finishEncoding(std::move(lpPacket), interest2.wireEncode(),
103  'I', interest2.getName()));
104  dispatchInterest(entry, interest2);
105  }
106 
107  void
109  {
110  m_pendingInterestTable.erase(id);
111  }
112 
113  void
115  {
116  m_pendingInterestTable.clear();
117  }
118 
121  bool
123  {
124  bool hasAppMatch = false, hasForwarderMatch = false;
125  m_pendingInterestTable.removeIf([&] (PendingInterest& entry) {
126  if (!entry.getInterest()->matchesData(data)) {
127  return false;
128  }
129  NDN_LOG_DEBUG(" satisfying " << *entry.getInterest() << " from " << entry.getOrigin());
130 
131  if (entry.getOrigin() == PendingInterestOrigin::APP) {
132  hasAppMatch = true;
133  entry.invokeDataCallback(data);
134  }
135  else {
136  hasForwarderMatch = true;
137  }
138 
139  return true;
140  });
141 
142  // if Data matches no pending Interest record, it is sent to the forwarder as unsolicited Data
143  return hasForwarderMatch || !hasAppMatch;
144  }
145 
148  optional<lp::Nack>
150  {
151  optional<lp::Nack> outNack;
152  m_pendingInterestTable.removeIf([&] (PendingInterest& entry) {
153  if (!nack.getInterest().matchesInterest(*entry.getInterest())) {
154  return false;
155  }
156  NDN_LOG_DEBUG(" nacking " << *entry.getInterest() << " from " << entry.getOrigin());
157 
158  optional<lp::Nack> outNack1 = entry.recordNack(nack);
159  if (!outNack1) {
160  return false;
161  }
162 
163  if (entry.getOrigin() == PendingInterestOrigin::APP) {
164  entry.invokeNackCallback(*outNack1);
165  }
166  else {
167  outNack = outNack1;
168  }
169  return true;
170  });
171 
172  // send "least severe" Nack from any PendingInterest record originated from forwarder, because
173  // it is unimportant to consider Nack reason for the unlikely case when forwarder sends multiple
174  // Interests to an app in a short while
175  return outNack;
176  }
177 
178 public: // producer
179  void
181  const InterestCallback& onInterest)
182  {
183  NDN_LOG_INFO("setting InterestFilter: " << filter);
184  m_interestFilterTable.put(id, filter, onInterest);
185  }
186 
187  void
189  {
190  const InterestFilterRecord* record = m_interestFilterTable.get(id);
191  if (record != nullptr) {
192  NDN_LOG_INFO("unsetting InterestFilter: " << record->getFilter());
193  m_interestFilterTable.erase(id);
194  }
195  }
196 
197  void
198  processIncomingInterest(shared_ptr<const Interest> interest)
199  {
200  const Interest& interest2 = *interest;
201  auto& entry = m_pendingInterestTable.insert(std::move(interest), ref(m_scheduler));
202  dispatchInterest(entry, interest2);
203  }
204 
205  void
206  dispatchInterest(PendingInterest& entry, const Interest& interest)
207  {
208  m_interestFilterTable.forEach([&] (const InterestFilterRecord& filter) {
209  if (!filter.doesMatch(entry)) {
210  return;
211  }
212  NDN_LOG_DEBUG(" matches " << filter.getFilter());
213  entry.recordForwarding();
214  filter.invokeInterestCallback(interest);
215  });
216  }
217 
218  void
219  asyncPutData(const Data& data)
220  {
221  NDN_LOG_DEBUG("<D " << data.getName());
222  bool shouldSendToForwarder = satisfyPendingInterests(data);
223  if (!shouldSendToForwarder) {
224  return;
225  }
226 
227  this->ensureConnected(true);
228 
229  lp::Packet lpPacket;
230  addFieldFromTag<lp::CachePolicyField, lp::CachePolicyTag>(lpPacket, data);
231  addFieldFromTag<lp::CongestionMarkField, lp::CongestionMarkTag>(lpPacket, data);
232 
233  m_face.m_transport->send(finishEncoding(std::move(lpPacket), data.wireEncode(),
234  'D', data.getName()));
235  }
236 
237  void
238  asyncPutNack(const lp::Nack& nack)
239  {
240  NDN_LOG_DEBUG("<N " << nack.getInterest() << '~' << nack.getHeader().getReason());
241  optional<lp::Nack> outNack = nackPendingInterests(nack);
242  if (!outNack) {
243  return;
244  }
245 
246  this->ensureConnected(true);
247 
248  lp::Packet lpPacket;
249  lpPacket.add<lp::NackField>(outNack->getHeader());
250  addFieldFromTag<lp::CongestionMarkField, lp::CongestionMarkTag>(lpPacket, *outNack);
251 
252  const Interest& interest = outNack->getInterest();
253  m_face.m_transport->send(finishEncoding(std::move(lpPacket), interest.wireEncode(),
254  'N', interest.getName()));
255  }
256 
257 public: // prefix registration
258  RecordId
259  registerPrefix(const Name& prefix,
260  const RegisterPrefixSuccessCallback& onSuccess,
261  const RegisterPrefixFailureCallback& onFailure,
262  uint64_t flags, const nfd::CommandOptions& options,
263  const optional<InterestFilter>& filter, const InterestCallback& onInterest)
264  {
265  NDN_LOG_INFO("registering prefix: " << prefix);
266  auto id = m_registeredPrefixTable.allocateId();
267 
268  m_nfdController.start<nfd::RibRegisterCommand>(
269  nfd::ControlParameters().setName(prefix).setFlags(flags),
270  [=] (const nfd::ControlParameters&) {
271  NDN_LOG_INFO("registered prefix: " << prefix);
272 
273  RecordId filterId = 0;
274  if (filter) {
275  NDN_LOG_INFO("setting InterestFilter: " << *filter);
276  InterestFilterRecord& filterRecord = m_interestFilterTable.insert(*filter, onInterest);
277  filterId = filterRecord.getId();
278  }
279 
280  m_registeredPrefixTable.put(id, prefix, options, filterId);
281 
282  if (onSuccess != nullptr) {
283  onSuccess(prefix);
284  }
285  },
286  [=] (const nfd::ControlResponse& resp) {
287  NDN_LOG_INFO("register prefix failed: " << prefix);
288  onFailure(prefix, resp.getText());
289  },
290  options);
291 
292  return id;
293  }
294 
295  void
297  const UnregisterPrefixSuccessCallback& onSuccess,
298  const UnregisterPrefixFailureCallback& onFailure)
299  {
300  const RegisteredPrefix* record = m_registeredPrefixTable.get(id);
301  if (record == nullptr) {
302  if (onFailure != nullptr) {
303  onFailure("Unrecognized RegisteredPrefixHandle");
304  }
305  return;
306  }
307 
308  if (record->getFilterId() != 0) {
310  }
311 
312  NDN_LOG_INFO("unregistering prefix: " << record->getPrefix());
313 
314  m_nfdController.start<nfd::RibUnregisterCommand>(
315  nfd::ControlParameters().setName(record->getPrefix()),
316  [=] (const nfd::ControlParameters&) {
317  NDN_LOG_INFO("unregistered prefix: " << record->getPrefix());
318  m_registeredPrefixTable.erase(id);
319 
320  if (onSuccess != nullptr) {
321  onSuccess();
322  }
323  },
324  [=] (const nfd::ControlResponse& resp) {
325  NDN_LOG_INFO("unregister prefix failed: " << record->getPrefix());
326  onFailure(resp.getText());
327  },
328  record->getCommandOptions());
329  }
330 
331 public: // IO routine
332  void
333  ensureConnected(bool wantResume)
334  {
335  if (!m_face.m_transport->isConnected()) {
336  m_face.m_transport->connect([this] (const Block& wire) { m_face.onReceiveElement(wire); });
337  }
338 
339  if (wantResume && !m_face.m_transport->isReceiving()) {
340  m_face.m_transport->resume();
341  }
342  }
343 
344  void
346  {
347  if (m_pendingInterestTable.empty() && m_registeredPrefixTable.empty()) {
348  m_face.m_transport->pause();
349  }
350  }
351 
352  void
354  {
355  m_pendingInterestTable.clear();
356  m_registeredPrefixTable.clear();
357  }
358 
359 private:
368  Block
369  finishEncoding(lp::Packet&& lpPacket, Block wire, char pktType, const Name& name)
370  {
371  if (!lpPacket.empty()) {
372  lpPacket.add<lp::FragmentField>(std::make_pair(wire.begin(), wire.end()));
373  wire = lpPacket.wireEncode();
374  }
375 
376  if (wire.size() > MAX_NDN_PACKET_SIZE) {
377  NDN_THROW(Face::OversizedPacketError(pktType, name, wire.size()));
378  }
379 
380  return wire;
381  }
382 
383 private:
384  Face& m_face;
385  Scheduler m_scheduler;
386  scheduler::ScopedEventId m_processEventsTimeoutEvent;
387  nfd::Controller m_nfdController;
388 
389  PendingInterestTable m_pendingInterestTable;
390  InterestFilterTable m_interestFilterTable;
391  RegisteredPrefixTable m_registeredPrefixTable;
392 
393  friend class Face;
394 };
395 
396 } // namespace ndn
397 
398 #endif // NDN_IMPL_FACE_IMPL_HPP
ndn::lp::Packet
Definition: packet.hpp:31
ndn::RecordContainer::removeIf
void removeIf(const Visitor &f)
Visit all records with the option to erase.
Definition: record-container.hpp:145
ndn::RegisterPrefixFailureCallback
function< void(const Name &, const std::string &)> RegisterPrefixFailureCallback
Callback invoked when registerPrefix or setInterestFilter command fails.
Definition: face.hpp:74
NDN_LOG_INIT
#define NDN_LOG_INIT(name)
declare a log module
Definition: logger.hpp:81
ndn::Face::Impl::asyncRemoveAllPendingInterests
void asyncRemoveAllPendingInterests()
Definition: face-impl.hpp:114
ndn::InterestFilterRecord::getFilter
const InterestFilter & getFilter() const
Definition: interest-filter-record.hpp:56
ndn::InterestFilterRecord
associates an InterestFilter with Interest callback
Definition: interest-filter-record.hpp:40
ndn::Face::Impl::satisfyPendingInterests
bool satisfyPendingInterests(const Data &data)
Definition: face-impl.hpp:122
nonstd::optional_lite::std11::move
T & move(T &t)
Definition: optional.hpp:421
signal.hpp
ndn::PendingInterestOrigin::APP
@ APP
Interest was received from this app via Face::expressInterest API.
ndn::Face::Impl::ensureConnected
void ensureConnected(bool wantResume)
Definition: face-impl.hpp:333
ndn::RegisteredPrefix::getCommandOptions
const nfd::CommandOptions & getCommandOptions() const
Definition: registered-prefix.hpp:59
ndn::lp::Packet::add
Packet & add(const typename FIELD::ValueType &value)
add a FIELD with value
Definition: packet.hpp:148
ndn::nfd::RibRegisterCommand
represents a rib/register command
Definition: control-command.hpp:297
ndn::RecordContainer::insert
Record & insert(TArgs &&... args)
Insert a record with newly assigned ID.
Definition: record-container.hpp:118
ndn::PendingInterest::recordForwarding
void recordForwarding()
Record that the Interest has been forwarded to one destination.
Definition: pending-interest.hpp:116
NDN_LOG_INFO
#define NDN_LOG_INFO(expression)
Definition: logger.hpp:100
ndn::Block::begin
Buffer::const_iterator begin() const
Get begin iterator of encoded wire.
Definition: block.cpp:263
ndn::RegisteredPrefix
stores information about a prefix registered in NDN forwarder
Definition: registered-prefix.hpp:42
ndn::InterestFilterRecord::doesMatch
bool doesMatch(const PendingInterest &entry) const
Check if Interest name matches the filter.
Definition: interest-filter-record.hpp:66
ndn::RecordContainer::clear
void clear()
Definition: record-container.hpp:133
ndn::RecordId
uintptr_t RecordId
Definition: record-container.hpp:32
ndn::Face::Impl::asyncRemovePendingInterest
void asyncRemovePendingInterest(RecordId id)
Definition: face-impl.hpp:108
ndn::Face::Impl::dispatchInterest
void dispatchInterest(PendingInterest &entry, const Interest &interest)
Definition: face-impl.hpp:206
ndn::scheduler::Scheduler::schedule
EventId schedule(time::nanoseconds after, EventCallback callback)
Schedule a one-time event after the specified delay.
Definition: scheduler.cpp:96
controller.hpp
ndn::Data::wireEncode
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Prepend wire encoding to encoder in NDN Packet Format v0.2.
Definition: data.cpp:48
ndn::Data::getName
const Name & getName() const
Get name.
Definition: data.hpp:124
ndn::Face::Impl::Face
friend class Face
Definition: face-impl.hpp:393
packet.hpp
ndn::Face::Impl::asyncUnregisterPrefix
void asyncUnregisterPrefix(RecordId id, const UnregisterPrefixSuccessCallback &onSuccess, const UnregisterPrefixFailureCallback &onFailure)
Definition: face-impl.hpp:296
transport.hpp
ndn::PendingInterest::getOrigin
PendingInterestOrigin getOrigin() const
Definition: pending-interest.hpp:105
ndn::Face
Provide a communication channel with local or remote NDN forwarder.
Definition: face.hpp:90
ndn::Face::Impl::asyncSetInterestFilter
void asyncSetInterestFilter(RecordId id, const InterestFilter &filter, const InterestCallback &onInterest)
Definition: face-impl.hpp:180
scheduler.hpp
ndn::RecordContainer::erase
void erase(RecordId id)
Definition: record-container.hpp:124
ndn::Face::Impl::shutdown
void shutdown()
Definition: face-impl.hpp:353
ndn::InterestFilterRecord::invokeInterestCallback
void invokeInterestCallback(const Interest &interest) const
invokes the InterestCallback
Definition: interest-filter-record.hpp:77
ndn::Face::Impl::Impl
Impl(Face &face, KeyChain &keyChain)
Definition: face-impl.hpp:66
ndn::Name
Represents an absolute name.
Definition: name.hpp:44
ndn::UnregisterPrefixSuccessCallback
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
Definition: face.hpp:79
ndn::PendingInterest
Stores a pending Interest and associated callbacks.
Definition: pending-interest.hpp:66
ndn::RecordContainer::get
Record * get(RecordId id)
Retrieve record by ID.
Definition: record-container.hpp:82
ndn::RecordContainer::forEach
void forEach(const Visitor &f)
Visit all records.
Definition: record-container.hpp:167
ndn::Face::Impl::asyncUnsetInterestFilter
void asyncUnsetInterestFilter(RecordId id)
Definition: face-impl.hpp:188
ndn::InterestFilter
declares the set of Interests a producer can serve, which starts with a name prefix,...
Definition: interest-filter.hpp:36
ndn::RecordContainer::allocateId
RecordId allocateId()
Definition: record-container.hpp:109
ndn::Face::Impl
implementation detail of Face
Definition: face-impl.hpp:60
ndn::InterestCallback
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
Definition: face.hpp:64
ndn::security::v2::KeyChain
The interface of signing key management.
Definition: key-chain.hpp:47
ndn::Face::Impl::RegisteredPrefixTable
RecordContainer< RegisteredPrefix > RegisteredPrefixTable
Definition: face-impl.hpp:64
NDN_THROW
#define NDN_THROW(e)
Definition: exception.hpp:61
ndn::lp::FieldDecl
Declare a field.
Definition: field-decl.hpp:180
ndn::RecordContainer::onEmpty
util::Signal< RecordContainer< T > > onEmpty
Signals when container becomes empty.
Definition: record-container.hpp:190
ndn::nfd::RibUnregisterCommand
represents a rib/unregister command
Definition: control-command.hpp:315
ndn::tlv::nfd::ControlParameters
@ ControlParameters
Definition: tlv-nfd.hpp:35
ndn::PendingInterest::recordNack
optional< lp::Nack > recordNack(const lp::Nack &nack)
Record an incoming Nack against a forwarded Interest.
Definition: pending-interest.hpp:127
ndn::DataCallback
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.
Definition: face.hpp:44
ndn::Face::Impl::InterestFilterTable
RecordContainer< InterestFilterRecord > InterestFilterTable
Definition: face-impl.hpp:63
lp-field-tag.hpp
ndn::nfd::Controller::start
void start(const ControlParameters &parameters, const CommandSucceedCallback &onSuccess, const CommandFailCallback &onFailure, const CommandOptions &options=CommandOptions())
start command execution
Definition: controller.hpp:78
config-file.hpp
ndn::RecordContainer::put
Record & put(RecordId id, TArgs &&... args)
Insert a record with given ID.
Definition: record-container.hpp:95
ndn::mgmt::ControlResponse
ControlCommand response.
Definition: control-response.hpp:33
ndn::Interest
Represents an Interest packet.
Definition: interest.hpp:44
ndn::RegisteredPrefix::getPrefix
const Name & getPrefix() const
Definition: registered-prefix.hpp:53
registered-prefix.hpp
logger.hpp
ndn::Data
Represents a Data packet.
Definition: data.hpp:36
ndn::RegisterPrefixSuccessCallback
function< void(const Name &)> RegisterPrefixSuccessCallback
Callback invoked when registerPrefix or setInterestFilter command succeeds.
Definition: face.hpp:69
ndn::nfd::CommandOptions
contains options for ControlCommand execution
Definition: command-options.hpp:35
ndn::NackCallback
function< void(const Interest &, const lp::Nack &)> NackCallback
Callback invoked when Nack is sent in response to expressed Interest.
Definition: face.hpp:54
ndn::RecordContainer::empty
NDN_CXX_NODISCARD bool empty() const noexcept
Definition: record-container.hpp:176
ndn::nfd::ControlParameters
represents parameters in a ControlCommand request or response
Definition: control-parameters.hpp:82
ndn::Face::Impl::processIncomingInterest
void processIncomingInterest(shared_ptr< const Interest > interest)
Definition: face-impl.hpp:198
ndn::Block::end
Buffer::const_iterator end() const
Get end iterator of encoded wire.
Definition: block.cpp:272
ndn::lp::Nack::getHeader
const NackHeader & getHeader() const
Definition: nack.hpp:63
NDN_LOG_DEBUG
#define NDN_LOG_DEBUG(expression)
Definition: logger.hpp:99
ndn::MAX_NDN_PACKET_SIZE
const size_t MAX_NDN_PACKET_SIZE
practical limit of network layer packet size
Definition: tlv.hpp:41
ndn::RegisteredPrefix::getFilterId
RecordId getFilterId() const
Definition: registered-prefix.hpp:65
face.hpp
ndn::Block
Represents a TLV element of NDN packet format.
Definition: block.hpp:43
ndn::Face::OversizedPacketError
Exception thrown when attempting to send a packet over size limit.
Definition: face.hpp:102
ndn::RecordBase::getId
RecordId getId() const
Definition: record-container.hpp:45
ndn::lp::Nack
represents a Network Nack
Definition: nack.hpp:39
ndn::PendingInterest::getInterest
shared_ptr< const Interest > getInterest() const
Definition: pending-interest.hpp:99
ndn::Face::Impl::PendingInterestTable
RecordContainer< PendingInterest > PendingInterestTable
Definition: face-impl.hpp:62
ndn::name
Definition: name-component-types.hpp:33
ndn::lp::NackHeader::getReason
NackReason getReason() const
Definition: nack-header.cpp:122
ndn::TimeoutCallback
function< void(const Interest &)> TimeoutCallback
Callback invoked when expressed Interest times out.
Definition: face.hpp:59
ndn::Interest::getName
const Name & getName() const noexcept
Definition: interest.hpp:121
ndn::Face::Impl::nackPendingInterests
optional< lp::Nack > nackPendingInterests(const lp::Nack &nack)
Definition: face-impl.hpp:149
ndn::Face::Impl::onEmptyPitOrNoRegisteredPrefixes
void onEmptyPitOrNoRegisteredPrefixes()
Definition: face-impl.hpp:345
tags.hpp
ndn::Face::getIoService
DummyIoService & getIoService()
Definition: face.hpp:423
command-options.hpp
ndn::Face::Impl::registerPrefix
RecordId registerPrefix(const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, uint64_t flags, const nfd::CommandOptions &options, const optional< InterestFilter > &filter, const InterestCallback &onInterest)
Definition: face-impl.hpp:259
ndn::Interest::wireEncode
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder according to NDN Packet Format v0.3.
Definition: interest.cpp:87
ndn::Face::Impl::asyncPutData
void asyncPutData(const Data &data)
Definition: face-impl.hpp:219
ndn::Face::Impl::asyncPutNack
void asyncPutNack(const lp::Nack &nack)
Definition: face-impl.hpp:238
ndn::UnregisterPrefixFailureCallback
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command fails.
Definition: face.hpp:84
pending-interest.hpp
ndn::lp::Nack::getInterest
const Interest & getInterest() const
Definition: nack.hpp:51
ndn::Face::Impl::asyncExpressInterest
void asyncExpressInterest(RecordId id, shared_ptr< const Interest > interest, const DataCallback &afterSatisfied, const NackCallback &afterNacked, const TimeoutCallback &afterTimeout)
Definition: face-impl.hpp:85
ndn::Interest::matchesInterest
bool matchesInterest(const Interest &other) const
Check if this Interest matches other.
Definition: interest.cpp:365
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-strategy-choice-helper.hpp:34
ndn::detail::ScopedCancelHandle< EventId >
ndn::RecordContainer< PendingInterest >