blob: ea2a84b826deffb9f21adc77e2a3f30facbe6083 [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 Afanasyev56f79ea2011-08-17 23:54:27 -070040 .SetParent<CcnxFace> ()
Alexander Afanasyev98256102011-08-14 01:00:02 -070041 ;
42 return tid;
43}
44
Alexander Afanasyev98256102011-08-14 01:00:02 -070045CcnxLocalFace::CcnxLocalFace ()
46{
47 NS_LOG_FUNCTION (this);
48}
49
50CcnxLocalFace::~CcnxLocalFace ()
51{
52 NS_LOG_FUNCTION_NOARGS ();
53}
54
55void
56CcnxLocalFace::DoDispose (void)
57{
58 NS_LOG_FUNCTION_NOARGS ();
59 CcnxFace::DoDispose ();
60}
61
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070062void
63CcnxLocalFace::RegisterProtocolHandler (ProtocolHandler handler)
Alexander Afanasyev98256102011-08-14 01:00:02 -070064{
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070065 m_protocolHandler = handler;
Alexander Afanasyev98256102011-08-14 01:00:02 -070066}
67
Alexander Afanasyev98256102011-08-14 01:00:02 -070068void
69CcnxLocalFace::Send (Ptr<Packet> p)
70{
71 NS_LOG_FUNCTION (*p);
72 if (!IsUp ())
73 {
74 return;
75 }
76
77 // m_device->Send (p, m_device->GetBroadcast (),
78 // CcnxL3Protocol::PROT_NUMBER);
79}
80
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070081std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace)
Alexander Afanasyev98256102011-08-14 01:00:02 -070082{
83 os << "dev=local";
84 return os;
85}
86
87}; // namespace ns3
88