blob: b1d54783943c2078b3d89891e2e257317588a04f [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 Afanasyev98256102011-08-14 01:00:02 -070022#ifndef CCNX_LOCAL_FACE_H
23#define CCNX_LOCAL_FACE_H
24
25#include "ccnx-face.h"
Ilya Moiseenko1a8be032012-01-18 12:51:09 -080026#include "ns3/traced-callback.h"
27#include "ccnx-path-stretch-tag.h"
Alexander Afanasyev98256102011-08-14 01:00:02 -070028
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070029namespace ns3
30{
Alexander Afanasyev98256102011-08-14 01:00:02 -070031
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070032class CcnxInterestHeader;
33class CcnxContentObjectHeader;
34class Packet;
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080035class CcnxApp;
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070036
Alexander Afanasyev98256102011-08-14 01:00:02 -070037/**
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070038 * \ingroup ccnx-face
39 * \brief Implementation of application CCNx face
Alexander Afanasyev98256102011-08-14 01:00:02 -070040 *
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070041 * This class defines basic functionality of CCNx face. Face is core
42 * component responsible for actual delivery of data packet to and
43 * from CCNx stack
Alexander Afanasyev98256102011-08-14 01:00:02 -070044 *
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070045 * \see CcnxLocalFace, CcnxNetDeviceFace, CcnxIpv4Face, CcnxUdpFace
Alexander Afanasyev98256102011-08-14 01:00:02 -070046 */
47class CcnxLocalFace : public CcnxFace
48{
49public:
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080050 static TypeId
51 GetTypeId ();
52
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070053 /**
54 * \brief Default constructor
55 */
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080056 CcnxLocalFace (Ptr<CcnxApp> app);
Alexander Afanasyev98256102011-08-14 01:00:02 -070057 virtual ~CcnxLocalFace();
Alexander Afanasyev98256102011-08-14 01:00:02 -070058
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070059 ////////////////////////////////////////////////////////////////////
60 // methods overloaded from CcnxFace
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070061 virtual void
62 RegisterProtocolHandler (ProtocolHandler handler);
Alexander Afanasyev98256102011-08-14 01:00:02 -070063
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080064protected:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070065 virtual void
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080066 SendImpl (Ptr<Packet> p);
67
68public:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070069 virtual std::ostream&
70 Print (std::ostream &os) const;
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070071 ////////////////////////////////////////////////////////////////////
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070072
Alexander Afanasyev98256102011-08-14 01:00:02 -070073private:
Alexander Afanasyev07827182011-12-13 01:07:32 -080074 CcnxLocalFace ();
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070075 CcnxLocalFace (const CcnxLocalFace &); ///< \brief Disabled copy constructor
76 CcnxLocalFace& operator= (const CcnxLocalFace &); ///< \brief Disabled copy operator
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070077
78private:
Alexander Afanasyev19426ef2011-11-23 20:55:28 -080079 Ptr<CcnxApp> m_app;
Ilya Moiseenko1a8be032012-01-18 12:51:09 -080080
81 TracedCallback<WeightsPathStretchTag,Ptr<const CcnxInterestHeader>,
82 Ptr<CcnxApp> > m_receivedPathStretchTags;
Alexander Afanasyev98256102011-08-14 01:00:02 -070083};
84
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070085std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace);
Alexander Afanasyev98256102011-08-14 01:00:02 -070086
87} // namespace ns3
88
89#endif