blob: 80b0b52407f4e336e030b2d68355a5b1eee683a6 [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 *
18 * Author:
19 *
20 */
21
22#include "ccnx-local-face.h"
23
Alexander Afanasyev98256102011-08-14 01:00:02 -070024#include "ns3/log.h"
25#include "ns3/packet.h"
26#include "ns3/node.h"
27#include "ns3/pointer.h"
28#include "ns3/assert.h"
29
30NS_LOG_COMPONENT_DEFINE ("CcnxLocalFace");
31
32namespace ns3 {
33
34NS_OBJECT_ENSURE_REGISTERED (CcnxLocalFace);
35
36TypeId
37CcnxLocalFace::GetTypeId (void)
38{
39 static TypeId tid = TypeId ("ns3::CcnxLocalFace")
Alexander Afanasyev070aa482011-08-20 00:38:25 -070040 .SetGroupName ("Ccnx")
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070041 .SetParent<CcnxFace> ()
Alexander Afanasyev98256102011-08-14 01:00:02 -070042 ;
43 return tid;
44}
45
Alexander Afanasyev98256102011-08-14 01:00:02 -070046CcnxLocalFace::CcnxLocalFace ()
47{
48 NS_LOG_FUNCTION (this);
49}
50
51CcnxLocalFace::~CcnxLocalFace ()
52{
53 NS_LOG_FUNCTION_NOARGS ();
54}
55
56void
57CcnxLocalFace::DoDispose (void)
58{
59 NS_LOG_FUNCTION_NOARGS ();
60 CcnxFace::DoDispose ();
61}
62
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070063void
64CcnxLocalFace::RegisterProtocolHandler (ProtocolHandler handler)
Alexander Afanasyev98256102011-08-14 01:00:02 -070065{
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070066 m_protocolHandler = handler;
Alexander Afanasyev98256102011-08-14 01:00:02 -070067}
68
Alexander Afanasyev98256102011-08-14 01:00:02 -070069void
70CcnxLocalFace::Send (Ptr<Packet> p)
71{
72 NS_LOG_FUNCTION (*p);
73 if (!IsUp ())
74 {
75 return;
76 }
77
78 // m_device->Send (p, m_device->GetBroadcast (),
79 // CcnxL3Protocol::PROT_NUMBER);
80}
81
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070082std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace)
Alexander Afanasyev98256102011-08-14 01:00:02 -070083{
84 os << "dev=local";
85 return os;
86}
87
88}; // namespace ns3
89