blob: 4b54d798559f90ed4c715eda1f3d7bf047830e9d [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"
Alexander Afanasyevfaf95812012-06-05 21:28:11 -070029#include "ns3/ccnx-content-object-header.h"
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070030
31namespace ns3
32{
Ilya Moiseenkob62c7402011-10-28 13:02:18 -070033
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070034/**
35 * @brief A simple Interest-sink applia simple Interest-sink application
36 *
37 * A simple Interest-sink applia simple Interest-sink application,
38 * which replying every incoming Interest with Data packet with a specified
39 * size and name same as in Interest.cation, which replying every incoming Interest
40 * with Data packet with a specified size and name same as in Interest.
41 */
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080042class CcnxProducer : public CcnxApp
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070043{
44public:
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080045 static TypeId
46 GetTypeId (void);
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070047
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080048 CcnxProducer ();
49
50 // inherited from CcnxApp
Alexander Afanasyeve9c9d722012-01-19 16:59:30 -080051 void OnInterest (const Ptr<const CcnxInterestHeader> &interest, Ptr<Packet> packet);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080052
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080053protected:
54 // inherited from Application base class.
55 virtual void
56 StartApplication (); // Called at time specified by Start
57
58 virtual void
59 StopApplication (); // Called at time specified by Stop
60
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070061private:
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080062 CcnxNameComponents m_prefix;
63 uint32_t m_virtualPayloadSize;
Alexander Afanasyevfaf95812012-06-05 21:28:11 -070064
65 uint32_t m_signatureBits;
66 // CcnxContentObjectHeader::SignedInfo m_signedInfo;
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070067};
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080068
Ilya Moiseenko8196d2e2011-08-29 13:03:22 -070069}
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080070
71#endif // CCNX_PRODUCER_H