blob: 8855b751c659a2dcb6a08da1fedf9b6f2be5173f [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/*
3 * Copyright (c) 2005,2006,2007 INRIA
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 *
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 Afanasyev98256102011-08-14 01:00:02 -070022#ifndef CCNX_LOCAL_FACE_H
23#define CCNX_LOCAL_FACE_H
24
25#include "ccnx-face.h"
26
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070027namespace ns3
28{
Alexander Afanasyev98256102011-08-14 01:00:02 -070029
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070030class CcnxInterestHeader;
31class CcnxContentObjectHeader;
32class Packet;
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080033class CcnxApp;
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070034
Alexander Afanasyev98256102011-08-14 01:00:02 -070035/**
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070036 * \ingroup ccnx-face
37 * \brief Implementation of application CCNx face
Alexander Afanasyev98256102011-08-14 01:00:02 -070038 *
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070039 * This class defines basic functionality of CCNx face. Face is core
40 * component responsible for actual delivery of data packet to and
41 * from CCNx stack
Alexander Afanasyev98256102011-08-14 01:00:02 -070042 *
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070043 * \see CcnxLocalFace, CcnxNetDeviceFace, CcnxIpv4Face, CcnxUdpFace
Alexander Afanasyev98256102011-08-14 01:00:02 -070044 */
45class CcnxLocalFace : public CcnxFace
46{
47public:
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080048 static TypeId
49 GetTypeId ();
50
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070051 /**
52 * \brief Default constructor
53 */
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080054 CcnxLocalFace (Ptr<CcnxApp> app);
Alexander Afanasyev98256102011-08-14 01:00:02 -070055 virtual ~CcnxLocalFace();
Alexander Afanasyev98256102011-08-14 01:00:02 -070056
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070057 ////////////////////////////////////////////////////////////////////
58 // methods overloaded from CcnxFace
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070059 virtual void
60 RegisterProtocolHandler (ProtocolHandler handler);
Alexander Afanasyev98256102011-08-14 01:00:02 -070061
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080062protected:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070063 virtual void
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080064 SendImpl (Ptr<Packet> p);
65
66public:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070067 virtual std::ostream&
68 Print (std::ostream &os) const;
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070069 ////////////////////////////////////////////////////////////////////
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070070
Alexander Afanasyev98256102011-08-14 01:00:02 -070071private:
Alexander Afanasyev07827182011-12-13 01:07:32 -080072 CcnxLocalFace ();
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070073 CcnxLocalFace (const CcnxLocalFace &); ///< \brief Disabled copy constructor
74 CcnxLocalFace& operator= (const CcnxLocalFace &); ///< \brief Disabled copy operator
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070075
76private:
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080077 Ptr<CcnxApp> m_app;
Alexander Afanasyev98256102011-08-14 01:00:02 -070078};
79
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070080std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace);
Alexander Afanasyev98256102011-08-14 01:00:02 -070081
82} // namespace ns3
83
84#endif