examples: Fixing error in ndn-simple-with-pcap
closes #24
diff --git a/examples/ndn-simple-with-pcap.cc b/examples/ndn-simple-with-pcap.cc
index ea2f318..03f3ef4 100644
--- a/examples/ndn-simple-with-pcap.cc
+++ b/examples/ndn-simple-with-pcap.cc
@@ -1,4 +1,23 @@
-
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 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>
+ */
+// ndn-simple-with-pcap.cc
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
@@ -14,13 +33,13 @@
PcapHelper helper;
m_pcap = helper.CreateFile (file, std::ios::out, PcapHelper::DLT_PPP);
}
-
+
void
TracePacket (Ptr<const Packet> packet)
{
static PppHeader pppHeader;
pppHeader.SetProtocol (0x0077);
-
+
m_pcap->Write (Simulator::Now (), pppHeader, packet);
}
@@ -37,8 +56,6 @@
Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
- Config::SetDefault ("ns3::ndn::Producer::SignatureBits", StringValue ("1"));
-
// Creating nodes
NodeContainer nodes;
nodes.Create (3);
@@ -72,7 +89,7 @@
PcapWriter trace ("ndn-simple-trace.pcap");
Config::ConnectWithoutContext ("/NodeList/*/$ns3::ndn::L3Protocol/FaceList/*/NdnTx",
MakeCallback (&PcapWriter::TracePacket, &trace));
-
+
Simulator::Stop (Seconds (20.0));
Simulator::Run ();
diff --git a/examples/wscript b/examples/wscript
index b21629e..b33cbf3 100644
--- a/examples/wscript
+++ b/examples/wscript
@@ -50,3 +50,6 @@
obj = bld.create_ns3_program('ndn-simple-with-cs-lfu', ['ndnSIM'])
obj.source = 'ndn-simple-with-cs-lfu.cc'
+
+ obj = bld.create_ns3_program('ndn-simple-with-pcap', ['ndnSIM'])
+ obj.source = 'ndn-simple-with-pcap.cc'