blob: 029dd0a48f87703f380448443d37d03ba217b338 [file] [log] [blame]
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Alexander Afanasyev98256102011-08-14 01:00:02 -07002/*
Ilya Moiseenko956d0542012-01-02 15:26:40 -08003 * Copyright (c) 2011 University of California, Los Angeles
Alexander Afanasyev98256102011-08-14 01:00:02 -07004 *
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 *
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070018 * Authors: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 Ilya Moiseenko <iliamo@cs.ucla.edu>
Alexander Afanasyev98256102011-08-14 01:00:02 -070020 */
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070021
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070022#ifndef NDN_APP_FACE_H
23#define NDN_APP_FACE_H
Alexander Afanasyev98256102011-08-14 01:00:02 -070024
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070025#include "ndn-face.h"
Ilya Moiseenko1a8be032012-01-18 12:51:09 -080026#include "ns3/traced-callback.h"
Alexander Afanasyev98256102011-08-14 01:00:02 -070027
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070028namespace ns3 {
Alexander Afanasyev98256102011-08-14 01:00:02 -070029
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070030class Packet;
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070031
32namespace ndn {
33
Alexander Afanasyeveae83ee2013-03-15 15:01:10 -070034class Interest;
Alexander Afanasyev772f51b2013-08-01 18:53:25 -070035class Data;
Alexander Afanasyev73f06f62013-03-15 15:41:38 -070036
37typedef Interest InterestHeader;
Alexander Afanasyev772f51b2013-08-01 18:53:25 -070038typedef Data DataHeader;
Alexander Afanasyev73f06f62013-03-15 15:41:38 -070039
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070040class App;
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070041
Alexander Afanasyev98256102011-08-14 01:00:02 -070042/**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070043 * \ingroup ndn-face
44 * \brief Implementation of application Ndn face
Alexander Afanasyev98256102011-08-14 01:00:02 -070045 *
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070046 * This class defines basic functionality of Ndn face. Face is core
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070047 * component responsible for actual delivery of data packet to and
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070048 * from Ndn stack
Alexander Afanasyev98256102011-08-14 01:00:02 -070049 *
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070050 * \see AppFace, NdnNetDeviceFace, NdnIpv4Face, NdnUdpFace
Alexander Afanasyev98256102011-08-14 01:00:02 -070051 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070052class AppFace : public Face
Alexander Afanasyev98256102011-08-14 01:00:02 -070053{
54public:
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080055 static TypeId
56 GetTypeId ();
57
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070058 /**
59 * \brief Default constructor
60 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070061 AppFace (Ptr<App> app);
62 virtual ~AppFace();
Alexander Afanasyev98256102011-08-14 01:00:02 -070063
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070064 ////////////////////////////////////////////////////////////////////
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070065 // methods overloaded from Face
Alexander Afanasyev1c0248b2012-07-24 15:59:50 -070066 virtual bool
Alexander Afanasyevfaa01f92013-07-10 18:34:31 -070067 SendInterest (Ptr<const Interest> interest);
Alexander Afanasyev5bee19e2013-07-10 14:33:57 -070068
69 virtual bool
Alexander Afanasyev772f51b2013-08-01 18:53:25 -070070 SendData (Ptr<const Data> data);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080071
72public:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070073 virtual std::ostream&
74 Print (std::ostream &os) const;
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070075 ////////////////////////////////////////////////////////////////////
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070076
Alexander Afanasyev98256102011-08-14 01:00:02 -070077private:
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070078 AppFace ();
79 AppFace (const AppFace &); ///< \brief Disabled copy constructor
80 AppFace& operator= (const AppFace &); ///< \brief Disabled copy operator
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070081
82private:
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070083 Ptr<App> m_app;
Alexander Afanasyev98256102011-08-14 01:00:02 -070084};
85
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070086} // namespace ndn
Alexander Afanasyev98256102011-08-14 01:00:02 -070087} // namespace ns3
88
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070089#endif // NDN_APP_FACE_H