Alexander Afanasyev | c74a602 | 2011-08-15 20:01:35 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 2 | /* |
| 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 Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 24 | #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 | |
| 30 | NS_LOG_COMPONENT_DEFINE ("CcnxLocalFace"); |
| 31 | |
| 32 | namespace ns3 { |
| 33 | |
| 34 | NS_OBJECT_ENSURE_REGISTERED (CcnxLocalFace); |
| 35 | |
| 36 | TypeId |
| 37 | CcnxLocalFace::GetTypeId (void) |
| 38 | { |
| 39 | static TypeId tid = TypeId ("ns3::CcnxLocalFace") |
Alexander Afanasyev | 070aa48 | 2011-08-20 00:38:25 -0700 | [diff] [blame] | 40 | .SetGroupName ("Ccnx") |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 41 | .SetParent<CcnxFace> () |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 42 | ; |
| 43 | return tid; |
| 44 | } |
| 45 | |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 46 | CcnxLocalFace::CcnxLocalFace () |
| 47 | { |
| 48 | NS_LOG_FUNCTION (this); |
| 49 | } |
| 50 | |
| 51 | CcnxLocalFace::~CcnxLocalFace () |
| 52 | { |
| 53 | NS_LOG_FUNCTION_NOARGS (); |
| 54 | } |
| 55 | |
| 56 | void |
| 57 | CcnxLocalFace::DoDispose (void) |
| 58 | { |
| 59 | NS_LOG_FUNCTION_NOARGS (); |
| 60 | CcnxFace::DoDispose (); |
| 61 | } |
| 62 | |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 63 | void |
| 64 | CcnxLocalFace::RegisterProtocolHandler (ProtocolHandler handler) |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 65 | { |
Alexander Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 66 | m_protocolHandler = handler; |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 67 | } |
| 68 | |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 69 | void |
| 70 | CcnxLocalFace::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 Afanasyev | 56f79ea | 2011-08-17 23:54:27 -0700 | [diff] [blame] | 82 | std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace) |
Alexander Afanasyev | 9825610 | 2011-08-14 01:00:02 -0700 | [diff] [blame] | 83 | { |
| 84 | os << "dev=local"; |
| 85 | return os; |
| 86 | } |
| 87 | |
| 88 | }; // namespace ns3 |
| 89 | |