--- a/himalis.patch Tue Mar 13 17:18:48 2012 +0900
+++ b/himalis.patch Wed Mar 14 12:32:01 2012 +0900
@@ -1,7 +1,7 @@
diff -r 15b6876ea9ed example/dce-himalis-handoff.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/example/dce-himalis-handoff.cc Tue Mar 13 17:18:36 2012 +0900
-@@ -0,0 +1,303 @@
++++ b/example/dce-himalis-handoff.cc Wed Mar 14 12:31:47 2012 +0900
+@@ -0,0 +1,296 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 NICT
@@ -68,13 +68,12 @@
+ apps.Start (at);
+}
+
-+void
-+AssocCallback (std::string path, Mac48Address bssid)
++static void
++AssocCallback (Ptr<HimalisHelper> himalis, std::string path, Mac48Address bssid)
+{
+ uint8_t gw0[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
+ uint8_t gw1[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+ uint8_t cur[6];
-+ HimalisHelper himalis;
+
+ bssid.CopyTo (cur);
+
@@ -88,15 +87,15 @@
+ RunIp (hosts.Get (0), Simulator::Now (), "-f inet6 addr add " + host0_gw0_sim0 + "/64 dev sim0");
+ RunIp (hosts.Get (0), Simulator::Now (), "-f inet6 route add default via "+ gw0_sim0);
+#if 1
-+ himalis.DelIdlRoute (hosts.Get (0), Simulator::Now (),
++ himalis->DelIdlRoute (hosts.Get (0), Simulator::Now (),
+ host0_srcid.c_str (), host1_srcid.c_str ());
-+ himalis.AddIdlRoute (hosts.Get (0), Simulator::Now (),
++ himalis->AddIdlRoute (hosts.Get (0), Simulator::Now (),
+ "host", host0_srcid.c_str (), host1_srcid.c_str (),
+ host0_gw0_sim0.c_str (), gw0_sim0.c_str (), "sim0");
+
-+ himalis.DelIdlRoute (hosts.Get (1), Simulator::Now (),
++ himalis->DelIdlRoute (hosts.Get (1), Simulator::Now (),
+ host1_srcid.c_str (), host0_srcid.c_str ());
-+ himalis.AddIdlRoute (hosts.Get (1), Simulator::Now (),
++ himalis->AddIdlRoute (hosts.Get (1), Simulator::Now (),
+ "host", host1_srcid.c_str (), host0_srcid.c_str (),
+ host1_sim0.c_str (), gw0_sim1.c_str (), "sim0");
+#endif
@@ -110,18 +109,18 @@
+ RunIp (hosts.Get (0), Simulator::Now (), "-f inet6 addr add " + host0_gw1_sim0 + "/64 dev sim0");
+ RunIp (hosts.Get (0), Simulator::Now (), "-f inet6 route add default via "+ gw1_sim0);
+#if 1
-+ himalis.DelIdlRoute (hosts.Get (0), Simulator::Now (),
++ himalis->DelIdlRoute (hosts.Get (0), Simulator::Now (),
+ host0_srcid.c_str (), host1_srcid.c_str ());
-+ himalis.AddIdlRoute (hosts.Get (0), Simulator::Now (),
++ himalis->AddIdlRoute (hosts.Get (0), Simulator::Now (),
+ "host", host0_srcid.c_str (), host1_srcid.c_str (),
+ host0_gw1_sim0.c_str (), gw1_sim0.c_str (), "sim0");
+
-+ himalis.DelIdlRoute (hosts.Get (1), Simulator::Now (),
++ himalis->DelIdlRoute (hosts.Get (1), Simulator::Now (),
+ host1_srcid.c_str (), host0_srcid.c_str ());
-+ himalis.AddIdlRoute (hosts.Get (1), Simulator::Now (),
++ himalis->AddIdlRoute (hosts.Get (1), Simulator::Now (),
+ "host", host1_srcid.c_str (), host0_srcid.c_str (),
+ host1_sim1.c_str (), gw1_sim1.c_str (), "sim1");
-+ himalis.ShowIdlRoute (hosts.Get (1), Simulator::Now ());
++ himalis->ShowIdlRoute (hosts.Get (1), Simulator::Now ());
+#endif
+ }
+
@@ -196,7 +195,7 @@
+ HimalisHelper himalis;
+ dceManager.SetTaskManagerAttribute ("FiberManagerType",
+ EnumValue (0));
-+ // dceManager.SetLoader ("ns3::DlmLoaderFactory");
++ dceManager.SetLoader ("ns3::DlmLoaderFactory");
+ dceManager.SetNetworkStack("ns3::LinuxSocketFdFactory",
+ "Library", StringValue ("liblinux-2.6.32.27-tpidl.so"));
+ dceManager.Install (NodeContainer (hosts, gw));
@@ -268,7 +267,6 @@
+ ApplicationContainer apps;
+#if 1
+ // server install to host1
-+ process.SetBinary ("idl-server");
+ process.SetBinary ("idecho-s");
+ process.ResetArguments ();
+ process.ParseArguments ("-s " + host1_srcid);
@@ -278,7 +276,6 @@
+#endif
+
+ // client install to host0
-+ process.SetBinary ("idl-client");
+ process.SetBinary ("idecho-c");
+ process.ResetArguments ();
+ process.ParseArguments ("-s " + host0_srcid);
@@ -290,12 +287,8 @@
+ p2p.EnablePcapAll ("dce-himalis");
+ phy.EnablePcapAll ("dce-himalis");
+
-+ // XXX
-+ Ptr<VisualSimulatorImpl> impl = DynamicCast<VisualSimulatorImpl> (Simulator::GetImplementation ());
-+ if (GetPointer (impl) == NULL)
-+ {
-+ Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/Assoc", MakeCallback (&AssocCallback));
-+ }
++ Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/Assoc",
++ MakeBoundCallback (&AssocCallback, &himalis));
+
+ Simulator::Stop (Seconds (stopTime));
+ Simulator::Run ();
@@ -307,7 +300,7 @@
+}
diff -r 15b6876ea9ed example/dce-himalis-simple.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/example/dce-himalis-simple.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/example/dce-himalis-simple.cc Wed Mar 14 12:31:47 2012 +0900
@@ -0,0 +1,153 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
@@ -464,7 +457,7 @@
+}
diff -r 15b6876ea9ed example/dce-linux.cc
--- a/example/dce-linux.cc Tue Mar 06 14:44:40 2012 +0900
-+++ b/example/dce-linux.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/example/dce-linux.cc Wed Mar 14 12:31:47 2012 +0900
@@ -103,7 +103,7 @@
}
@@ -476,8 +469,8 @@
processManager.Install (nodes);
diff -r 15b6876ea9ed example/himalis/idecho-c.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/example/himalis/idecho-c.cc Tue Mar 13 17:18:36 2012 +0900
-@@ -0,0 +1,161 @@
++++ b/example/himalis/idecho-c.cc Wed Mar 14 12:31:47 2012 +0900
+@@ -0,0 +1,163 @@
+/*****************************
+ * TP/ID/Locator echo client *
+ * *
@@ -593,11 +586,13 @@
+
+ do
+ {
-+ char sendbuf[16] = "send echo";
++ char sendbuf[16] = "send echo\n";
++ wrote_siz = 0;
+ write_siz = sizeof (sendbuf);
++ fprintf(stderr, "send-->%s\n", sendbuf);
+ int result = send(connect_sockfd,
-+ sendbuf + wrote_siz,
-+ write_siz - wrote_siz, 0);
++ sendbuf,
++ write_siz, 0);
+ if (result < 0)
+ err_func("send");
+
@@ -641,7 +636,7 @@
+}
diff -r 15b6876ea9ed example/himalis/idecho-s.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/example/himalis/idecho-s.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/example/himalis/idecho-s.cc Wed Mar 14 12:31:47 2012 +0900
@@ -0,0 +1,146 @@
+/*****************************
+ * TP/ID/Locator echo server *
@@ -766,8 +761,8 @@
+ break;
+
+ buf[read_siz] = '\0';
-+ fprintf(stderr, "<- ");
-+ fprintf(stdout, "%s", buf);
++ fprintf(stderr, "<- len=%d", read_siz);
++ fprintf(stdout, "%s\n", buf);
+
+ do
+ {
@@ -791,7 +786,7 @@
+}
diff -r 15b6876ea9ed example/himalis/idl.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/example/himalis/idl.h Tue Mar 13 17:18:36 2012 +0900
++++ b/example/himalis/idl.h Wed Mar 14 12:31:47 2012 +0900
@@ -0,0 +1,331 @@
+/*
+ * ID/Locator Split Architectur Implementation
@@ -1126,7 +1121,7 @@
+
diff -r 15b6876ea9ed helper/himalis-helper.cc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/helper/himalis-helper.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/helper/himalis-helper.cc Wed Mar 14 12:31:47 2012 +0900
@@ -0,0 +1,212 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
@@ -1342,8 +1337,8 @@
+} // namespace ns3
diff -r 15b6876ea9ed helper/himalis-helper.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/helper/himalis-helper.h Tue Mar 13 17:18:36 2012 +0900
-@@ -0,0 +1,102 @@
++++ b/helper/himalis-helper.h Wed Mar 14 12:31:47 2012 +0900
+@@ -0,0 +1,103 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 NICT
@@ -1378,7 +1373,7 @@
+ * This class creates one or multiple instances of ns3::Himalis and associates
+ * it/them to one/multiple node(s).
+ */
-+class HimalisHelper
++class HimalisHelper : public Object
+{
+public:
+ /**
@@ -1389,6 +1384,7 @@
+ HimalisHelper ();
+ ~HimalisHelper ();
+
++
+ void InitIdlRoutePy ();
+ /**
+ * Install a himalis application on each Node in the provided NodeContainer.
@@ -1448,7 +1444,7 @@
+#endif /* HIMALIS_HELPER_H */
diff -r 15b6876ea9ed idlroute
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/idlroute Tue Mar 13 17:18:36 2012 +0900
++++ b/idlroute Wed Mar 14 12:31:47 2012 +0900
@@ -0,0 +1,327 @@
+#! /usr/bin/python
+# -*- coding: utf-8 -*-
@@ -1779,7 +1775,7 @@
+
diff -r 15b6876ea9ed model/cooja-loader-factory.cc
--- a/model/cooja-loader-factory.cc Tue Mar 06 14:44:40 2012 +0900
-+++ b/model/cooja-loader-factory.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/model/cooja-loader-factory.cc Wed Mar 14 12:31:47 2012 +0900
@@ -214,7 +214,7 @@
if (sharedModule == 0)
{
@@ -1791,7 +1787,7 @@
dlinfo (handle, RTLD_DI_LINKMAP, &link_map);
diff -r 15b6876ea9ed model/libc-ns3.h
--- a/model/libc-ns3.h Tue Mar 06 14:44:40 2012 +0900
-+++ b/model/libc-ns3.h Tue Mar 13 17:18:36 2012 +0900
++++ b/model/libc-ns3.h Wed Mar 14 12:31:47 2012 +0900
@@ -103,6 +103,8 @@
NATIVE_EXPLICIT (strrchr, char * (*) (char *, int))
NATIVE (strcasecmp)
@@ -1803,7 +1799,7 @@
DCE (strndup)
diff -r 15b6876ea9ed model/linux-socket-fd-factory.cc
--- a/model/linux-socket-fd-factory.cc Tue Mar 06 14:44:40 2012 +0900
-+++ b/model/linux-socket-fd-factory.cc Tue Mar 13 17:18:36 2012 +0900
++++ b/model/linux-socket-fd-factory.cc Wed Mar 14 12:31:47 2012 +0900
@@ -461,6 +461,7 @@
void
LinuxSocketFdFactory::SetTask (std::string path, std::string value)
@@ -1853,7 +1849,7 @@
{
diff -r 15b6876ea9ed model/linux-socket-fd-factory.h
--- a/model/linux-socket-fd-factory.h Tue Mar 06 14:44:40 2012 +0900
-+++ b/model/linux-socket-fd-factory.h Tue Mar 13 17:18:36 2012 +0900
++++ b/model/linux-socket-fd-factory.h Wed Mar 14 12:31:47 2012 +0900
@@ -44,7 +44,8 @@
virtual UnixFd *CreateSocket (int domain, int type, int protocol);
@@ -1874,20 +1870,20 @@
Ptr<EventIdHolder> event);
diff -r 15b6876ea9ed utils/setenv.zsh
--- a/utils/setenv.zsh Tue Mar 06 14:44:40 2012 +0900
-+++ b/utils/setenv.zsh Tue Mar 13 17:18:36 2012 +0900
++++ b/utils/setenv.zsh Wed Mar 14 12:31:47 2012 +0900
@@ -6,7 +6,8 @@
LD_LIBRARY_PATH="$BASE/ns-3-dce/build/lib:$BASE/build/lib:$BASE/build/bin:$BASE/ns-3-dce/build/bin:.:/usr/local/mpi/gcc/openmpi-1.4.3/lib/"
PKG_CONFIG_PATH="$BASE/build/lib/pkgconfig"
PATH="$BASE/build/bin:$BASE/build/sbin:/home/tazaki/hgworks/ns-3-dce-thehajime/build/bin:/home/tazaki/hgworks/ns-3-dce-thehajime/build/sbin:$PATH"
-PYTHONPATH=$BASE/ns-3-dev/build/debug/bindings/python:$BASE/ns-3-dev/src/visualizer:$BASE/pybindgen-0.15.0.795:$BASE/build/lib/python2.6/site-packages/
-+DCE_PATH=`pwd`/build/bin_dce
++DCE_PATH="$BASE/ns-3-dce/build/bin_dce"
+PYTHONPATH=$BASE/ns-3-dev/build/debug/bindings/python:$BASE/ns-3-dev/src/visualizer:$BASE/pybindgen-0.15.0.795:$BASE/build/lib/python2.6/site-packages/:$BASE/ns-3-dce
export LD_LIBRARY_PATH PKG_CONFIG_PATH PATH PYTHONPATH
cd $BASE/ns-3-dce
diff -r 15b6876ea9ed wscript
--- a/wscript Tue Mar 06 14:44:40 2012 +0900
-+++ b/wscript Tue Mar 13 17:18:36 2012 +0900
++++ b/wscript Wed Mar 14 12:31:47 2012 +0900
@@ -35,6 +35,7 @@
conf.check(header_name='sys/stat.h', define_name='HAVE_SYS_STAT_H', mandatory=False)
conf.check(header_name='dirent.h', define_name='HAVE_DIRENT_H', mandatory=False)