NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ndn-fib.cc
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19  */
20 
21 #include "ndn-fib.h"
22 
23 #include "ns3/node.h"
24 #include "ns3/names.h"
25 
26 namespace ns3 {
27 namespace ndn {
28 
29 TypeId
31 {
32  static TypeId tid = TypeId ("ns3::ndn::Fib") // cheating ns3 object system
33  .SetParent<Object> ()
34  .SetGroupName ("Ndn")
35  ;
36  return tid;
37 }
38 
39 std::ostream&
40 operator<< (std::ostream& os, const Fib &fib)
41 {
42  os << "Node " << Names::FindName (fib.GetObject<Node>()) << "\n";
43  os << " Dest prefix Interfaces(Costs) \n";
44  os << "+-------------+--------------------------------------+\n";
45 
46  fib.Print (os);
47  return os;
48 }
49 
50 } // namespace ndn
51 } // namespace ns3
static TypeId GetTypeId()
Interface ID.
Definition: ndn-fib.cc:30
virtual void Print(std::ostream &os) const =0
Print out entries in FIB.
Class implementing FIB functionality.
Definition: ndn-fib.h:44