NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-app-link-service.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_APP_LINK_SERVICE_HPP
21 #define NDN_APP_LINK_SERVICE_HPP
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/NFD/daemon/face/link-service.hpp"
25 
26 namespace ns3 {
27 
28 class Packet;
29 class Node;
30 
31 namespace ndn {
32 
33 class App;
34 
42 {
43 public:
47  AppLinkService(Ptr<App> app);
48 
49  virtual ~AppLinkService();
50 
51 public:
52  void
53  onReceiveInterest(const Interest& interest);
54 
55  void
56  onReceiveData(const Data& data);
57 
58  void
59  onReceiveNack(const lp::Nack& nack);
60 
61 private:
62  virtual void
63  doSendInterest(const Interest& interest, const nfd::EndpointId& endpoint) override;
64 
65  virtual void
66  doSendData(const Data& data, const nfd::EndpointId& endpoint) override;
67 
68  virtual void
69  doSendNack(const lp::Nack& nack, const nfd::EndpointId& endpoint) override;
70 
71  virtual void
72  doReceivePacket(const Block& packet, const nfd::EndpointId& endpoint) override
73  {
74  // does nothing (all operations for now handled by LinkService)
75  BOOST_ASSERT(false);
76  }
77 
78 private:
79  Ptr<Node> m_node;
80  Ptr<App> m_app;
81 };
82 
83 } // namespace ndn
84 } // namespace ns3
85 
86 #endif // NDN_APP_LINK_SERVICE_HPP
ndn::tlv::Interest
@ Interest
Definition: tlv.hpp:65
ns3::ndn::AppLinkService
Implementation of LinkService for ndnSIM application.
Definition: ndn-app-link-service.hpp:42
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app-link-service.cpp:32
ns3::ndn::AppLinkService::onReceiveNack
void onReceiveNack(const lp::Nack &nack)
Definition: ndn-app-link-service.cpp:91
ns3::ndn::AppLinkService::onReceiveInterest
void onReceiveInterest(const Interest &interest)
Definition: ndn-app-link-service.cpp:79
App
ndn App
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app.cpp:29
nfd::face::LinkService
the upper part of a Face
Definition: link-service.hpp:76
ns3::ndn::AppLinkService::onReceiveData
void onReceiveData(const Data &data)
Definition: ndn-app-link-service.cpp:85
ndn::tlv::Data
@ Data
Definition: tlv.hpp:66
ns3::ndn::AppLinkService::AppLinkService
AppLinkService(Ptr< App > app)
Default constructor.
Definition: ndn-app-link-service.cpp:35
ndn::lp::Nack
represents a Network Nack
Definition: nack.hpp:39
ns3::ndn::AppLinkService::~AppLinkService
virtual ~AppLinkService()
Definition: ndn-app-link-service.cpp:44
nfd::face::EndpointId
uint64_t EndpointId
Identifies a remote endpoint on the link.
Definition: face-common.hpp:65
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-strategy-choice-helper.hpp:34