NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
nacks.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19  */
20 #ifndef NDNSIM_NACKS_H
21 #define NDNSIM_NACKS_H
22 
23 #include "ns3/ndn-forwarding-strategy.h"
24 
25 namespace ns3 {
26 namespace ndn {
27 namespace fw {
28 
33 class Nacks :
34  public ForwardingStrategy
35 {
36 private:
37  typedef ForwardingStrategy super;
38 
39 public:
40  static TypeId
41  GetTypeId ();
42 
43  // from super
44  virtual void
45  OnInterest (Ptr<Face> face,
46  Ptr<Interest> interest);
47 
48 protected:
49  // from super
50  virtual void
51  DidReceiveDuplicateInterest (Ptr<Face> inFace,
52  Ptr<const Interest> interest,
53  Ptr<pit::Entry> pitEntry);
54 
55  // from super
56  virtual void
57  DidExhaustForwardingOptions (Ptr<Face> inFace,
58  Ptr<const Interest> interest,
59  Ptr<pit::Entry> pitEntry);
60 
61  virtual void
62  OnNack (Ptr<Face> inFace,
63  Ptr<Interest> nack);
64 
65  virtual void
66  DidReceiveValidNack (Ptr<Face> inFace,
67  uint32_t nackCode,
68  Ptr<const Interest> nack,
69  Ptr<pit::Entry> pitEntry);
70 
71 protected:
72  bool m_nacksEnabled;
73 
74  TracedCallback<Ptr<const Interest>,
75  Ptr<const Face> > m_outNacks;
76 
77  TracedCallback<Ptr<const Interest>,
78  Ptr<const Face> > m_inNacks;
79 
80  TracedCallback<Ptr<const Interest>,
81  Ptr<const Face> > m_dropNacks;
82 };
83 
84 } // namespace fw
85 } // namespace ndn
86 } // namespace ns3
87 
88 #endif // NDNSIM_NACKS
TracedCallback< Ptr< const Interest >, Ptr< const Face > > m_outNacks
trace of outgoing NACKs
Definition: nacks.h:75
TracedCallback< Ptr< const Interest >, Ptr< const Face > > m_dropNacks
trace of dropped NACKs
Definition: nacks.h:81
TracedCallback< Ptr< const Interest >, Ptr< const Face > > m_inNacks
trace of incoming NACKs
Definition: nacks.h:78
Implementation of experimental NACK messages (enables with EnableNACKs option)
Definition: nacks.h:33
Abstract base class for Ndn forwarding strategies.
virtual void DidExhaustForwardingOptions(Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)
An even that is fired when Interest cannot be forwarded.
Definition: nacks.cc:123
virtual void OnInterest(Ptr< Face > face, Ptr< Interest > interest)
Actual processing of incoming Ndn interests.
Definition: nacks.cc:77
virtual void DidReceiveDuplicateInterest(Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)
An event that is fired every time a duplicated Interest is received.
Definition: nacks.cc:105