docs: Adding forwarding strategy example
diff --git a/docs/source/_static/code-samples/custom-strategy.cc b/docs/source/_static/code-samples/custom-strategy.cc
new file mode 100644
index 0000000..3b1cea1
--- /dev/null
+++ b/docs/source/_static/code-samples/custom-strategy.cc
@@ -0,0 +1,117 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+// custom-strategy.cc
+
+#include "custom-strategy.h"
+#include "ns3/ndn-fib.h"
+#include "ns3/ndn-fib-entry.h"
+#include "ns3/ndn-pit-entry.h"
+#include "ns3/ndn-interest.h"
+
+namespace ns3 {
+namespace ndn {
+namespace fw {
+
+NS_OBJECT_ENSURE_REGISTERED(CustomStrategy);
+
+LogComponent CustomStrategy::g_log = LogComponent (CustomStrategy::GetLogName ().c_str ());
+    
+std::string
+CustomStrategy::GetLogName ()
+{
+  return "ndn.fw.CustomStrategy";
+}
+    
+TypeId
+CustomStrategy::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::ndn::fw::CustomStrategy")
+    .SetGroupName ("Ndn")
+    .SetParent <BaseStrategy> ()
+    .AddConstructor <CustomStrategy> ()
+        
+    // .AddAttribute ("Attribute", "Attribute spec",
+    //                         StringValue ("DefaultValue"),
+    //                         MakeStringAccessor (&BaseStrategy::m_variable),
+    //                         MakeStringChecker ())    
+    ;
+  return tid;
+}
+
+CustomStrategy::CustomStrategy ()
+  : m_counter (0)
+{
+}
+
+bool
+CustomStrategy::DoPropagateInterest (Ptr<Face> inFace,
+                                     Ptr<const InterestHeader> header,
+                                     Ptr<const Packet> origPacket,
+                                     Ptr<pit::Entry> pitEntry)
+{
+  typedef fib::FaceMetricContainer::type::index<fib::i_metric>::type FacesByMetric;
+  FacesByMetric &faces = pitEntry->GetFibEntry ()->m_faces.get<fib::i_metric> ();
+  FacesByMetric::iterator faceIterator = faces.begin ();
+
+  int propagatedCount = 0;
+
+  // forward to best-metric face
+  if (faceIterator != faces.end ())
+    {
+      if (TrySendOutInterest (inFace, faceIterator->m_face, header, origPacket, pitEntry))
+        propagatedCount ++;
+
+      faceIterator ++;
+    }
+
+  // forward to second-best-metric face
+  if (faceIterator != faces.end ())
+    {
+      if (TrySendOutInterest (inFace, faceIterator->m_face, header, origPacket, pitEntry))
+        propagatedCount ++;
+
+      faceIterator ++;
+    }
+  return propagatedCount > 0;
+}
+
+void
+CustomStrategy::DidSendOutInterest (Ptr<Face> outFace,
+                                    Ptr<const InterestHeader> header,
+                                    Ptr<const Packet> origPacket,
+                                    Ptr<pit::Entry> pitEntry)
+{
+  m_counter ++;
+}
+
+void
+CustomStrategy::WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry)
+{
+  for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin ();
+       face != pitEntry->GetOutgoing ().end ();
+       face ++)
+    {
+      m_counter --;
+    }
+        
+  BaseStrategy::WillEraseTimedOutPendingInterest (pitEntry);
+}
+        
+        
+void
+CustomStrategy::WillSatisfyPendingInterest (Ptr<Face> inFace,
+                                            Ptr<pit::Entry> pitEntry)
+{
+  for (pit::Entry::out_container::iterator face = pitEntry->GetOutgoing ().begin ();
+       face != pitEntry->GetOutgoing ().end ();
+       face ++)
+    {
+      m_counter --;
+    }
+          
+  BaseStrategy::WillSatisfyPendingInterest (inFace, pitEntry);
+}
+
+        
+} // namespace fw
+} // namespace ndn
+} // namespace ns3
diff --git a/docs/source/_static/code-samples/custom-strategy.h b/docs/source/_static/code-samples/custom-strategy.h
new file mode 100644
index 0000000..4a4476d
--- /dev/null
+++ b/docs/source/_static/code-samples/custom-strategy.h
@@ -0,0 +1,67 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+
+// custom-strategy.h
+        
+#ifndef CUSTOM_STRATEGY_H
+#define CUSTOM_STRATEGY_H
+
+#include "ns3/log.h"
+#include "ns3/ndn-forwarding-strategy.h"
+#include "ns3/ndn-l3-protocol.h"
+                
+namespace ns3 {
+namespace ndn {
+namespace fw {
+
+typedef ForwardingStrategy BaseStrategy;
+
+class CustomStrategy:
+    public BaseStrategy
+{
+public:
+  static TypeId
+  GetTypeId ();
+        
+  static std::string
+  GetLogName ();
+          
+  CustomStrategy ();
+        
+protected:
+  virtual bool
+  DoPropagateInterest (Ptr<Face> incomingFace,
+                       Ptr<const InterestHeader> header,
+                       Ptr<const Packet> origPacket,
+                       Ptr<pit::Entry> pitEntry);
+
+public:
+  virtual void
+  DidSendOutInterest (Ptr<Face> outFace,
+                      Ptr<const InterestHeader> header,
+                      Ptr<const Packet> origPacket,
+                      Ptr<pit::Entry> pitEntry);
+
+  virtual void
+  WillEraseTimedOutPendingInterest (Ptr<pit::Entry> pitEntry);
+
+  virtual void
+  WillSatisfyPendingInterest (Ptr<Face> inFace,
+                              Ptr<pit::Entry> pitEntry);
+        
+protected:
+  static LogComponent g_log;
+        
+// private:
+//   std::string m_variable;
+
+private:
+  uint32_t m_counter;
+};
+        
+        
+        
+} // namespace fw
+} // namespace ndn
+} // namespace ns3
+                
+#endif // CUSTOM_STRATEGY_H