diff --git a/apps/ccnx-interest-sender.cc b/apps/ccnx-interest-sender.cc
index 239d7cb..c3ecc59 100644
--- a/apps/ccnx-interest-sender.cc
+++ b/apps/ccnx-interest-sender.cc
@@ -41,14 +41,10 @@
                    PointerValue (CreateObject<CcnxLocalFace> ()),
                    MakePointerAccessor (&CcnxInterestSender::m_face),
                    MakePointerChecker<CcnxLocalFace> ())
-    /*.AddAttribute ("NameComponents","CcnxName of the Interest (use CcnxNameComponents)",
-                   CcnxNameComponentsValue(CcnxNameComponents()),
-                   MakeCcnxNameComponentsAccessor(&CcnxInterestSender::m_interestName),
-                   MakeCcnxNameComponentsChecker())*/
-    .AddAttribute ("InterestName","CcnxName of the Interest (use CcnxNameComponents)",
-                   PointerValue (CreateObject<CcnxNameComponents> ()),
-                   MakePointerAccessor (&CcnxInterestSender::m_interestName),
-                   MakePointerChecker<CcnxNameComponents> ())
+    .AddAttribute ("NameComponents","CcnxName of the Interest (use CcnxNameComponents)",
+                   CcnxNameComponentsValue (CcnxNameComponents (/* root */)),
+                   MakeCcnxNameComponentsAccessor (&CcnxInterestSender::m_interestName),
+                   MakeCcnxNameComponentsChecker ())
     .AddAttribute ("LifeTime", "LifeTime fo interest packet",
                    TimeValue (Seconds (4.0)),
                    MakeTimeAccessor (&CcnxInterestSender::m_interestLifeTime),
@@ -65,14 +61,10 @@
                    BooleanValue(false),
                    MakeBooleanAccessor(&CcnxInterestSender::m_childSelector),
                    MakeBooleanChecker())
-    /*.AddAttribute ("Exclude","only simple name matching is supported (use CcnxNameComponents)",
-                   CcnxNameComponentsValue(CcnxNameComponents()),
-                   MakeCcnxNameComponentsAccessor(&CcnxInterestSender::m_exclude),
-                   MakeCcnxNameComponentsChecker())*/
-    .AddAttribute ("Exclude", "only simple name matching is supported (use CcnxNameComponents)",
-                   PointerValue (CreateObject<CcnxNameComponents> ()),
-                   MakePointerAccessor (&CcnxInterestSender::m_exclude),
-                   MakePointerChecker<CcnxNameComponents> ())
+    .AddAttribute ("Exclude","only simple name matching is supported (use CcnxNameComponents)",
+                   CcnxNameComponentsValue (CcnxNameComponents(/* root */)),
+                   MakeCcnxNameComponentsAccessor (&CcnxInterestSender::m_exclude),
+                   MakeCcnxNameComponentsChecker ())
     .AddAttribute ("Initial Nonce", "If 0 then nonce is not used",
                    UintegerValue(1),
                    MakeUintegerAccessor(&CcnxInterestSender::m_initialNonce),
@@ -142,17 +134,17 @@
 CcnxInterestSender::SendPacket ()
 {
     NS_LOG_FUNCTION_NOARGS ();
-    NS_LOG_INFO ("Sending Interest at " << Simulator::Now ());
+    // NS_LOG_INFO ("Sending Interest at " << Simulator::Now ());
     
     uint32_t randomNonce = UniformVariable().GetInteger(1, std::numeric_limits<uint32_t>::max ());
     CcnxInterestHeader interestHeader;
     interestHeader.SetNonce(randomNonce);
     //const Ptr<CcnxNameComponents> name = Create<CcnxNameComponents>(m_interestName);
-    interestHeader.SetName(m_interestName);
+    interestHeader.SetName(Create<CcnxNameComponents> (m_interestName)); //making a copy of name
     interestHeader.SetInterestLifetime(m_interestLifeTime);
     interestHeader.SetChildSelector(m_childSelector);
     //const Ptr<CcnxNameComponents> exclude = Create<CcnxNameComponents>(m_exclude);
-    interestHeader.SetExclude(m_exclude);
+    interestHeader.SetExclude(Create<CcnxNameComponents> (m_exclude));
     interestHeader.SetMaxSuffixComponents(m_maxSuffixComponents);
     interestHeader.SetMinSuffixComponents(m_minSuffixComponents);
     
diff --git a/apps/ccnx-interest-sender.h b/apps/ccnx-interest-sender.h
index 865841a..256edd8 100644
--- a/apps/ccnx-interest-sender.h
+++ b/apps/ccnx-interest-sender.h
@@ -59,12 +59,13 @@
         
     //Time m_onTime;
     Time m_offTime;
-    Ptr<CcnxNameComponents> m_interestName;
+    CcnxNameComponents m_interestName;
+  
     Time m_interestLifeTime;
     int32_t m_minSuffixComponents;
     int32_t m_maxSuffixComponents;
     bool m_childSelector;
-    Ptr<CcnxNameComponents> m_exclude;
+    CcnxNameComponents m_exclude;
     uint32_t m_initialNonce;
     
     //EventId         m_startStopEvent;     // Event id for next start or stop event
diff --git a/helper/ccnx-interest-sender-helper.cc b/helper/ccnx-interest-sender-helper.cc
index 0ae1f6d..addd9de 100644
--- a/helper/ccnx-interest-sender-helper.cc
+++ b/helper/ccnx-interest-sender-helper.cc
@@ -30,7 +30,7 @@
 CcnxInterestSenderHelper::CcnxInterestSenderHelper (Ptr<CcnxNameComponents> interestName)
 {
     m_factory.SetTypeId ("ns3::CcnxConsumer");
-    m_factory.Set ("InterestName", PointerValue (interestName));
+    m_factory.Set ("InterestName", CcnxNameComponentsValue (*interestName));
 }
     
 void 
diff --git a/model/ccnx-face.cc b/model/ccnx-face.cc
index 3250355..d672f07 100644
--- a/model/ccnx-face.cc
+++ b/model/ccnx-face.cc
@@ -23,6 +23,7 @@
 
 #include "ns3/log.h"
 #include "ns3/node.h"
+#include "ns3/assert.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxFace");
 
@@ -133,8 +134,17 @@
 bool
 CcnxFace::operator== (const CcnxFace &face) const
 {
-  return (m_node->GetId () == face.m_node->GetId ()) &&
-    (m_id == face.m_id);
+  NS_ASSERT_MSG (m_node->GetId () == face.m_node->GetId (), "Faces of different nodes should not be compared to each other");
+
+  return (m_id == face.m_id);
+}
+
+bool
+CcnxFace::operator< (const CcnxFace &face) const
+{
+  NS_ASSERT_MSG (m_node->GetId () == face.m_node->GetId (), "Faces of different nodes should not be compared to each other");
+
+  return (m_id < face.m_id);
 }
 
 std::ostream& operator<< (std::ostream& os, const CcnxFace &face)
diff --git a/model/ccnx-face.h b/model/ccnx-face.h
index 4370ab9..a1ef3e0 100644
--- a/model/ccnx-face.h
+++ b/model/ccnx-face.h
@@ -155,8 +155,21 @@
   inline uint32_t
   GetId () const;
 
+  /**
+   * \brief Compare two faces. Only two faces on the same node could be compared.
+   *
+   * Internal index is used for comparison.
+   */
   bool
   operator== (const CcnxFace &face) const;
+
+  /**
+   * \brief Compare two faces. Only two faces on the same node could be compared.
+   *
+   * Internal index is used for comparison.
+   */
+  bool
+  operator< (const CcnxFace &face) const;
   
 protected:
   virtual void DoDispose (void);
diff --git a/model/ccnx-fib.cc b/model/ccnx-fib.cc
new file mode 100644
index 0000000..fa972a0
--- /dev/null
+++ b/model/ccnx-fib.cc
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-fib.h"
+
+#include "ccnx.h"
+#include "ccnx-face.h"
+#include "ccnx-interest-header.h"
+
+#include "ns3/node.h"
+
+//#define NDN_DEBUG_OSPF	0
+//#define NDN_DEBUG_OSPF_NODES 0
+
+//#define NDN_DUMP_FIB		0
+namespace ns3 {
+
+
+//////////////////////////////////////////////////////////////////////
+// Helpers
+//////////////////////////////////////////////////////////////////////
+namespace __ccnx_private_fib {
+
+struct CcnxFibFaceMetricByFace
+{
+  typedef CcnxFibFaceMetricContainer::type::index<i_face>::type
+  type;
+};
+
+struct ChangeStatus
+{
+  ChangeStatus (uint8_t status) : m_status (status) { }
+  void operator() (CcnxFibFaceMetric &entry)
+  {
+    entry.m_status = m_status;
+  }
+private:
+  uint8_t m_status;
+};
+
+
+struct SearchByFace {
+  /**
+   * \brief To perform effective searches by CcnxFace
+   */
+  bool
+  operator() (const CcnxFibFaceMetric &m, const Ptr<CcnxFace> &face) const
+  {
+    return *(m.m_face) < *face;
+  } 
+
+  /**
+   * \brief To perform effective searches by CcnxFace
+   */
+  bool
+  operator() (const Ptr<CcnxFace> &face, const CcnxFibFaceMetric &m) const
+  {
+    return *face < *(m.m_face);
+  } 
+};
+
+}
+//////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+using namespace __ccnx_private_fib;
+
+void
+CcnxFibEntry::UpdateStatus (Ptr<CcnxFace> face, uint8_t status)
+{
+  CcnxFibFaceMetricByFace::type::iterator record = m_faces.get<i_face> ().find (face, SearchByFace());
+  NS_ASSERT_MSG (record != m_faces.get<i_face> ().end (), "Update status can be performed only on existing faces of CcxnFibEntry");
+
+  m_faces.modify (record, ChangeStatus (status));
+
+  // reordering random access index same way as by metric index
+  m_faces.get<i_nth> ().rearrange (m_faces.get<i_metric> ().begin ());
+}
+
+
+Ptr<CcnxFace>
+CcnxFibEntry::FindBestCandidate (int skip/* = 0*/)
+{
+  skip = skip % m_faces.size();
+  return m_faces.get<i_nth> () [skip].GetFace ();
+}
+
+
+CcnxFib::CcnxFib (Ptr<Ccnx> node)
+  : m_node (node)
+{
+}
+
+std::pair<CcnxFibEntryContainer::type::iterator, bool>
+CcnxFib::LongestPrefixMatch (const CcnxInterestHeader &interest) const
+{
+  const CcnxNameComponents &name = interest.GetName ();
+  for (size_t componentsCount = name.GetComponents ().size ();
+       componentsCount > 0;
+       componentsCount--)
+    {
+      CcnxNameComponents subPrefix (name.GetSubComponents (componentsCount));
+      CcnxFibEntryContainer::type::iterator match = m_fib.find (subPrefix);
+      if (match != m_fib.end())
+        return std::pair<CcnxFibEntryContainer::type::iterator, bool> (match,true);
+    }
+  
+  return std::pair<CcnxFibEntryContainer::type::iterator, bool> (m_fib.end(),false);
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFib &fib)
+{
+  os << "Node " << fib.m_node->GetObject<Node> ()->GetId () << "\n";
+  os << "  Dest prefix      Interfaces(Costs)                  \n";
+  os << "+-------------+--------------------------------------+\n";
+  
+  for (CcnxFibEntryContainer::type::iterator entry = fib.m_fib.begin ();
+       entry != fib.m_fib.end ();
+       entry++)
+    {
+      os << *entry << "\n";
+    }
+  return os;
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry)
+{
+  os << entry.m_prefix << "\t";
+  for (CcnxFibFaceMetricByFace::type::iterator metric = entry.m_faces.get<i_face> ().begin ();
+       metric != entry.m_faces.get<i_face> ().end ();
+       metric++)
+    {
+      if (metric != entry.m_faces.get<i_face> ().begin ())
+        os << ", ";
+
+      os << *metric;
+    }
+  return os;
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric)
+{
+  static const std::string statusString[] = {"","g","y","r"};
+  NS_ASSERT_MSG (1<=metric.m_status && metric.m_status<=3, "Status can be only GREEN, YELLOW, or RED");
+
+  os << metric.m_face << "(" << metric.m_routingCost << ","<< statusString [metric.m_status] << ")";
+  return os;
+}
+
+// void CcnxFib::resetProbing()
+// {
+//     for(FibRangeIterator fib = _fib.begin(); fib != _fib.end(); fib++)
+//         VALUE(fib).needsProbing = true;
+// }
+
+// void CcnxFib::updateInterfaceStatus( int interface, int status )
+// {
+// 	for( FibRangeIterator fib = _fib.begin(); fib!=_fib.end(); fib++ )
+// 	{
+// 		VALUE(fib).updateStatus( interface, status );
+// 	}
+// }
+
+} // namespace ns3
diff --git a/model/ccnx-fib.h b/model/ccnx-fib.h
new file mode 100644
index 0000000..bc559c6
--- /dev/null
+++ b/model/ccnx-fib.h
@@ -0,0 +1,298 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_FIB_H_
+#define	_CCNX_FIB_H_
+
+#include "hash-helper.h"
+#include "ccnx-face.h"
+#include "ns3/nstime.h"
+#include "ns3/simple-ref-count.h"
+
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/tag.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/composite_key.hpp>
+#include <boost/multi_index/hashed_index.hpp>
+#include <boost/multi_index/random_access_index.hpp>
+#include <boost/multi_index/member.hpp>
+#include <boost/multi_index/mem_fun.hpp>
+
+#include <iostream>
+
+namespace ns3 {
+
+namespace __ccnx_private_fib
+{
+const uint8_t NDN_FIB_GREEN = 1; ///< \brief 
+const uint8_t NDN_FIB_YELLOW = 2;
+const uint8_t NDN_FIB_RED = 3;
+
+class i_face {};
+class i_metric {};
+class i_nth {};
+class i_prefix {};
+}
+
+class Ccnx;
+class CcnxInterestHeader;
+
+/**
+ * \ingroup ccnx
+ * \brief Structure holding various parameters associated with a (FibEntry, Face) tuple
+ */
+class CcnxFibFaceMetric
+{
+public:
+  /**
+   * \brief Metric constructor
+   *
+   * \param face Face for which metric
+   * \param cost Initial value for routing cost
+   */
+  CcnxFibFaceMetric (Ptr<CcnxFace> face, int cost)
+    : m_face (face)
+    , m_status (__ccnx_private_fib::NDN_FIB_YELLOW)
+    , m_routingCost (cost)
+    , m_sRtt   (Seconds (0))
+    , m_rttVar (Seconds (0))
+  { }
+
+  /**
+   * \brief Comparison operator used by boost::multi_index::identity<>
+   */
+  bool
+  operator< (const CcnxFibFaceMetric &m) const { return *m_face < *(m.m_face); } // return identity of the face
+
+  Ptr<CcnxFace>
+  GetFace () const { return m_face; }
+  
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+public:
+  Ptr<CcnxFace> m_face; ///< Face
+  
+  uint8_t m_status;		///< \brief Status of the next hop: 
+						///<		- #__ccnx_private_fib::NDN_FIB_GREEN
+						///<		- #__ccnx_private_fib::NDN_FIB_YELLOW
+						///<		- #__ccnx_private_fib::NDN_FIB_RED
+  
+  uint32_t m_routingCost; ///< \brief routing protocol cost (interpretation of the value depends on the underlying routing protocol)
+
+  Time m_sRtt;         ///< \brief smoothed round-trip time
+  Time m_rttVar;       ///< \brief round-trip time variation
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed face container of CcnxFibEntry
+ *
+ * Currently, there are 2 indexes:
+ * - by face (used to find record and update metric)
+ * - by metric (face ranking)
+ * - random access index (for fast lookup on nth face). Order is
+ *   maintained manually to be equal to the 'by metric' order
+ */
+struct CcnxFibFaceMetricContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxFibFaceMetric,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::ordered_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_face>,
+        boost::multi_index::identity<CcnxFibFaceMetric>
+      >,
+
+      // List of available faces ordered by (status, m_routingCost)
+      boost::multi_index::ordered_non_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_metric>,
+        boost::multi_index::composite_key<
+          CcnxFibFaceMetric,
+          boost::multi_index::member<CcnxFibFaceMetric,uint8_t,&CcnxFibFaceMetric::m_status>,
+          boost::multi_index::member<CcnxFibFaceMetric,uint32_t,&CcnxFibFaceMetric::m_routingCost>
+        >
+      >,
+
+      // To optimize nth candidate selection (sacrifice a little bit space to gain speed)
+      boost::multi_index::random_access<
+        boost::multi_index::tag<__ccnx_private_fib::i_nth>
+      >
+    >
+   > type;
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Structure for FIB table entry, holding indexed list of
+ *        available faces and their respective metrics
+ */
+class CcnxFibEntry : public SimpleRefCount<CcnxFibEntry>
+{
+public:
+  /**
+   * \brief Constructor
+   * \param prefix Prefix for the FIB entry
+   */
+  CcnxFibEntry (Ptr<CcnxNameComponents> prefix)
+    : m_prefix (prefix)
+    , m_needsProbing (false)
+  { }
+	
+  /**
+   * \brief Update status of FIB next hop
+   */
+  void
+  UpdateStatus (Ptr<CcnxFace> face, uint8_t status);
+
+  /**
+   * \brief Get prefix for the FIB entry
+   */
+  const CcnxNameComponents&
+  GetPrefix () const { return *m_prefix; }
+
+  /**
+   * \brief Find "best route" candidate, skipping `skip' first candidates (modulo # of faces)
+   */
+  Ptr<CcnxFace>
+  FindBestCandidate (int skip = 0);
+	
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry);
+
+private:
+  Ptr<CcnxNameComponents> m_prefix; ///< \brief Prefix of the FIB entry
+  CcnxFibFaceMetricContainer::type m_faces; ///< \brief Indexed list of faces
+
+  bool m_needsProbing;      ///< \brief flag indicating that probing should be performed 
+};
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed container for FIB entries
+ *
+ * Currently, there is only one index
+ * - by prefix hash, which is used to perform prefix match
+ */
+struct CcnxFibEntryContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxFibEntry,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::hashed_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_prefix>,
+        boost::multi_index::const_mem_fun<CcnxFibEntry,
+                                          const CcnxNameComponents&,
+                                          &CcnxFibEntry::GetPrefix>,
+        CcnxPrefixHash>
+
+      // other indexes?
+    >
+  > type;
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Class implementing FIB functionality
+ */
+class CcnxFib
+{
+public:
+  /**
+   * \brief Constructor
+   * \param node smart pointer to Ccnx stack associated with particular node
+   */
+  CcnxFib (Ptr<Ccnx> node);
+
+  // // Invalidate entries in FIB
+  // // Will leave FIB records in hash, but assign metric=NETWORK_UNREACHABLE
+  // void invalidate( );
+
+  // //Find corresponding FIB entry for the given content name
+  // //Longest match is performed
+  // FibIterator lookup( const string &name );
+  // bool isValid( const FibIterator &it ) { return it!=_fib.end(); }
+
+  /**
+   * \brief Perform longest prefix match
+   *
+   * \todo Implement exclude filters
+   *
+   * \param interest Interest packet header
+   * \returns If entry found a pair <valid_iterator, true> will be returned, otherwise <invalid_iterator, false>
+   */
+  std::pair<CcnxFibEntryContainer::type::iterator, bool>
+  LongestPrefixMatch (const CcnxInterestHeader &interest) const;
+  
+  /**
+   * Update FIB entry
+   * If the entry exists, metric will be updated. Otherwise, new entry will be created
+   *
+   * Entries in FIB never deleted. They can be invalidated with metric==NETWORK_UNREACHABLE
+   *
+   * @param name				Prefix
+   * @param interfaceIndex	Forwarding interface
+   * @param metric			Routing metric
+   * @param nextHop			Nexthop node address (IPv4)
+   * @return true if a new entry created, false otherwise
+   */
+  // bool update( const string &name, int interfaceIndex, int metric, NodeAddress nextHop );
+  // bool update( NodeAddress nodeId, int interfaceIndex, int metric, NodeAddress nextHop );
+  // Bool update( NodeAddress nodeId, int metric, NodeAddress nextHop );
+
+  // // Update Fib from OSPF routing table (through a hack in OSPF algorithm)
+  // void updateFibFromOSPFv2( int interface );
+
+  // // Update Fib from BGP routing table (using info from RibIn)
+  // void updateFibFromBGP( );
+
+  // // Update Fib from IP routing table
+  // void updateFibFromIpRouting( );
+
+  // // Update the status for all FIB records for the specified interface
+  // void updateInterfaceStatus( int interface, int status );
+
+  // void dump( );
+  // void dump( const FibIterator &fib );
+
+  // void resetProbing();    //reset needsProbing field for every FibEntry
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFib &fib);
+
+private:
+  Ptr<Ccnx> m_node;
+
+  CcnxFibEntryContainer::type m_fib;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+std::ostream& operator<< (std::ostream& os, const CcnxFib &fib);
+std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry);
+std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+ 
+} // namespace ns3
+
+#endif	/* NDN_FIB_H */
diff --git a/model/ccnx-local-face.cc b/model/ccnx-local-face.cc
index 36cad40..c047934 100644
--- a/model/ccnx-local-face.cc
+++ b/model/ccnx-local-face.cc
@@ -77,8 +77,7 @@
       return;
     }
 
-  // m_device->Send (p, m_device->GetBroadcast (), 
-  //                 CcnxL3Protocol::PROT_NUMBER);
+  
 }
     
 void
diff --git a/model/ccnx-name-components.cc b/model/ccnx-name-components.cc
index 18e7ea2..303e987 100644
--- a/model/ccnx-name-components.cc
+++ b/model/ccnx-name-components.cc
@@ -19,6 +19,7 @@
  */
 
 #include "ccnx-name-components.h"
+#include <boost/foreach.hpp>
 
 #include <iostream>
 
@@ -26,31 +27,45 @@
 
 namespace ns3 {
 
-CcnxNameComponents::CcnxNameComponents ()
+ATTRIBUTE_HELPER_CPP (CcnxNameComponents);
+
+CcnxNameComponents::CcnxNameComponents (/* root */)
 {
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
 }
 
 CcnxNameComponents::CcnxNameComponents (const string &s)
 {
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
-  // (*this) (s);
   m_prefix.push_back (s);
 }
 
-CcnxNameComponents::~CcnxNameComponents ()
+CcnxNameComponents::CcnxNameComponents (const std::list<boost::reference_wrapper<const std::string> > &components)
 {
-  // ccn_charbuf_destroy(&m_value);
+  BOOST_FOREACH (const boost::reference_wrapper<const std::string> &component, components)
+    {
+      Add (component.get ());
+    }
 }
-
+  
 const std::list<std::string> &
 CcnxNameComponents::GetComponents () const
 {
   return m_prefix;
 }
 
+std::list<boost::reference_wrapper<const std::string> >
+CcnxNameComponents::GetSubComponents (size_t num) const
+{
+  NS_ASSERT_MSG (1<=num && num<=m_prefix.size (), "Invalid number of subcomponents requested");
+  
+  std::list<boost::reference_wrapper<const std::string> > subComponents;
+  std::list<std::string>::const_iterator component = m_prefix.begin();
+  for (size_t i=0; i<num; i++, component++)
+    {
+      subComponents.push_back (boost::ref (*component));
+    }
+    
+  return subComponents;
+}
   
 // const ccn_charbuf*
 // Components::GetName () const
@@ -86,5 +101,27 @@
   components.Print (os);
   return os;
 }
+
+std::istream &
+operator >> (std::istream &is, CcnxNameComponents &components)
+{
+  istream_iterator<char> eos; // end of stream
+
+  std::string component = "";
+  for (istream_iterator<char> it (is); it != eos; it++)
+    {
+      if (*it == '/')
+        {
+          if (component != "")
+            components.Add (component);
+          component = "";
+        }
+      else
+        component.push_back (*it);
+    }
+
+  return is;
+}
+
 }
 
diff --git a/model/ccnx-name-components.h b/model/ccnx-name-components.h
index 55cd5ae..7e2bb71 100644
--- a/model/ccnx-name-components.h
+++ b/model/ccnx-name-components.h
@@ -30,15 +30,19 @@
 #include <list>
 #include "ns3/object.h"
 
+#include <boost/ref.hpp>
+
 namespace ns3 {
 
-class CcnxNameComponents : public Object
-
+class CcnxNameComponents : public SimpleRefCount<CcnxNameComponents>
 {
 public:
+  /**
+   * \brief Creates a prefix with zero components (can be looked as root "/")
+   */
   CcnxNameComponents ();
   CcnxNameComponents (const std::string &s);
-  ~CcnxNameComponents ();
+  CcnxNameComponents (const std::list<boost::reference_wrapper<const std::string> > &components);
   
   inline void
   Add (const std::string &s);
@@ -48,6 +52,13 @@
 
   const std::list<std::string> &
   GetComponents () const;
+
+  /**
+   * \brief Get subcomponents of the name, starting with first component
+   * \param num Number of components to return. Valid value is in range [1, GetComponents ().size ()]
+   */
+  std::list<boost::reference_wrapper<const std::string> >
+  GetSubComponents (size_t num) const;
   
   // virtual uint32_t
   // GetSerializedSize (void) const;
@@ -76,8 +87,22 @@
   typedef std::list<std::string>::const_iterator const_iterator;
 };
 
-std::ostream & operator << (std::ostream &os, const CcnxNameComponents &components);
+/**
+ * \brief Print out name components separated by slashes, e.g., /first/second/third
+ */
+std::ostream &
+operator << (std::ostream &os, const CcnxNameComponents &components);
 
+/**
+ * \brief Read components from input and add them to components. Will read input stream till eof
+ *
+ * \todo Check that NS-3 doesn't give unlimited input streams... Otherwise it would be disaster
+ *
+ * Substrings separated by slashes will become separate components
+ */
+std::istream &
+operator >> (std::istream &is, CcnxNameComponents &components);
+  
 size_t
 CcnxNameComponents::size () const
 {
@@ -111,9 +136,7 @@
 * \class ns3::ComponentsValue
 * \brief hold objects of type ns3:CcnxNameComponents
 */
-ATTRIBUTE_VALUE_DEFINE (CcnxNameComponents);
-ATTRIBUTE_ACCESSOR_DEFINE (CcnxNameComponents);
-ATTRIBUTE_CHECKER_DEFINE (CcnxNameComponents);
+ATTRIBUTE_HELPER_HEADER (CcnxNameComponents);
 } // namespace ns3
 
 #endif // _NDN_NAME_COMPONENTS_H_
diff --git a/model/ccnx-pit-entry-incoming-face.cc b/model/ccnx-pit-entry-incoming-face.cc
new file mode 100644
index 0000000..0c65549
--- /dev/null
+++ b/model/ccnx-pit-entry-incoming-face.cc
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-pit-entry-incoming-face.h"
+
+#include "ns3/simulator.h"
+
+namespace ns3 {
+
+CcnxPitEntryIncomingFace::CcnxPitEntryIncomingFace (Ptr<CcnxFace> face)
+  : m_face (face)
+  , m_arrivalTime (Simulator::Now ())
+  // , m_nonce (nonce)
+{
+}
+
+} // namespace ns3
diff --git a/model/ccnx-pit-entry-incoming-face.h b/model/ccnx-pit-entry-incoming-face.h
new file mode 100644
index 0000000..80f7e09
--- /dev/null
+++ b/model/ccnx-pit-entry-incoming-face.h
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_PIT_ENTRY_INCOMING_FACE_H_
+#define	_CCNX_PIT_ENTRY_INCOMING_FACE_H_
+
+#include "ns3/nstime.h"
+#include "ns3/ptr.h"
+
+#include "ccnx-face.h"
+// #include <iostream>
+
+namespace ns3 {
+
+/**
+ * \ingroup ccnx
+ * \brief PIT state component for each incoming interest (not including duplicates)
+ */
+struct CcnxPitEntryIncomingFace
+{
+  Ptr<CcnxFace> m_face; ///< \brief face of the incoming Interest
+  Time m_arrivalTime;   ///< \brief arrival time of the incoming Interest
+
+public:
+  /**
+   * \brief Constructor
+   * \param face face of the incoming interest
+   * \param lifetime lifetime of the incoming interest
+   */
+  CcnxPitEntryIncomingFace (Ptr<CcnxFace> face);
+
+  bool operator== (const CcnxPitEntryIncomingFace &dst) { return *m_face==*(dst.m_face); }
+  bool operator== (Ptr<CcnxFace> face) { return *m_face==*face; }
+
+  /**
+   * \brief Comparison operator used by boost::multi_index::identity<>
+   */
+  bool
+  operator< (const CcnxPitEntryIncomingFace &m) const { return *m_face < *(m.m_face); } // return identity of the face
+};
+
+
+} // namespace ns3
+
+#endif	/* CCNX_PIT_ENTRY_INCOMING_FACE_H */
diff --git a/model/ccnx-pit-entry-outgoing-face.cc b/model/ccnx-pit-entry-outgoing-face.cc
new file mode 100644
index 0000000..c15df71
--- /dev/null
+++ b/model/ccnx-pit-entry-outgoing-face.cc
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-pit-entry-outgoing-face.h"
+
+#include "ns3/simulator.h"
+
+namespace ns3 {
+
+CcnxPitEntryOutgoingFace::CcnxPitEntryOutgoingFace (Ptr<CcnxFace> face)
+  : m_face (face)
+  , m_sendTime (Simulator::Now ())
+  // , m_retxNum (0)
+  // , m_nonce (nonce)
+  // , m_outstanding (true)
+  // , m_waitingInVain (false)
+{
+}
+
+} // namespace ns3
diff --git a/model/ccnx-pit-entry-outgoing-face.h b/model/ccnx-pit-entry-outgoing-face.h
new file mode 100644
index 0000000..d5fc4da
--- /dev/null
+++ b/model/ccnx-pit-entry-outgoing-face.h
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_PIT_ENTRY_OUTGOING_FACE_H_
+#define	_CCNX_PIT_ENTRY_OUTGOING_FACE_H_
+
+#include "ns3/nstime.h"
+#include "ns3/ptr.h"
+
+#include "ccnx-face.h"
+
+namespace ns3 {
+
+/**
+ * \ingroup ccnx
+ * \brief PIT state component for each outgoing interest
+ */
+struct CcnxPitEntryOutgoingFace
+{
+  Ptr<CcnxFace> m_face;     ///< \brief face of the outgoing Interest
+  Time m_sendTime;          ///< \brief time when the first outgoing interest is sent (for RTT measurements)
+                            ///< \todo handle problem of retransmitted interests... Probably, we should include something similar
+                            ///<       to TimeStamp TCP option for retransmitted (i.e., only lost interests will suffer)
+  // int m_retxNum;            ///< \brief number of retransmission
+  // int m_nonce;              ///< \brief nonce of the outgoing Interest
+  // bool m_outstanding;		///< \brief flag to indicate that this interest is currently pending
+  // bool m_waitingInVain;		///< \brief when flag is set, we do not expect data for this interest, only a small hope that it will happen
+	
+public:
+  CcnxPitEntryOutgoingFace (Ptr<CcnxFace> face);
+
+  bool operator== (const CcnxPitEntryOutgoingFace &dst) { return *m_face==*dst.m_face; }
+  bool operator== (Ptr<CcnxFace> face) { return *m_face==*face; }
+
+  /**
+   * \brief Comparison operator used by boost::multi_index::identity<>
+   */
+  bool
+  operator< (const CcnxPitEntryOutgoingFace &m) const { return *m_face < *(m.m_face); } // return identity of the face
+};
+
+
+} // namespace ns3
+
+#endif	/* CCNX_PIT_ENTRY_OUTGOING_FACE_H */
diff --git a/model/ccnx-pit-entry.cc b/model/ccnx-pit-entry.cc
new file mode 100644
index 0000000..a6629d0
--- /dev/null
+++ b/model/ccnx-pit-entry.cc
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-pit-entry.h"
+#include "ccnx-name-components.h"
+#include "ccnx-fib.h"
+
+namespace ns3
+{
+
+// struct SearchByFace
+// {
+//   /**
+//    * \brief To perform effective searches by CcnxFace
+//    */
+//   bool
+//   operator() (const CcnxPitIncomingInterest &m, const Ptr<CcnxFace> &face) const
+//   {
+//     return *(m.m_face) < *face;
+//   } 
+
+//   /**
+//    * \brief To perform effective searches by CcnxFace
+//    */
+//   bool
+//   operator() (const Ptr<CcnxFace> &face, const CcnxPitIncomingInterest &m) const
+//   {
+//     return *face < *(m.m_face);
+//   } 
+
+//   /**
+//    * \brief To perform effective searches by CcnxFace
+//    */
+//   bool
+//   operator() (const CcnxPitOutgoingInterest &m, const Ptr<CcnxFace> &face) const
+//   {
+//     return *(m.m_face) < *face;
+//   } 
+
+//   /**
+//    * \brief To perform effective searches by CcnxFace
+//    */
+//   bool
+//   operator() (const Ptr<CcnxFace> &face, const CcnxPitOutgoingInterest &m) const
+//   {
+//     return *face < *(m.m_face);
+//   } 
+// };
+
+
+CcnxPitEntry::CcnxPitEntry (Ptr<CcnxNameComponents> prefix)
+  : m_prefix (prefix)
+  , m_fib (0)
+  // , m_expireTime (?)
+  , m_timerExpired (false)
+  , m_counterExpirations (0)
+{
+}
+
+const CcnxNameComponents &
+CcnxPitEntry::GetPrefix () const
+{
+  return *m_prefix;
+}
+
+CcnxPitEntry::SetFibEntry::SetFibEntry (Ptr<CcnxFibEntry> fib)
+  : m_fib (fib)
+{
+}
+
+void
+CcnxPitEntry::SetFibEntry::operator() (CcnxPitEntry &entry)
+{
+  entry.m_fib = m_fib;
+}
+
+void
+CcnxPitEntry::AddIncoming::operator() (CcnxPitEntry &entry)
+{
+  entry.m_incoming.insert (CcnxPitEntryIncomingFace (m_face));
+}
+
+void
+CcnxPitEntry::AddOutgoing::operator() (CcnxPitEntry &entry)
+{
+  entry.m_outgoing.insert (CcnxPitEntryOutgoingFace (m_face));
+}
+
+void
+CcnxPitEntry::DeleteIncoming::operator() (CcnxPitEntry &entry)
+{
+  entry.m_incoming.erase (m_face);
+}
+
+void
+CcnxPitEntry::ClearIncoming::operator() (CcnxPitEntry &entry)
+{
+  entry.m_incoming.clear ();
+}
+
+
+}  
diff --git a/model/ccnx-pit-entry.h b/model/ccnx-pit-entry.h
new file mode 100644
index 0000000..5da3c4c
--- /dev/null
+++ b/model/ccnx-pit-entry.h
@@ -0,0 +1,199 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_PIT_ENTRY_H_
+#define _CCNX_PIT_ENTRY_H_
+
+#include "ns3/ptr.h"
+
+#include "ccnx-pit-entry-incoming-face.h"
+#include "ccnx-pit-entry-outgoing-face.h"
+#include "ccnx-fib.h"
+
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/tag.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/composite_key.hpp>
+#include <boost/multi_index/hashed_index.hpp>
+#include <boost/multi_index/member.hpp>
+#include <boost/multi_index/mem_fun.hpp>
+
+#include <iostream>
+
+namespace ns3 {
+
+class CcnxFace;
+class CcnxNameComponents;
+
+namespace __ccnx_private
+{
+class i_face {};
+}
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed face container of CcnxPitEntryIncomingFace
+ *
+ * Indexes:
+ * - by face (may be it will be possible to replace with just the std::map)
+ */
+struct CcnxPitEntryIncomingFaceContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxPitEntryIncomingFace,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::ordered_unique<
+        boost::multi_index::tag<__ccnx_private::i_face>,
+        boost::multi_index::identity<CcnxPitEntryIncomingFace>
+      >
+    >
+   > type;
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed face container of CcnxPitEntryOutgoingFace
+ *
+ * Indexes:
+ * - by face (may be it will be possible to replace with just the std::map)
+ */
+struct CcnxPitEntryOutgoingFaceContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxPitEntryOutgoingFace,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::ordered_unique<
+        boost::multi_index::tag<__ccnx_private::i_face>,
+        boost::multi_index::identity<CcnxPitEntryOutgoingFace>
+      >
+    >
+   > type;
+};
+
+
+/**
+ * \ingroup ccnx
+ * \brief structure for PIT entry
+ */
+struct CcnxPitEntry
+{
+public:
+  /**
+   * \brief PIT entry constructor
+   * \param prefix Prefix of the PIT entry
+   * \param fib A FIB entry associated with the PIT entry
+   */
+  CcnxPitEntry (Ptr<CcnxNameComponents> prefix);
+  
+  // // Get number of outgoing interests that we're expecting data from
+  // inline size_t numberOfPromisingInterests( ) const; 
+
+  /**
+   * \brief Unary function to set or update FIB entry with this PIT entry
+   * \param fib smart pointer to FIB entry
+   */
+  struct SetFibEntry
+  {
+    SetFibEntry (Ptr<CcnxFibEntry> fib);
+    void operator() (CcnxPitEntry &entry);
+  private:
+    Ptr<CcnxFibEntry> m_fib;
+  };
+  
+  /**
+   * \brief Unary Function to add incoming interest to the PIT entry
+   *
+   * \param incomingFace smart pointer to the face of the incoming interest
+   * \returns const iterator to a newly added or updated
+   * CcnxPitIncomingInterest entry
+   */
+  struct AddIncoming
+  {
+    AddIncoming (Ptr<CcnxFace> incomingFace) : m_face (incomingFace) {}
+    void operator() (CcnxPitEntry &entry);
+    
+  private:
+    Ptr<CcnxFace> m_face;
+    Time m_lifeTime;
+  };
+
+  /**
+   * \brief Unary function to add outgoing interest to PIT entry
+   *
+   * \param outgoingFace smart pointer to the face of the outgoing interest
+   * \returns const iterator to a newly added or updated
+   * CcnxPitOutgoingInterest entry
+   */
+  struct AddOutgoing
+  {
+    AddOutgoing (Ptr<CcnxFace> outgoingFace) : m_face (outgoingFace) {}
+    void operator() (CcnxPitEntry &entry);
+  private:
+    Ptr<CcnxFace> m_face;
+  };
+
+  /**
+   * \brief Unary function to delete incoming interest for the interface
+   * \param face face that should be removed from the list of incoming interests
+   */
+  struct DeleteIncoming
+  {
+    DeleteIncoming (Ptr<CcnxFace> face) : m_face (face) {}
+    void operator() (CcnxPitEntry &entry);
+  private:
+    Ptr<CcnxFace> m_face;
+  };
+
+  /**
+   * \brief Unary function to remove all incoming interests
+   */
+  struct ClearIncoming
+  {
+    ClearIncoming ();
+    void operator() (CcnxPitEntry &entry);
+  };
+
+  const CcnxNameComponents &
+  GetPrefix () const;
+
+  const Time &
+  GetExpireTime () const { return m_expireTime; }
+
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxPitEntry &entry);
+  
+private:
+  Ptr<CcnxNameComponents> m_prefix; ///< \brief Prefix of the PIT entry
+  Ptr<CcnxFibEntry> m_fib; ///< \brief FIB entry related to this prefix
+  
+  CcnxPitEntryIncomingFaceContainer::type m_incoming; ///< \brief container for incoming interests
+  CcnxPitEntryOutgoingFaceContainer::type m_outgoing; ///< \brief container for outgoing interests
+
+  Time m_expireTime;         ///< \brief Time when PIT entry will be removed
+  bool m_timerExpired;       ///< \brief flag indicating that PIT timer has expired
+  int  m_counterExpirations; ///< \brief whether timer is expired (+ number of times timer expired)
+};
+
+
+} // namespace ns3
+
+#endif // _CCNX_PIT_ENTRY_H_
diff --git a/model/ccnx-pit.cc b/model/ccnx-pit.cc
new file mode 100644
index 0000000..7ee9d83
--- /dev/null
+++ b/model/ccnx-pit.cc
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-pit.h"
+#include "ns3/log.h"
+#include "ns3/simulator.h"
+#include "ccnx-interest-header.h"
+#include "ccnx-content-object-header.h"
+
+NS_LOG_COMPONENT_DEFINE ("CcnxPit");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (CcnxPit);
+
+using namespace __ccnx_private;
+
+// size_t
+// PitEntry::numberOfPromisingInterests(e_pi ) const
+// {
+//   size_t count = 0;
+
+//   BOOST_FOREACH (const CcnxPitOutgoingInterest &interest, m_outgoingInterests)
+//     {
+//     }
+//   for( PitOutgoingConstIterator i = outgoingInterests.begin();
+// 	   i!=outgoingInterests.end();
+// 	   i++ )
+// 	{
+// 	  if( !i->waitingInVain ) count++;
+// 	}
+
+//   return count;
+// }
+
+TypeId 
+CcnxPit::GetTypeId ()
+{
+  static TypeId tid = TypeId ("ns3::CcnxPit")
+    .SetGroupName ("Ccnx")
+    .SetParent<Object> ()
+    .AddConstructor<CcnxPit> ()
+    .AddAttribute ("CleanupTimeout",
+                   "Timeout defining how frequent RIT should be cleaned up",
+                   TimeValue (Seconds (1)),
+                   MakeTimeAccessor (&CcnxPit::GetCleanupTimeout, &CcnxPit::SetCleanupTimeout),
+                   MakeTimeChecker ())
+    ;
+
+  return tid;
+}
+
+CcnxPit::CcnxPit ()
+{
+}
+
+void
+CcnxPit::SetCleanupTimeout (const Time &timeout)
+{
+  m_cleanupTimeout = timeout;
+  if (m_cleanupEvent.IsRunning ())
+    m_cleanupEvent.Cancel (); // cancel any scheduled cleanup events
+
+  // schedule even with new timeout
+  m_cleanupEvent = Simulator::Schedule (Simulator::Now () + m_cleanupTimeout,
+                                        &CcnxPit::CleanExpired, this); 
+}
+
+Time
+CcnxPit::GetCleanupTimeout () const
+{
+  return m_cleanupTimeout;
+}
+
+void CcnxPit::CleanExpired ()
+{
+  NS_LOG_LOGIC ("Cleaning PIT");
+  Time now = Simulator::Now ();
+  
+  while( !m_pit.empty() )
+    {
+      if( m_pit.get<i_timestamp> ().front ().GetExpireTime () <= now ) // is the record stale?
+        {
+         m_pit.get<i_timestamp> ().pop_front( );
+        }
+      else
+        break; // nothing else to do. All later records will not be stale
+    }
+  
+  // schedule next even
+  m_cleanupEvent = Simulator::Schedule (Simulator::Now () + m_cleanupTimeout,
+                                        &CcnxPit::CleanExpired, this); 
+}
+
+const CcnxPitEntry&
+CcnxPit::Lookup (const CcnxContentObjectHeader &header) const
+{
+  CcnxPitEntryContainer::type::iterator entry =
+    m_pit.get<i_prefix> ().find (header.GetName ());
+
+  if (entry != m_pit.end ())
+    throw CcnxPitEntryNotFound();
+
+  return *entry;
+}
+
+const CcnxPitEntry&
+CcnxPit::Lookup (const CcnxInterestHeader &header) const
+{
+  CcnxPitEntryContainer::type::iterator entry =
+    m_pit.get<i_prefix> ().find (header.GetName ());
+
+  // if (entry != m_pit.end ())
+  //   entry = m_pit.insert (m_pit.end (), CcnxPitEntry (Create<CcnxNameComponents> (header.GetName ())));
+
+  return *entry;
+}
+
+
+} // namespace ns3
diff --git a/model/ccnx-pit.cpp b/model/ccnx-pit.cpp
new file mode 100644
index 0000000..5d10b90
--- /dev/null
+++ b/model/ccnx-pit.cpp
@@ -0,0 +1,243 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+//
+// Copyright (c) 2010,2011 UCLA
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation;
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+// Author: 
+//
+
+#include "ccnx-pit.h"
+#include <algorithm>
+
+CcnxPit::CcnxPit( Ccnx &node )
+: _node(node)
+{
+};
+
+CcnxPit::~CcnxPit( ) { }
+
+//Find corresponding CS entry for the given content name
+PitIterator CcnxPit::lookup( const string &prefix )
+{
+	QNThreadLock lock( &_pitMutex );
+
+	PitIterator entry=_pit.find( prefix );
+	return entry;
+}
+
+// add new PIT entry
+bool CcnxPit::add( const string &name, const PitIncomingInterest &interest )
+{
+	QNThreadLock lock( &_pitMutex );
+
+	PitEntry *entry=NULL;
+
+	PitIterator existent_entry = _pit.find( name );
+	if( isValid(existent_entry) )
+	{
+		if( VALUE(existent_entry).timerExpired )
+		{
+			_node.fillAvailableInterfacesInPitEntry( VALUE(existent_entry) );
+		}
+
+		add( VALUE(existent_entry), interest );
+	}
+	else
+	{
+		PitEntry &entry = _pit[ name ];
+		entry.contentName  = name;
+
+		_node.fillAvailableInterfacesInPitEntry( entry );
+
+		add( entry, interest );
+	}
+}
+
+// Remove expired records from PIT
+void CcnxPit::cleanExpired( clocktype time )
+{
+	QNThreadLock lock( &_pitMutex );
+
+    while( !_pitExpirationList.empty() )
+    {
+		PitExpirationIterator entry = _pitExpirationList.begin( );
+
+        if( VALUE(entry)->expireTime <= time )
+        {
+			deleteIncomingInterest( *(KEY(entry)), VALUE(entry)->interfaceIndex );
+
+			// delete entry if all incoming interests expired
+			if( KEY(entry)->incomingInterests.size()==0 )
+			{
+				_pit.erase( KEY(entry)->contentName );
+			}
+        }
+        else
+            break;
+    }
+}
+
+//delete PIT entry
+void CcnxPit::erase( const string &name )
+{
+	// should not call `lookup' method !!!
+	
+	QNThreadLock lock( &_pitMutex );
+
+    PitIterator pe = _pit.find( name );
+	
+	if( !isValid(pe) ) return;
+
+	if( VALUE(pe).timerMsg ) MESSAGE_CancelSelfMsg( _node.getNode(), VALUE(pe).timerMsg );
+
+	PitIncomingIterator it = VALUE(pe).incomingInterests.begin();
+	while( it!=VALUE(pe).incomingInterests.end() )
+	{
+		deleteIncomingInterest( VALUE(pe), it );
+
+		it = VALUE(pe).incomingInterests.begin();
+	}
+
+	resetPendingState( VALUE(pe) );
+
+	_pit.erase( name );
+}
+
+//delete incoming interest from PIT entry
+//return 0 if interest does not exist, 1 otherwise
+bool CcnxPit::deleteIncomingInterest( PitEntry &pe, int interfaceIndex )
+{
+	// should not lock thread !!! Otherwise there will be a deadlock
+    if( pe.incomingInterests.size()==0 ) return false; //nothing to delete. Can happen when duplicate data arrives to the node
+
+    PitIncomingIterator it = findIncoming( pe, interfaceIndex );
+
+	if( !isValid(pe, it) ) return false;
+
+	deleteIncomingInterest( pe, it );
+
+    return true;
+}
+
+void CcnxPit::deleteAllIncomingInterests( PitEntry &pe )
+{
+	PitIncomingIterator it = pe.incomingInterests.begin();
+	while( it!=pe.incomingInterests.end() )
+	{
+		deleteIncomingInterest( pe, it );
+
+		it = pe.incomingInterests.begin();
+	}
+}
+
+void CcnxPit::deleteIncomingInterest( PitEntry &pe, PitIncomingIterator it )
+{
+	assert( KEY(it->expirationPosition)==&pe );
+	assert( VALUE(it->expirationPosition)->interfaceIndex==it->interfaceIndex );
+
+	_pitExpirationList.erase( it->expirationPosition );
+	pe.incomingInterests.erase( it );
+}
+
+//add new incoming interest to PIT entry
+//returns false if interface already exists, true otherwise
+bool CcnxPit::add( PitEntry &pe, const PitIncomingInterest &interest )
+{
+	pe.availableInterfaces.remove( interest.interfaceIndex );
+
+    PitIncomingIterator it=findIncoming( pe, interest.interfaceIndex );
+
+	if( isValid(pe, it) )
+	{
+		//update expiration time
+		it->expireTime = interest.expireTime;
+		it->nonce = interest.nonce;
+
+		//move Interest to the end of the node's Interest list
+		_pitExpirationList.erase( it->expirationPosition );
+		_pitExpirationList.push_back( PitExpirationEntry(&pe,&(*it)) );
+		
+		it->expirationPosition = --_pitExpirationList.end();
+		return false;
+	}
+
+	pe.incomingInterests.push_back( interest );
+	PitIncomingInterest *incoming = &pe.incomingInterests.back();
+
+    //Add to the end of the node's Interest list
+	_pitExpirationList.push_back( PitExpirationEntry(&pe,incoming) );
+	incoming->expirationPosition = -- _pitExpirationList.end();
+
+    return true;
+}
+
+//add new outgoing interest to PIT entry
+//returns false  interface limit reached or interest exists and is still marked as outstanding (nonce will not be changed)
+//		  true otherwise
+int CcnxPit::add( PitEntry &pe, const PitOutgoingInterest &interest )
+{
+	if( _node.isRateLimit && _bucketsPerInterface[interest.interfaceIndex]+1.0 >= maxBucketsPerInterface[interest.interfaceIndex] )
+	{
+//		printf( "DEBUG: bucket overflow. Should not forward anything to interface %d\n", interest.interfaceIndex );
+		return false;
+	}
+
+	_bucketsPerInterface[interest.interfaceIndex] = _bucketsPerInterface[interest.interfaceIndex] + 1.0;
+	pe.availableInterfaces.remove( interest.interfaceIndex );
+
+	PitOutgoingIterator it = findOutgoing(pe, interest.interfaceIndex);
+	if( isValid(pe, it) )
+    {
+		if( it->outstanding ) return false;
+
+        it->retxNum ++;
+        it->nonce = interest.nonce;
+		it->outstanding = true;
+		it->waitingInVain = false;
+    }
+	else
+	{
+		//add to the head of the list
+		pe.outgoingInterests.push_front( interest );
+	}
+	
+    return true;
+}
+
+void CcnxPit::resetPendingState( PitEntry &pe )
+{
+	for( PitOutgoingIterator it = pe.outgoingInterests.begin();
+		 it != pe.outgoingInterests.end();
+		 it++ )
+	{
+		it->outstanding = false;
+	}
+}
+
+void CcnxPit::leakBuckets( )
+{
+	for( PitBucketIterator it=_bucketsPerInterface.begin(); 
+		 it != _bucketsPerInterface.end();
+		 it++ )
+	{
+		it->second = max( 0.0, it->second - leakSize[it->first] );
+	}
+}
+
+void CcnxPit::leakBucket( int interface, int amount )
+{
+	_bucketsPerInterface[interface] = 
+			max( 0.0, _bucketsPerInterface[interface] - amount );
+}
diff --git a/model/ccnx-pit.h b/model/ccnx-pit.h
new file mode 100644
index 0000000..3ffadad
--- /dev/null
+++ b/model/ccnx-pit.h
@@ -0,0 +1,197 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_PIT_H_
+#define	_CCNX_PIT_H_
+
+#include "ns3/nstime.h"
+#include "ns3/event-id.h"
+
+#include "hash-helper.h"
+#include "ccnx-pit-entry.h"
+
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/tag.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/composite_key.hpp>
+#include <boost/multi_index/hashed_index.hpp>
+#include <boost/multi_index/member.hpp>
+#include <boost/multi_index/mem_fun.hpp>
+#include <boost/multi_index/sequenced_index.hpp>
+
+#include <iostream>
+
+namespace ns3 {
+
+class Ccnx;
+class CcnxFace;
+class CcnxContentObjectHeader;
+class CcnxInterestHeader;
+
+/**
+ * \ingroup ccnx
+ * \private
+ * \brief Private namespace for CCNx PIT implementation
+ */
+namespace __ccnx_private
+{
+class i_prefix{}; ///< tag for prefix hash
+class i_timestamp {}; ///< tag for timestamp-ordered records (for cleanup optimization)  
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for RIT container implemented as a Boost.MultiIndex container
+ *
+ * - First index (tag<i_prefix>) is a unique hash index based on
+ *   prefixes
+ * - Second index (tag<i_timestamp>) is a sequenced index based on
+ *   arrival order (for clean-up optimizations)
+ *
+ * \see http://www.boost.org/doc/libs/1_46_1/libs/multi_index/doc/ for more information on Boost.MultiIndex library
+ */
+struct CcnxPitEntryContainer
+{
+  typedef
+  boost::multi_index::multi_index_container<
+    CcnxPitEntry,
+    boost::multi_index::indexed_by<
+      // indexed by hash
+      boost::multi_index::hashed_unique<
+        boost::multi_index::tag<__ccnx_private::i_prefix>,
+        boost::multi_index::const_mem_fun<CcnxPitEntry, const CcnxNameComponents&, &CcnxPitEntry::GetPrefix>,
+        CcnxPrefixHash
+        >,
+      // sequenced to implement MRU
+      boost::multi_index::sequenced<
+        boost::multi_index::tag<__ccnx_private::i_timestamp> >
+      >
+    > type;
+};
+
+// typedef std::map<int,int> PitCounter;
+// typedef std::map<int,int>::iterator PitCounterIterator;
+
+// typedef std::map<int,double> PitBucket;
+// typedef std::map<int,double>::iterator PitBucketIterator;
+
+
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+
+/**
+ * \ingroup ccnx
+ * \brief Class implementing Pending Interests Table
+ */
+class CcnxPit : public Object
+{
+public:
+  /**
+   * \brief Interface ID
+   *
+   * \return interface ID
+   */
+  static TypeId GetTypeId ();
+
+  /**
+   * \brief PIT constructor
+   */
+  CcnxPit ();
+
+  /**
+   * \brief Find corresponding PIT entry for the given content name
+   * \param prefix Prefix for which to lookup the entry
+   * \returns const reference to Pit entry. If record not found,
+   *          CcnxPitEntryNotFound exception will be thrown
+   */
+  const CcnxPitEntry&
+  Lookup (const CcnxContentObjectHeader &header) const;
+
+  /**
+   * \brief Find corresponding PIT entry for the given content name
+   * \param prefix Prefix for which to lookup the entry
+   * \returns const reference to Pit entry. If record does not exist, it will be created
+   */
+  const CcnxPitEntry&
+  Lookup (const CcnxInterestHeader &header) const;
+  
+  // remove a PIT entry
+  //void erase (const string &contentName);
+	
+  // Reset pending state in outgoing interests
+  // void resetPendingState( PitEntry &pe );
+
+  //	// Check if there are any interfaces that we haven't sent data to yet
+  //	bool areFreeInterfaces( PitEntry &pe, int interface );
+
+  // // Periodically generate pre-calculated number of tokens (leak buckets)
+  // void LeakBuckets( );
+	
+  // // Selectively leak a bucket
+  // void LeakBucket (Ptr<CcnxFace> face, int amount);
+	
+  /**
+   * \brief Set cleanup timeout
+   *
+   * Side effect: current clean up even (if any) will be cancelled and a new event started
+   *
+   * \param timeout cleanup timeout
+   */
+  void SetCleanupTimeout (const Time &timeout);
+
+  /**
+   * \brief Get cleanup timeout
+   *
+   * \returns cleanup timeout
+   */
+  Time GetCleanupTimeout () const;
+
+public:
+  // PitBucket				 maxBucketsPerInterface; // maximum number of buckets. Automatically computed based on link capacity
+  // // averaging over 1 second (bandwidth * 1second)
+  // PitBucket				 leakSize;				 // size of a periodic bucket leak
+	
+private:
+  /** \brief Remove expired records from PIT */
+  void CleanExpired ();
+
+  friend std::ostream& operator<< (std::ostream& os, const CcnxPit &fib);
+  
+private:
+  CcnxPitEntryContainer::type m_pit; ///< \brief Container for PIT entries
+
+  Time    m_cleanupTimeout; ///< \brief Configurable timeout of how often cleanup events are working
+  EventId m_cleanupEvent;   ///< \brief Cleanup event
+
+  // PitBucket	m_bucketsPerInterface;	///< \brief pending interface counter per interface
+};
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+std::ostream& operator<< (std::ostream& os, const CcnxPit &fib);
+std::ostream& operator<< (std::ostream& os, const CcnxPitEntry &entry);
+// std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+
+class CcnxPitEntryNotFound {};
+
+} // namespace ns3
+
+#endif	/* CCNX_PIT_H */
diff --git a/model/ccnx-rit.h b/model/ccnx-rit.h
index 99b2fac..0c8922d 100644
--- a/model/ccnx-rit.h
+++ b/model/ccnx-rit.h
@@ -204,4 +204,3 @@
 } // namespace ns3
 
 #endif // _CCNX_RIT_H_
-
diff --git a/model/name-components.cc b/model/name-components.cc
deleted file mode 100644
index 7dde99f..0000000
--- a/model/name-components.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-#include "name-components.h"
-
-#include <iostream>
-
-using namespace std;
-
-namespace ns3 {
-
-CcnxNameComponents::CcnxNameComponents ()
-{
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
-}
-
-CcnxNameComponents::CcnxNameComponents (const string &s)
-{
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
-  // (*this) (s);
-  m_prefix.push_back (s);
-}
-
-CcnxNameComponents::~CcnxNameComponents ()
-{
-  // ccn_charbuf_destroy(&m_value);
-}
-
-const std::list<std::string> &
-CcnxNameComponents::GetComponents () const
-{
-  return m_prefix;
-}
-
-  
-// const ccn_charbuf*
-// Components::GetName () const
-// {
-//   return m_value;
-// }
-
-CcnxNameComponents&
-CcnxNameComponents::operator () (const string &s)
-{
-  // ccn_name_append_str (m_value,s.c_str());
-  m_prefix.push_back (s);
-  return *this;
-}
-
-// Components::operator const unsigned char* ()
-// {
-//   return m_value->buf;
-// }
-
-void
-CcnxNameComponents::Print (std::ostream &os) const
-{
-  for (const_iterator i=m_prefix.begin(); i!=m_prefix.end(); i++)
-    {
-      os << "/" << *i;
-    }
-}
-  
-std::ostream &
-operator << (std::ostream &os, const CcnxNameComponents &components)
-{
-  components.Print (os);
-  return os;
-}
-}
-
diff --git a/model/name-components.h b/model/name-components.h
deleted file mode 100644
index 55cd5ae..0000000
--- a/model/name-components.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-#ifndef _NDN_NAME_COMPONENTS_H_
-#define _NDN_NAME_COMPONENTS_H_
-
-#include "ns3/simple-ref-count.h"
-#include "ns3/attribute.h"
-#include "ns3/attribute-helper.h"
-
-#include <string>
-#include <algorithm>
-#include <list>
-#include "ns3/object.h"
-
-namespace ns3 {
-
-class CcnxNameComponents : public Object
-
-{
-public:
-  CcnxNameComponents ();
-  CcnxNameComponents (const std::string &s);
-  ~CcnxNameComponents ();
-  
-  inline void
-  Add (const std::string &s);
-       
-  CcnxNameComponents&
-  operator () (const std::string &s);
-
-  const std::list<std::string> &
-  GetComponents () const;
-  
-  // virtual uint32_t
-  // GetSerializedSize (void) const;
-
-  // virtual void
-  // Serialize (Buffer::Iterator start) const;
-
-  // virtual uint32_t
-  // Deserialize (Buffer::Iterator start);
-
-  void Print (std::ostream &os) const;
-
-  inline size_t
-  size () const;
-
-  inline bool
-  operator== (const CcnxNameComponents &prefix) const;
-
-  inline bool
-  operator< (const CcnxNameComponents &prefix) const;
-  
-private:
-  std::list<std::string> m_prefix;
-
-  typedef std::list<std::string>::iterator iterator;
-  typedef std::list<std::string>::const_iterator const_iterator;
-};
-
-std::ostream & operator << (std::ostream &os, const CcnxNameComponents &components);
-
-size_t
-CcnxNameComponents::size () const
-{
-  return m_prefix.size ();
-}
-  
-void
-CcnxNameComponents::Add (const std::string &s)
-{
-  (*this) (s);
-}
-
-bool
-CcnxNameComponents::operator== (const CcnxNameComponents &prefix) const
-{
-  if (m_prefix.size () != prefix.m_prefix.size ())
-    return false;
-  
-  return std::equal (m_prefix.begin (), m_prefix.end (), prefix.m_prefix.begin ());
-}
-
-bool
-CcnxNameComponents::operator< (const CcnxNameComponents &prefix) const
-{
-  return std::lexicographical_compare (m_prefix.begin (), m_prefix.end (),
-                                       prefix.m_prefix.begin (), prefix.m_prefix.end ());
-}
-
-    
-/**
-* \class ns3::ComponentsValue
-* \brief hold objects of type ns3:CcnxNameComponents
-*/
-ATTRIBUTE_VALUE_DEFINE (CcnxNameComponents);
-ATTRIBUTE_ACCESSOR_DEFINE (CcnxNameComponents);
-ATTRIBUTE_CHECKER_DEFINE (CcnxNameComponents);
-} // namespace ns3
-
-#endif // _NDN_NAME_COMPONENTS_H_
-
diff --git a/model/uthash.h b/model/uthash.h
deleted file mode 100644
index b1e0d49..0000000
--- a/model/uthash.h
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- Copyright (c) 2003-2011, Troy D. Hanson     http://uthash.sourceforge.net
- All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef UTHASH_H
-#define UTHASH_H 
-
-#include <string.h>   /* memcmp,strlen */
-#include <stddef.h>   /* ptrdiff_t */
-#include <stdlib.h>   /* exit() */
-
-/* These macros use decltype or the earlier __typeof GNU extension.
- As decltype is only available in newer compilers (VS2010 or gcc 4.3+
- when compiling c++ source) this code uses whatever method is needed
- or, for VS2008 where neither is available, uses casting workarounds. */
-#ifdef _MSC_VER         /* MS compiler */
-#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */
-#define DECLTYPE(x) (decltype(x))
-#else                   /* VS2008 or older (or VS2010 in C mode) */
-#define NO_DECLTYPE
-#define DECLTYPE(x)
-#endif
-#else                   /* GNU, Sun and other compilers */
-#define DECLTYPE(x) (__typeof(x))
-#endif
-
-#ifdef NO_DECLTYPE
-#define DECLTYPE_ASSIGN(dst,src)                                                 \
-do {                                                                             \
-char **_da_dst = (char**)(&(dst));                                             \
-*_da_dst = (char*)(src);                                                       \
-} while(0)
-#else 
-#define DECLTYPE_ASSIGN(dst,src)                                                 \
-do {                                                                             \
-(dst) = DECLTYPE(dst)(src);                                                    \
-} while(0)
-#endif
-
-/* a number of the hash function use uint32_t which isn't defined on win32 */
-#ifdef _MSC_VER
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#else
-#include <inttypes.h>   /* uint32_t */
-#endif
-
-#define UTHASH_VERSION 1.9.4
-
-#define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */
-#define uthash_malloc(sz) malloc(sz)      /* malloc fcn                      */
-#define uthash_free(ptr,sz) free(ptr)     /* free fcn                        */
-
-#define uthash_noexpand_fyi(tbl)          /* can be defined to log noexpand  */
-#define uthash_expand_fyi(tbl)            /* can be defined to log expands   */
-
-/* initial number of buckets */
-#define HASH_INITIAL_NUM_BUCKETS 32      /* initial number of buckets        */
-#define HASH_INITIAL_NUM_BUCKETS_LOG2 5  /* lg2 of initial number of buckets */
-#define HASH_BKT_CAPACITY_THRESH 10      /* expand when bucket count reaches */
-
-/* calculate the element whose hash handle address is hhe */
-#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))
-
-#define HASH_FIND(hh,head,keyptr,keylen,out)                                     \
-do {                                                                             \
-unsigned _hf_bkt,_hf_hashv;                                                    \
-out=NULL;                                                                      \
-if (head) {                                                                    \
-HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \
-if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) {                           \
-HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ],  \
-keyptr,keylen,out);                                      \
-}                                                                           \
-}                                                                              \
-} while (0)
-
-#ifdef HASH_BLOOM
-#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)
-#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)
-#define HASH_BLOOM_MAKE(tbl)                                                     \
-do {                                                                             \
-(tbl)->bloom_nbits = HASH_BLOOM;                                               \
-(tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                 \
-if (!((tbl)->bloom_bv))  { uthash_fatal( "out of memory"); }                   \
-memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN);                                \
-(tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                       \
-} while (0);
-
-#define HASH_BLOOM_FREE(tbl)                                                     \
-do {                                                                             \
-uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                              \
-} while (0);
-
-#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))
-#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))
-
-#define HASH_BLOOM_ADD(tbl,hashv)                                                \
-HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
-
-#define HASH_BLOOM_TEST(tbl,hashv)                                               \
-HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
-
-#else
-#define HASH_BLOOM_MAKE(tbl) 
-#define HASH_BLOOM_FREE(tbl) 
-#define HASH_BLOOM_ADD(tbl,hashv) 
-#define HASH_BLOOM_TEST(tbl,hashv) (1)
-#endif
-
-#define HASH_MAKE_TABLE(hh,head)                                                 \
-do {                                                                             \
-(head)->hh.tbl = (UT_hash_table*)uthash_malloc(                                \
-sizeof(UT_hash_table));                                        \
-if (!((head)->hh.tbl))  { uthash_fatal( "out of memory"); }                    \
-memset((head)->hh.tbl, 0, sizeof(UT_hash_table));                              \
-(head)->hh.tbl->tail = &((head)->hh);                                          \
-(head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                        \
-(head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;              \
-(head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                    \
-(head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                      \
-HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \
-if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); }             \
-memset((head)->hh.tbl->buckets, 0,                                             \
-HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \
-HASH_BLOOM_MAKE((head)->hh.tbl);                                               \
-(head)->hh.tbl->signature = HASH_SIGNATURE;                                    \
-} while(0)
-
-#define HASH_ADD(hh,head,fieldname,keylen_in,add)                                \
-HASH_ADD_KEYPTR(hh,head,&add->fieldname,keylen_in,add)
-
-#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \
-do {                                                                             \
-unsigned _ha_bkt;                                                               \
-(add)->hh.next = NULL;                                                          \
-(add)->hh.key = (char*)keyptr;                                                  \
-(add)->hh.keylen = keylen_in;                                                   \
-if (!(head)) {                                                                  \
-head = (add);                                                                \
-(head)->hh.prev = NULL;                                                      \
-HASH_MAKE_TABLE(hh,head);                                                    \
-} else {                                                                        \
-(head)->hh.tbl->tail->next = (add);                                          \
-(add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);         \
-(head)->hh.tbl->tail = &((add)->hh);                                         \
-}                                                                               \
-(head)->hh.tbl->num_items++;                                                    \
-(add)->hh.tbl = (head)->hh.tbl;                                                 \
-HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets,                         \
-(add)->hh.hashv, _ha_bkt);                                              \
-HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh);                   \
-HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv);                                 \
-HASH_EMIT_KEY(hh,head,keyptr,keylen_in);                                        \
-HASH_FSCK(hh,head);                                                             \
-} while(0)
-
-#define HASH_TO_BKT( hashv, num_bkts, bkt )                                      \
-do {                                                                             \
-bkt = ((hashv) & ((num_bkts) - 1));                                            \
-} while(0)
-
-/* delete "delptr" from the hash table.
- * "the usual" patch-up process for the app-order doubly-linked-list.
- * The use of _hd_hh_del below deserves special explanation.
- * These used to be expressed using (delptr) but that led to a bug
- * if someone used the same symbol for the head and deletee, like
- *  HASH_DELETE(hh,users,users);
- * We want that to work, but by changing the head (users) below
- * we were forfeiting our ability to further refer to the deletee (users)
- * in the patch-up process. Solution: use scratch space to
- * copy the deletee pointer, then the latter references are via that
- * scratch pointer rather than through the repointed (users) symbol.
- */
-#define HASH_DELETE(hh,head,delptr)                                              \
-do {                                                                             \
-unsigned _hd_bkt;                                                            \
-struct UT_hash_handle *_hd_hh_del;                                           \
-if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) )  {         \
-uthash_free((head)->hh.tbl->buckets,                                     \
-(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
-HASH_BLOOM_FREE((head)->hh.tbl);                                         \
-uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                      \
-head = NULL;                                                             \
-} else {                                                                     \
-_hd_hh_del = &((delptr)->hh);                                            \
-if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) {     \
-(head)->hh.tbl->tail =                                               \
-(UT_hash_handle*)((char*)((delptr)->hh.prev) +                   \
-(head)->hh.tbl->hho);                                            \
-}                                                                        \
-if ((delptr)->hh.prev) {                                                 \
-((UT_hash_handle*)((char*)((delptr)->hh.prev) +                      \
-(head)->hh.tbl->hho))->next = (delptr)->hh.next;             \
-} else {                                                                 \
-DECLTYPE_ASSIGN(head,(delptr)->hh.next);                             \
-}                                                                        \
-if (_hd_hh_del->next) {                                                  \
-((UT_hash_handle*)((char*)_hd_hh_del->next +                         \
-(head)->hh.tbl->hho))->prev =                                \
-_hd_hh_del->prev;                                            \
-}                                                                        \
-HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);   \
-HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);        \
-(head)->hh.tbl->num_items--;                                             \
-}                                                                            \
-HASH_FSCK(hh,head);                                                          \
-} while (0)
-
-
-/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */
-#define HASH_FIND_STR(head,findstr,out)                                          \
-HASH_FIND(hh,head,findstr,strlen(findstr),out)
-#define HASH_ADD_STR(head,strfield,add)                                          \
-HASH_ADD(hh,head,strfield,strlen(add->strfield),add)
-#define HASH_FIND_INT(head,findint,out)                                          \
-HASH_FIND(hh,head,findint,sizeof(int),out)
-#define HASH_ADD_INT(head,intfield,add)                                          \
-HASH_ADD(hh,head,intfield,sizeof(int),add)
-#define HASH_FIND_PTR(head,findptr,out)                                          \
-HASH_FIND(hh,head,findptr,sizeof(void *),out)
-#define HASH_ADD_PTR(head,ptrfield,add)                                          \
-HASH_ADD(hh,head,ptrfield,sizeof(void *),add)
-#define HASH_DEL(head,delptr)                                                    \
-HASH_DELETE(hh,head,delptr)
-
-/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.
- * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
- */
-#ifdef HASH_DEBUG
-#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
-#define HASH_FSCK(hh,head)                                                       \
-do {                                                                             \
-unsigned _bkt_i;                                                             \
-unsigned _count, _bkt_count;                                                 \
-char *_prev;                                                                 \
-struct UT_hash_handle *_thh;                                                 \
-if (head) {                                                                  \
-_count = 0;                                                              \
-for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) {       \
-_bkt_count = 0;                                                      \
-_thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                      \
-_prev = NULL;                                                        \
-while (_thh) {                                                       \
-if (_prev != (char*)(_thh->hh_prev)) {                            \
-HASH_OOPS("invalid hh_prev %p, actual %p\n",                  \
-_thh->hh_prev, _prev );                                      \
-}                                                                 \
-_bkt_count++;                                                     \
-_prev = (char*)(_thh);                                            \
-_thh = _thh->hh_next;                                             \
-}                                                                    \
-_count += _bkt_count;                                                \
-if ((head)->hh.tbl->buckets[_bkt_i].count !=  _bkt_count) {          \
-HASH_OOPS("invalid bucket count %d, actual %d\n",                 \
-(head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);              \
-}                                                                    \
-}                                                                        \
-if (_count != (head)->hh.tbl->num_items) {                               \
-HASH_OOPS("invalid hh item count %d, actual %d\n",                   \
-(head)->hh.tbl->num_items, _count );                             \
-}                                                                        \
-/* traverse hh in app order; check next/prev integrity, count */         \
-_count = 0;                                                              \
-_prev = NULL;                                                            \
-_thh =  &(head)->hh;                                                     \
-while (_thh) {                                                           \
-_count++;                                                             \
-if (_prev !=(char*)(_thh->prev)) {                                    \
-HASH_OOPS("invalid prev %p, actual %p\n",                          \
-_thh->prev, _prev );                                         \
-}                                                                     \
-_prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                    \
-_thh = ( _thh->next ?  (UT_hash_handle*)((char*)(_thh->next) +        \
-(head)->hh.tbl->hho) : NULL );                 \
-}                                                                        \
-if (_count != (head)->hh.tbl->num_items) {                               \
-HASH_OOPS("invalid app item count %d, actual %d\n",                  \
-(head)->hh.tbl->num_items, _count );                             \
-}                                                                        \
-}                                                                            \
-} while (0)
-#else
-#define HASH_FSCK(hh,head) 
-#endif
-
-/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to 
- * the descriptor to which this macro is defined for tuning the hash function.
- * The app can #include <unistd.h> to get the prototype for write(2). */
-#ifdef HASH_EMIT_KEYS
-#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                   \
-do {                                                                             \
-unsigned _klen = fieldlen;                                                   \
-write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                \
-write(HASH_EMIT_KEYS, keyptr, fieldlen);                                     \
-} while (0)
-#else 
-#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                    
-#endif
-
-/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
-#ifdef HASH_FUNCTION 
-#define HASH_FCN HASH_FUNCTION
-#else
-#define HASH_FCN HASH_JEN
-#endif
-
-/* The Bernstein hash function, used in Perl prior to v5.6 */
-#define HASH_BER(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _hb_keylen=keylen;                                                    \
-char *_hb_key=(char*)(key);                                                    \
-(hashv) = 0;                                                                   \
-while (_hb_keylen--)  { (hashv) = ((hashv) * 33) + *_hb_key++; }               \
-bkt = (hashv) & (num_bkts-1);                                                  \
-} while (0)
-
-
-/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at 
- * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
-#define HASH_SAX(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _sx_i;                                                                \
-char *_hs_key=(char*)(key);                                                    \
-hashv = 0;                                                                     \
-for(_sx_i=0; _sx_i < keylen; _sx_i++)                                          \
-hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                     \
-bkt = hashv & (num_bkts-1);                                                    \
-} while (0)
-
-#define HASH_FNV(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _fn_i;                                                                \
-char *_hf_key=(char*)(key);                                                    \
-hashv = 2166136261UL;                                                          \
-for(_fn_i=0; _fn_i < keylen; _fn_i++)                                          \
-hashv = (hashv * 16777619) ^ _hf_key[_fn_i];                               \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0);
-
-#define HASH_OAT(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _ho_i;                                                                \
-char *_ho_key=(char*)(key);                                                    \
-hashv = 0;                                                                     \
-for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                        \
-hashv += _ho_key[_ho_i];                                                   \
-hashv += (hashv << 10);                                                    \
-hashv ^= (hashv >> 6);                                                     \
-}                                                                              \
-hashv += (hashv << 3);                                                         \
-hashv ^= (hashv >> 11);                                                        \
-hashv += (hashv << 15);                                                        \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0)
-
-#define HASH_JEN_MIX(a,b,c)                                                      \
-do {                                                                             \
-a -= b; a -= c; a ^= ( c >> 13 );                                              \
-b -= c; b -= a; b ^= ( a << 8 );                                               \
-c -= a; c -= b; c ^= ( b >> 13 );                                              \
-a -= b; a -= c; a ^= ( c >> 12 );                                              \
-b -= c; b -= a; b ^= ( a << 16 );                                              \
-c -= a; c -= b; c ^= ( b >> 5 );                                               \
-a -= b; a -= c; a ^= ( c >> 3 );                                               \
-b -= c; b -= a; b ^= ( a << 10 );                                              \
-c -= a; c -= b; c ^= ( b >> 15 );                                              \
-} while (0)
-
-#define HASH_JEN(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _hj_i,_hj_j,_hj_k;                                                    \
-char *_hj_key=(char*)(key);                                                    \
-hashv = 0xfeedbeef;                                                            \
-_hj_i = _hj_j = 0x9e3779b9;                                                    \
-_hj_k = keylen;                                                                \
-while (_hj_k >= 12) {                                                          \
-_hj_i +=    (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                      \
-+ ( (unsigned)_hj_key[2] << 16 )                                         \
-+ ( (unsigned)_hj_key[3] << 24 ) );                                      \
-_hj_j +=    (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                      \
-+ ( (unsigned)_hj_key[6] << 16 )                                         \
-+ ( (unsigned)_hj_key[7] << 24 ) );                                      \
-hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                         \
-+ ( (unsigned)_hj_key[10] << 16 )                                        \
-+ ( (unsigned)_hj_key[11] << 24 ) );                                     \
-\
-HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                          \
-\
-_hj_key += 12;                                                              \
-_hj_k -= 12;                                                                \
-}                                                                              \
-hashv += keylen;                                                               \
-switch ( _hj_k ) {                                                             \
-case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \
-case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \
-case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \
-case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \
-case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \
-case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \
-case 5:  _hj_j += _hj_key[4];                                               \
-case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \
-case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \
-case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \
-case 1:  _hj_i += _hj_key[0];                                               \
-}                                                                              \
-HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0)
-
-/* The Paul Hsieh hash function */
-#undef get16bits
-#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__)             \
-|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
-#define get16bits(d) (*((const uint16_t *) (d)))
-#endif
-
-#if !defined (get16bits)
-#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)             \
-+(uint32_t)(((const uint8_t *)(d))[0]) )
-#endif
-#define HASH_SFH(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-char *_sfh_key=(char*)(key);                                                   \
-uint32_t _sfh_tmp, _sfh_len = keylen;                                          \
-\
-int _sfh_rem = _sfh_len & 3;                                                   \
-_sfh_len >>= 2;                                                                \
-hashv = 0xcafebabe;                                                            \
-\
-/* Main loop */                                                                \
-for (;_sfh_len > 0; _sfh_len--) {                                              \
-hashv    += get16bits (_sfh_key);                                            \
-_sfh_tmp       = (get16bits (_sfh_key+2) << 11) ^ hashv;                     \
-hashv     = (hashv << 16) ^ _sfh_tmp;                                        \
-_sfh_key += 2*sizeof (uint16_t);                                             \
-hashv    += hashv >> 11;                                                     \
-}                                                                              \
-\
-/* Handle end cases */                                                         \
-switch (_sfh_rem) {                                                            \
-case 3: hashv += get16bits (_sfh_key);                                       \
-hashv ^= hashv << 16;                                                \
-hashv ^= _sfh_key[sizeof (uint16_t)] << 18;                          \
-hashv += hashv >> 11;                                                \
-break;                                                               \
-case 2: hashv += get16bits (_sfh_key);                                       \
-hashv ^= hashv << 11;                                                \
-hashv += hashv >> 17;                                                \
-break;                                                               \
-case 1: hashv += *_sfh_key;                                                  \
-hashv ^= hashv << 10;                                                \
-hashv += hashv >> 1;                                                 \
-}                                                                              \
-\
-/* Force "avalanching" of final 127 bits */                                  \
-hashv ^= hashv << 3;                                                         \
-hashv += hashv >> 5;                                                         \
-hashv ^= hashv << 4;                                                         \
-hashv += hashv >> 17;                                                        \
-hashv ^= hashv << 25;                                                        \
-hashv += hashv >> 6;                                                         \
-bkt = hashv & (num_bkts-1);                                                  \
-} while(0);
-
-#ifdef HASH_USING_NO_STRICT_ALIASING
-/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.
- * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.
- * MurmurHash uses the faster approach only on CPU's where we know it's safe. 
- *
- * Note the preprocessor built-in defines can be emitted using:
- *
- *   gcc -m64 -dM -E - < /dev/null                  (on gcc)
- *   cc -## a.c (where a.c is a simple test file)   (Sun Studio)
- */
-#if (defined(__i386__) || defined(__x86_64__)) 
-#define MUR_GETBLOCK(p,i) p[i]
-#else /* non intel */
-#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0)
-#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1)
-#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)
-#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)
-#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
-#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
-#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
-#define MUR_TWO_TWO(p)   ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >>  8))
-#else /* assume little endian non-intel */
-#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))
-#define MUR_TWO_TWO(p)   ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) <<  8))
-#endif
-#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) :           \
-(MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \
-(MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) :  \
-MUR_ONE_THREE(p))))
-#endif
-#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))
-#define MUR_FMIX(_h) \
-do {                 \
-_h ^= _h >> 16;    \
-_h *= 0x85ebca6b;  \
-_h ^= _h >> 13;    \
-_h *= 0xc2b2ae35l; \
-_h ^= _h >> 16;    \
-} while(0)
-
-#define HASH_MUR(key,keylen,num_bkts,hashv,bkt)                        \
-do {                                                                   \
-const uint8_t *_mur_data = (const uint8_t*)(key);                    \
-const int _mur_nblocks = (keylen) / 4;                               \
-uint32_t _mur_h1 = 0xf88D5353;                                       \
-uint32_t _mur_c1 = 0xcc9e2d51;                                       \
-uint32_t _mur_c2 = 0x1b873593;                                       \
-const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \
-int _mur_i;                                                          \
-for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) {                      \
-uint32_t _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i);               \
-_mur_k1 *= _mur_c1;                                                \
-_mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \
-_mur_k1 *= _mur_c2;                                                \
-\
-_mur_h1 ^= _mur_k1;                                                \
-_mur_h1 = MUR_ROTL32(_mur_h1,13);                                  \
-_mur_h1 = _mur_h1*5+0xe6546b64;                                    \
-}                                                                    \
-const uint8_t *_mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \
-uint32_t _mur_k1=0;                                                  \
-switch((keylen) & 3) {                                               \
-case 3: _mur_k1 ^= _mur_tail[2] << 16;                             \
-case 2: _mur_k1 ^= _mur_tail[1] << 8;                              \
-case 1: _mur_k1 ^= _mur_tail[0];                                   \
-_mur_k1 *= _mur_c1;                                                \
-_mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \
-_mur_k1 *= _mur_c2;                                                \
-_mur_h1 ^= _mur_k1;                                                \
-}                                                                    \
-_mur_h1 ^= (keylen);                                                 \
-MUR_FMIX(_mur_h1);                                                   \
-hashv = _mur_h1;                                                     \
-bkt = hashv & (num_bkts-1);                                          \
-} while(0)
-#endif  /* HASH_USING_NO_STRICT_ALIASING */
-
-/* key comparison function; return 0 if keys equal */
-#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) 
-
-/* iterate over items in a known bucket to find desired item */
-#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out)                       \
-do {                                                                             \
-if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head));          \
-else out=NULL;                                                                  \
-while (out) {                                                                   \
-if (out->hh.keylen == keylen_in) {                                           \
-if ((HASH_KEYCMP(out->hh.key,keyptr,keylen_in)) == 0) break;             \
-}                                                                            \
-if (out->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,out->hh.hh_next)); \
-else out = NULL;                                                             \
-}                                                                               \
-} while(0)
-
-/* add an item to a bucket  */
-#define HASH_ADD_TO_BKT(head,addhh)                                              \
-do {                                                                             \
-head.count++;                                                                   \
-(addhh)->hh_next = head.hh_head;                                                \
-(addhh)->hh_prev = NULL;                                                        \
-if (head.hh_head) { (head).hh_head->hh_prev = (addhh); }                        \
-(head).hh_head=addhh;                                                           \
-if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH)             \
-&& (addhh)->tbl->noexpand != 1) {                                           \
-HASH_EXPAND_BUCKETS((addhh)->tbl);                                        \
-}                                                                               \
-} while(0)
-
-/* remove an item from a given bucket */
-#define HASH_DEL_IN_BKT(hh,head,hh_del)                                          \
-(head).count--;                                                              \
-if ((head).hh_head == hh_del) {                                              \
-(head).hh_head = hh_del->hh_next;                                          \
-}                                                                            \
-if (hh_del->hh_prev) {                                                       \
-hh_del->hh_prev->hh_next = hh_del->hh_next;                              \
-}                                                                            \
-if (hh_del->hh_next) {                                                       \
-hh_del->hh_next->hh_prev = hh_del->hh_prev;                              \
-}                                                                
-
-/* Bucket expansion has the effect of doubling the number of buckets
- * and redistributing the items into the new buckets. Ideally the
- * items will distribute more or less evenly into the new buckets
- * (the extent to which this is true is a measure of the quality of
- * the hash function as it applies to the key domain). 
- * 
- * With the items distributed into more buckets, the chain length
- * (item count) in each bucket is reduced. Thus by expanding buckets
- * the hash keeps a bound on the chain length. This bounded chain 
- * length is the essence of how a hash provides constant time lookup.
- * 
- * The calculation of tbl->ideal_chain_maxlen below deserves some
- * explanation. First, keep in mind that we're calculating the ideal
- * maximum chain length based on the *new* (doubled) bucket count.
- * In fractions this is just n/b (n=number of items,b=new num buckets).
- * Since the ideal chain length is an integer, we want to calculate 
- * ceil(n/b). We don't depend on floating point arithmetic in this
- * hash, so to calculate ceil(n/b) with integers we could write
- * 
- *      ceil(n/b) = (n/b) + ((n%b)?1:0)
- * 
- * and in fact a previous version of this hash did just that.
- * But now we have improved things a bit by recognizing that b is
- * always a power of two. We keep its base 2 log handy (call it lb),
- * so now we can write this with a bit shift and logical AND:
- * 
- *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
- * 
- */
-#define HASH_EXPAND_BUCKETS(tbl)                                                 \
-do {                                                                             \
-unsigned _he_bkt;                                                            \
-unsigned _he_bkt_i;                                                          \
-struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                 \
-UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                \
-_he_new_buckets = (UT_hash_bucket*)uthash_malloc(                            \
-2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));              \
-if (!_he_new_buckets) { uthash_fatal( "out of memory"); }                    \
-memset(_he_new_buckets, 0,                                                   \
-2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));               \
-tbl->ideal_chain_maxlen =                                                    \
-(tbl->num_items >> (tbl->log2_num_buckets+1)) +                           \
-((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0);                    \
-tbl->nonideal_items = 0;                                                     \
-for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++)                \
-{                                                                            \
-_he_thh = tbl->buckets[ _he_bkt_i ].hh_head;                             \
-while (_he_thh) {                                                        \
-_he_hh_nxt = _he_thh->hh_next;                                        \
-HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt);            \
-_he_newbkt = &(_he_new_buckets[ _he_bkt ]);                           \
-if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) {                \
-tbl->nonideal_items++;                                              \
-_he_newbkt->expand_mult = _he_newbkt->count /                       \
-tbl->ideal_chain_maxlen;                 \
-}                                                                     \
-_he_thh->hh_prev = NULL;                                              \
-_he_thh->hh_next = _he_newbkt->hh_head;                               \
-if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev =               \
-_he_thh;                                                         \
-_he_newbkt->hh_head = _he_thh;                                        \
-_he_thh = _he_hh_nxt;                                                 \
-}                                                                        \
-}                                                                            \
-uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
-tbl->num_buckets *= 2;                                                       \
-tbl->log2_num_buckets++;                                                     \
-tbl->buckets = _he_new_buckets;                                              \
-tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ?         \
-(tbl->ineff_expands+1) : 0;                                              \
-if (tbl->ineff_expands > 1) {                                                \
-tbl->noexpand=1;                                                         \
-uthash_noexpand_fyi(tbl);                                                \
-}                                                                            \
-uthash_expand_fyi(tbl);                                                      \
-} while(0)
-
-
-/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */
-/* Note that HASH_SORT assumes the hash handle name to be hh. 
- * HASH_SRT was added to allow the hash handle name to be passed in. */
-#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)
-#define HASH_SRT(hh,head,cmpfcn)                                                 \
-do {                                                                             \
-unsigned _hs_i;                                                                \
-unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;               \
-struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;            \
-if (head) {                                                                    \
-_hs_insize = 1;                                                            \
-_hs_looping = 1;                                                           \
-_hs_list = &((head)->hh);                                                  \
-while (_hs_looping) {                                                      \
-_hs_p = _hs_list;                                                      \
-_hs_list = NULL;                                                       \
-_hs_tail = NULL;                                                       \
-_hs_nmerges = 0;                                                       \
-while (_hs_p) {                                                        \
-_hs_nmerges++;                                                     \
-_hs_q = _hs_p;                                                     \
-_hs_psize = 0;                                                     \
-for ( _hs_i = 0; _hs_i  < _hs_insize; _hs_i++ ) {                  \
-_hs_psize++;                                                   \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                      \
-((void*)((char*)(_hs_q->next) +                        \
-(head)->hh.tbl->hho)) : NULL);                         \
-if (! (_hs_q) ) break;                                         \
-}                                                                  \
-_hs_qsize = _hs_insize;                                            \
-while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) {           \
-if (_hs_psize == 0) {                                          \
-_hs_e = _hs_q;                                             \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \
-((void*)((char*)(_hs_q->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_qsize--;                                               \
-} else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \
-_hs_e = _hs_p;                                             \
-_hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-((void*)((char*)(_hs_p->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_psize--;                                               \
-} else if ((                                                   \
-cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \
-DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \
-) <= 0) {                                           \
-_hs_e = _hs_p;                                             \
-_hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-((void*)((char*)(_hs_p->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_psize--;                                               \
-} else {                                                       \
-_hs_e = _hs_q;                                             \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \
-((void*)((char*)(_hs_q->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_qsize--;                                               \
-}                                                              \
-if ( _hs_tail ) {                                              \
-_hs_tail->next = ((_hs_e) ?                                \
-ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL);          \
-} else {                                                       \
-_hs_list = _hs_e;                                          \
-}                                                              \
-_hs_e->prev = ((_hs_tail) ?                                    \
-ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \
-_hs_tail = _hs_e;                                              \
-}                                                                  \
-_hs_p = _hs_q;                                                     \
-}                                                                      \
-_hs_tail->next = NULL;                                                 \
-if ( _hs_nmerges <= 1 ) {                                              \
-_hs_looping=0;                                                     \
-(head)->hh.tbl->tail = _hs_tail;                                   \
-DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list));      \
-}                                                                      \
-_hs_insize *= 2;                                                       \
-}                                                                          \
-HASH_FSCK(hh,head);                                                        \
-}                                                                               \
-} while (0)
-
-/* This function selects items from one hash into another hash. 
- * The end result is that the selected items have dual presence 
- * in both hashes. There is no copy of the items made; rather 
- * they are added into the new hash through a secondary hash 
- * hash handle that must be present in the structure. */
-#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                              \
-do {                                                                             \
-unsigned _src_bkt, _dst_bkt;                                                   \
-void *_last_elt=NULL, *_elt;                                                   \
-UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                         \
-ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                 \
-if (src) {                                                                     \
-for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {     \
-for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;                \
-_src_hh;                                                               \
-_src_hh = _src_hh->hh_next) {                                          \
-_elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                       \
-if (cond(_elt)) {                                                      \
-_dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);               \
-_dst_hh->key = _src_hh->key;                                         \
-_dst_hh->keylen = _src_hh->keylen;                                   \
-_dst_hh->hashv = _src_hh->hashv;                                     \
-_dst_hh->prev = _last_elt;                                           \
-_dst_hh->next = NULL;                                                \
-if (_last_elt_hh) { _last_elt_hh->next = _elt; }                     \
-if (!dst) {                                                          \
-DECLTYPE_ASSIGN(dst,_elt);                                         \
-HASH_MAKE_TABLE(hh_dst,dst);                                       \
-} else {                                                             \
-_dst_hh->tbl = (dst)->hh_dst.tbl;                                  \
-}                                                                    \
-HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);    \
-HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh);            \
-(dst)->hh_dst.tbl->num_items++;                                      \
-_last_elt = _elt;                                                    \
-_last_elt_hh = _dst_hh;                                              \
-}                                                                      \
-}                                                                          \
-}                                                                            \
-}                                                                              \
-HASH_FSCK(hh_dst,dst);                                                         \
-} while (0)
-
-#define HASH_CLEAR(hh,head)                                                      \
-do {                                                                             \
-if (head) {                                                                    \
-uthash_free((head)->hh.tbl->buckets,                                         \
-(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));      \
-uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                          \
-(head)=NULL;                                                                 \
-}                                                                              \
-} while(0)
-
-#ifdef NO_DECLTYPE
-#define HASH_ITER(hh,head,el,tmp)                                                \
-for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \
-el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) 
-#else
-#define HASH_ITER(hh,head,el,tmp)                                                \
-for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL);                 \
-el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))
-#endif
-
-/* obtain a count of items in the hash */
-#define HASH_COUNT(head) HASH_CNT(hh,head) 
-#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)
-
-typedef struct UT_hash_bucket {
-    struct UT_hash_handle *hh_head;
-    unsigned count;
-    
-    /* expand_mult is normally set to 0. In this situation, the max chain length
-     * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
-     * the bucket's chain exceeds this length, bucket expansion is triggered). 
-     * However, setting expand_mult to a non-zero value delays bucket expansion
-     * (that would be triggered by additions to this particular bucket)
-     * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
-     * (The multiplier is simply expand_mult+1). The whole idea of this
-     * multiplier is to reduce bucket expansions, since they are expensive, in
-     * situations where we know that a particular bucket tends to be overused.
-     * It is better to let its chain length grow to a longer yet-still-bounded
-     * value, than to do an O(n) bucket expansion too often. 
-     */
-    unsigned expand_mult;
-    
-} UT_hash_bucket;
-
-/* random signature used only to find hash tables in external analysis */
-#define HASH_SIGNATURE 0xa0111fe1
-#define HASH_BLOOM_SIGNATURE 0xb12220f2
-
-typedef struct UT_hash_table {
-    UT_hash_bucket *buckets;
-    unsigned num_buckets, log2_num_buckets;
-    unsigned num_items;
-    struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */
-    ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */
-    
-    /* in an ideal situation (all buckets used equally), no bucket would have
-     * more than ceil(#items/#buckets) items. that's the ideal chain length. */
-    unsigned ideal_chain_maxlen;
-    
-    /* nonideal_items is the number of items in the hash whose chain position
-     * exceeds the ideal chain maxlen. these items pay the penalty for an uneven
-     * hash distribution; reaching them in a chain traversal takes >ideal steps */
-    unsigned nonideal_items;
-    
-    /* ineffective expands occur when a bucket doubling was performed, but 
-     * afterward, more than half the items in the hash had nonideal chain
-     * positions. If this happens on two consecutive expansions we inhibit any
-     * further expansion, as it's not helping; this happens when the hash
-     * function isn't a good fit for the key domain. When expansion is inhibited
-     * the hash will still work, albeit no longer in constant time. */
-    unsigned ineff_expands, noexpand;
-    
-    uint32_t signature; /* used only to find hash tables in external analysis */
-#ifdef HASH_BLOOM
-    uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
-    uint8_t *bloom_bv;
-    char bloom_nbits;
-#endif
-    
-} UT_hash_table;
-
-typedef struct UT_hash_handle {
-    struct UT_hash_table *tbl;
-    void *prev;                       /* prev element in app order      */
-    void *next;                       /* next element in app order      */
-    struct UT_hash_handle *hh_prev;   /* previous hh in bucket order    */
-    struct UT_hash_handle *hh_next;   /* next hh in bucket order        */
-    void *key;                        /* ptr to enclosing struct's key  */
-    unsigned keylen;                  /* enclosing struct's key len     */
-    unsigned hashv;                   /* result of hash-fcn(key)        */
-} UT_hash_handle;
-
-#endif /* UTHASH_H */
