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
ndn-producer.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: Ilya Moiseenko <iliamo@cs.ucla.edu>
19  * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
20  */
21 
22 #ifndef NDN_PRODUCER_H
23 #define NDN_PRODUCER_H
24 
25 #include "ndn-app.h"
26 
27 #include "ns3/ptr.h"
28 #include "ns3/ndn-name.h"
29 #include "ns3/ndn-data.h"
30 
31 namespace ns3 {
32 namespace ndn {
33 
43 class Producer : public App
44 {
45 public:
46  static TypeId
47  GetTypeId (void);
48 
49  Producer ();
50 
51  // inherited from NdnApp
52  void OnInterest (Ptr<const Interest> interest);
53 
54 protected:
55  // inherited from Application base class.
56  virtual void
57  StartApplication (); // Called at time specified by Start
58 
59  virtual void
60  StopApplication (); // Called at time specified by Stop
61 
62 private:
63  Name m_prefix;
64  Name m_postfix;
65  uint32_t m_virtualPayloadSize;
66  Time m_freshness;
67 
68  uint32_t m_signature;
69  Name m_keyLocator;
70 };
71 
72 } // namespace ndn
73 } // namespace ns3
74 
75 #endif // NDN_PRODUCER_H
Class for NDN Name.
Definition: name.h:29
virtual void StartApplication()
Called at time specified by Start.
Definition: ndn-producer.cc:90
void OnInterest(Ptr< const Interest > interest)
Method that will be called every time new Interest arrives.
Base class that all NDN applications should be derived from.
Definition: ndn-app.h:50
virtual void StopApplication()
Called at time specified by Stop.
A simple Interest-sink applia simple Interest-sink application.
Definition: ndn-producer.h:43