blob: 2e58705495c569fd544f4b16b4a63554a418c2a9 [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
34class InterestHeader;
35class ContentObjectHeader;
36class App;
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070037
Alexander Afanasyev98256102011-08-14 01:00:02 -070038/**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070039 * \ingroup ndn-face
40 * \brief Implementation of application Ndn face
Alexander Afanasyev98256102011-08-14 01:00:02 -070041 *
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070042 * This class defines basic functionality of Ndn face. Face is core
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070043 * component responsible for actual delivery of data packet to and
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070044 * from Ndn stack
Alexander Afanasyev98256102011-08-14 01:00:02 -070045 *
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070046 * \see AppFace, NdnNetDeviceFace, NdnIpv4Face, NdnUdpFace
Alexander Afanasyev98256102011-08-14 01:00:02 -070047 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070048class AppFace : public Face
Alexander Afanasyev98256102011-08-14 01:00:02 -070049{
50public:
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080051 static TypeId
52 GetTypeId ();
53
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070054 /**
55 * \brief Default constructor
56 */
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070057 AppFace (Ptr<App> app);
58 virtual ~AppFace();
Alexander Afanasyev98256102011-08-14 01:00:02 -070059
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070060 ////////////////////////////////////////////////////////////////////
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070061 // methods overloaded from Face
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070062 virtual void
63 RegisterProtocolHandler (ProtocolHandler handler);
Alexander Afanasyev98256102011-08-14 01:00:02 -070064
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080065protected:
Alexander Afanasyev1c0248b2012-07-24 15:59:50 -070066 virtual bool
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080067 SendImpl (Ptr<Packet> p);
68
69public:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070070 virtual std::ostream&
71 Print (std::ostream &os) const;
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070072 ////////////////////////////////////////////////////////////////////
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070073
Alexander Afanasyev98256102011-08-14 01:00:02 -070074private:
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070075 AppFace ();
76 AppFace (const AppFace &); ///< \brief Disabled copy constructor
77 AppFace& operator= (const AppFace &); ///< \brief Disabled copy operator
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070078
79private:
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070080 Ptr<App> m_app;
Alexander Afanasyev98256102011-08-14 01:00:02 -070081};
82
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070083} // namespace ndn
Alexander Afanasyev98256102011-08-14 01:00:02 -070084} // namespace ns3
85
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070086#endif // NDN_APP_FACE_H