Skip to content

Instantly share code, notes, and snippets.

@thehajime
thehajime / xml2dict
Created October 29, 2013 09:28 — forked from upa/xml2dict
def xmltodict (node) :
def _xmltodict (node) :
if len (node) > 0:
dic = {}
for child in node :
[key, value] = _xmltodict (child)
if dic.has_key (key) :
if isinstance (dic[key], list) :
dic[key].append (value)
@thehajime
thehajime / ns-3-dce-mswim13.patch
Last active December 27, 2015 05:29
mswim 2013 demonstration: patch for ns-3-dce (54522b2a6868)
# HG changeset patch
# Parent be0c6459871fd508ae98beef511c752933e94f9c
diff -r be0c6459871f example/dce-mptcp-handoff-v6.cc
--- a/example/dce-mptcp-handoff-v6.cc Tue Oct 15 12:34:15 2013 +0900
+++ b/example/dce-mptcp-handoff-v6.cc Fri Nov 01 21:02:30 2013 +0900
@@ -80,13 +80,13 @@
Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable> ();
x->SetAttribute ("Min", DoubleValue (0.0));
x->SetAttribute ("Max", DoubleValue (100.0));
@thehajime
thehajime / ns-3-dev-mswim13.patch
Created November 2, 2013 02:39
mswim 2013 demonstration: patch for ns-3-dev (60b0d4d40fb9)
# HG changeset patch
# Parent 99bf9f9ef69a38a828d578ccdc17ffad5e493103
diff -r 99bf9f9ef69a src/lte/model/lte-enb-net-device.cc
--- a/src/lte/model/lte-enb-net-device.cc Thu Oct 31 07:52:07 2013 +0900
+++ b/src/lte/model/lte-enb-net-device.cc Thu Oct 31 19:54:48 2013 +0900
@@ -262,6 +262,8 @@
{
NS_LOG_FUNCTION (this << packet << dest << protocolNumber);
NS_ASSERT_MSG (protocolNumber == Ipv4L3Protocol::PROT_NUMBER, "unsupported protocol " << protocolNumber << ", only IPv4 is supported");
# HG changeset patch
# Parent 827b1d133aebf6259594cf1f379ee693e568cdca
diff -r 827b1d133aeb example/tcp-client.cc
--- a/example/tcp-client.cc Wed Oct 30 17:18:51 2013 +0900
+++ b/example/tcp-client.cc Thu Jan 30 16:55:28 2014 +0900
@@ -47,7 +47,7 @@
}
// std::cout << "write: " << n << std::endl;
This file has been truncated, but you can view the full file.
diff --git a/src/topology-read/examples/as-rel.2011.01.16.txt b/src/topology-read/examples/as-rel.2011.01.16.txt
new file mode 100755
--- /dev/null
+++ b/src/topology-read/examples/as-rel.2011.01.16.txt
@@ -0,0 +1,103612 @@
+# link peer 3523 (3.40%)
+# link provider 99962 (96.60%)
+# path unset 415187 (7.79%)
+# path valid 2945299 (55.25%)
+# path valid peer 1944027 (36.47%)
# HG changeset patch
# User Hajime Tazaki <tazaki@sfc.wide.ad.jp>
# Date 1384271550 -32400
# Wed Nov 13 00:52:30 2013 +0900
# Node ID 68675e7a5435221dd75161dc1dc2bef5afe652eb
# Parent 1681415790d726051281c65f7f1f0ebe7d53174f
update with experimental caida-topology-reader.
caida-asrel-topology-reader.patch
https://gist.github.com/thehajime/7433221
# HG changeset patch
# Parent 73285fae30f91d5e9ead36d2eab2222f9e40cb6e
Bug 1773 - DCE doesn't run on Fedora 19 (64bits)
diff -r 73285fae30f9 model/cooja-loader-factory.cc
--- a/model/cooja-loader-factory.cc Sun Nov 10 00:37:22 2013 +0900
+++ b/model/cooja-loader-factory.cc Thu Nov 14 12:30:28 2013 +0900
@@ -374,6 +374,8 @@
{
NS_LOG_FUNCTION (this << module << symbol);
# HG changeset patch
# Parent 092b770473a785abc4b9232a5e2c76c8ce497485
diff -r 092b770473a7 bake/ModuleBuild.py
--- a/bake/ModuleBuild.py Wed Sep 25 23:58:18 2013 +0900
+++ b/bake/ModuleBuild.py Thu Oct 10 09:13:32 2013 +0900
@@ -31,6 +31,7 @@
import commands
import re
import sys
diff -r 68675e7a5435 example/dce-quagga-bgpd-caida.cc
--- a/example/dce-quagga-bgpd-caida.cc Wed Nov 13 00:52:30 2013 +0900
+++ b/example/dce-quagga-bgpd-caida.cc Thu Nov 14 15:49:36 2013 +0900
@@ -166,6 +166,7 @@
quagga.BgpAddNeighbor (nc[i].Get (0), link_base + ".2", quagga.GetAsn (nc[i].Get (1)));
quagga.BgpAddNeighbor (nc[i].Get (1), link_base + ".1", quagga.GetAsn (nc[i].Get (0)));
+ quagga.BgpAddNetwork (nc[i].Get (0), "1.2.3.4/32");
// peer link
diff --git a/arch/sim/sim.c b/arch/sim/sim.c
index 574bad8..bcd9aab 100644
--- a/arch/sim/sim.c
+++ b/arch/sim/sim.c
@@ -338,9 +338,8 @@ int sim_task_wakeup (struct SimTask *task)
}
void sim_task_yield (void)
{
- rcu_idle_enter ();
+ rcu_sched_qs (0);