blob: ac9a492fef9e7ecbac3f1bf1df37676d8eca6980 [file] [log] [blame]
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -07001/* -*- 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>
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080019 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070020 */
21
22#ifndef CCNX_PRODUCER_H
23#define CCNX_PRODUCER_H
24
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080025#include "ccnx-app.h"
26
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070027#include "ns3/ptr.h"
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070028#include "ns3/ccnx-name-components.h"
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070029
30namespace ns3
31{
Ilya Moiseenkob62c7402011-10-28 13:02:18 -070032
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080033class CcnxProducer : public CcnxApp
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070034{
35public:
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080036 static TypeId
37 GetTypeId (void);
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070038
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080039 CcnxProducer ();
40
41 // inherited from CcnxApp
42 void OnInterest (const Ptr<const CcnxInterestHeader> &interest);
43
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080044protected:
45 // inherited from Application base class.
46 virtual void
47 StartApplication (); // Called at time specified by Start
48
49 virtual void
50 StopApplication (); // Called at time specified by Stop
51
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070052private:
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080053 CcnxNameComponents m_prefix;
54 uint32_t m_virtualPayloadSize;
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070055};
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080056
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070057}
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080058
59#endif // CCNX_PRODUCER_H