First commit
diff --git a/ccn_utils/generate_linear.py b/ccn_utils/generate_linear.py
new file mode 100644
index 0000000..fbafe1c
--- /dev/null
+++ b/ccn_utils/generate_linear.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+
+import optparse
+
+def parse_args():
+ usage="""Usage: generate_linear num_nodes [template_file] [delay]
+ Generates template_file with a linear topology with num_nodes and
+ delay in the links (10ms, 100ms, etc).If no template_file is given,
+ will write to default file miniccnx.conf in the current directory.
+ """
+
+ parser = optparse.OptionParser(usage)
+
+ _, arg = parser.parse_args()
+
+ if len(arg) > 3:
+ print parser.usage
+ quit()
+ elif len(arg) == 0:
+ print parser.usage
+ quit()
+ elif len(arg) == 1:
+ num_nodes = int(parser.parse_args()[1][0])
+ temp_file = ''
+ delay = ''
+ elif len(arg) == 2:
+ num_nodes, delay = int(parser.parse_args()[1][0]), parser.parse_args()[1][1]
+ temp_file = ''
+ else:
+ print parser.parse_args()
+ num_nodes,temp_file, delay = int(parser.parse_args()[1][0]), parser.parse_args()[1][1],parser.parse_args()[1][2]
+
+ return num_nodes, temp_file, delay
+
+if __name__ == '__main__':
+
+ n_nodes, t_file, delay = parse_args()
+
+ if t_file == '':
+ t_file = 'miniccnx.conf'
+
+ temp_file = open(t_file,'w')
+
+ temp_file.write('[hosts]\n')
+
+ temp_file.write('[routers]\n')
+
+ for i in range(n_nodes):
+ if i == (n_nodes - 1):
+ temp_file.write('s' + str(i) + ':\n')
+ else:
+ temp_file.write('s' + str(i) + ': ccnx:/,s' + str(i+1) + '\n')
+
+ temp_file.write('[links]\n')
+
+ for i in range(n_nodes-1):
+ peer = i + 1
+ if delay == '':
+ temp_file.write('s' + str(i) + ':s' + str(peer) + '\n')
+ else:
+ temp_file.write('s' + str(i) + ':s' + str(peer) + ' delay=' + delay +'\n')
+
+ temp_file.close()
diff --git a/ccn_utils/generate_mesh.py b/ccn_utils/generate_mesh.py
new file mode 100644
index 0000000..e150e66
--- /dev/null
+++ b/ccn_utils/generate_mesh.py
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+
+import optparse
+
+def parse_args():
+ usage="""Usage: generate_mesh num_nodes [template_file]
+ Generates template_file with a full mesh topology with num_nodes
+ If no template_file is given, will write to default
+ file miniccnx.conf in the current directory.
+ """
+
+ parser = optparse.OptionParser(usage)
+
+ _, arg = parser.parse_args()
+
+ if len(arg) > 2:
+ print parser.usage
+ quit()
+ elif len(arg) == 0:
+ print parser.usage
+ quit()
+ elif len(arg) == 1:
+ num_nodes = int(parser.parse_args()[1][0])
+ temp_file = ''
+ else:
+ print parser.parse_args()
+ num_nodes,temp_file = int(parser.parse_args()[1][0]), parser.parse_args()[1][1]
+
+ return num_nodes, temp_file
+
+if __name__ == '__main__':
+
+ n_nodes, t_file = parse_args()
+
+ if t_file == '':
+ t_file = 'miniccnx.conf'
+
+ temp_file = open(t_file,'w')
+
+ temp_file.write('[hosts]\n')
+
+ temp_file.write('[routers]\n')
+
+ for i in range(n_nodes):
+ temp_file.write('s' + str(i) + ':\n')
+
+ temp_file.write('[links]\n')
+
+ for i in range(n_nodes):
+ peer = i + 1
+ for j in range(peer,n_nodes):
+ temp_file.write('s' + str(i) + ':s' + str(j) + '\n')
+
+ temp_file.close()
+
+
+
\ No newline at end of file
diff --git a/ccn_utils/miniccnx.conf b/ccn_utils/miniccnx.conf
new file mode 100644
index 0000000..ecb0643
--- /dev/null
+++ b/ccn_utils/miniccnx.conf
@@ -0,0 +1,12 @@
+[hosts]
+c1: _ ccnx:/,s1
+c2: _ ccnx:/,s1
+h1: _
+h2: _
+[routers]
+s1: ccnx:/1,h1 ccnx:/2,h2
+[links]
+c1:s1 bw=100
+c2:s1 bw=100
+s1:h1 bw=100
+s1:h2 bw=100
diff --git a/ccn_utils/miniccnx.conf_16 b/ccn_utils/miniccnx.conf_16
new file mode 100644
index 0000000..89a274f
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_16
@@ -0,0 +1,68 @@
+[hosts]
+c1: _ ccnx:/,s1
+c2: _ ccnx:/,s1
+c3: _ ccnx:/,s1
+c4: _ ccnx:/,s1
+c5: _ ccnx:/,s1
+c6: _ ccnx:/,s1
+c7: _ ccnx:/,s1
+c8: _ ccnx:/,s1
+c9: _ ccnx:/,s1
+c10: _ ccnx:/,s1
+c11: _ ccnx:/,s1
+c12: _ ccnx:/,s1
+c13: _ ccnx:/,s1
+c14: _ ccnx:/,s1
+c15: _ ccnx:/,s1
+c16: _ ccnx:/,s1
+h1: _
+h2: _
+h3: _
+h4: _
+h5: _
+h6: _
+h7: _
+h8: _
+h9: _
+h10: _
+h11: _
+h12: _
+h13: _
+h14: _
+h15: _
+h16: _
+[routers]
+s1: ccnx:/s/1,h1 ccnx:/s/2,h2 ccnx:/s/3,h3 ccnx:/s/4,h4 ccnx:/s/5,h5 ccnx:/s/6,h6 ccnx:/s/7,h7 ccnx:/s/8,h8 ccnx:/s/9,h9 ccnx:/s/10,h10 ccnx:/s/11,h11 ccnx:/s/12,h12 ccnx:/s/13,h13 ccnx:/s/14,h14 ccnx:/s/15,h15 ccnx:/s/16,h16
+[links]
+c1:s1
+c2:s1
+c3:s1
+c4:s1
+c5:s1
+c6:s1
+c7:s1
+c8:s1
+c9:s1
+c10:s1
+c11:s1
+c12:s1
+c13:s1
+c14:s1
+c15:s1
+c16:s1
+s1:h1
+s1:h2
+s1:h3
+s1:h4
+s1:h5
+s1:h6
+s1:h7
+s1:h8
+s1:h9
+s1:h10
+s1:h11
+s1:h12
+s1:h13
+s1:h14
+s1:h15
+s1:h16
diff --git a/ccn_utils/miniccnx.conf_2hops b/ccn_utils/miniccnx.conf_2hops
new file mode 100644
index 0000000..acbd30e
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_2hops
@@ -0,0 +1,40 @@
+[hosts]
+h1: _ ccnx:/,s1
+h2: _ ccnx:/,s1
+h3: _ ccnx:/,s1
+h4: _ ccnx:/,s1
+h5: _ ccnx:/,s1
+h6: _ ccnx:/,s1
+h7: _ ccnx:/,s1
+h8: _ ccnx:/,s1
+r1: _
+r2: _
+r3: _
+r4: _
+r5: _
+r6: _
+r7: _
+r8: _
+[routers]
+s1: ccnx:/,s2
+s2: ccnx:/,s3
+s3: ccnx:/s/1,r1 ccnx:/s/2,r2 ccnx:/s/3,r3 ccnx:/s/4,r4 ccnx:/s/5,r5 ccnx:/s/6,r6 ccnx:/s/7,r7 ccnx:/s/8,r8
+[links]
+h1:s1
+h2:s1
+h3:s1
+h4:s1
+h5:s1
+h6:s1
+h7:s1
+h8:s1
+s1:s2
+s2:s3
+r1:s3
+r2:s3
+r3:s3
+r4:s3
+r5:s3
+r6:s3
+r7:s3
+r8:s3
diff --git a/ccn_utils/miniccnx.conf_bkp b/ccn_utils/miniccnx.conf_bkp
new file mode 100644
index 0000000..4a74752
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_bkp
@@ -0,0 +1,20 @@
+[hosts]
+h7: ./h7.sh ccnx:/,s5
+h9: _ ccnx:/,s3
+h6: ./h6.sh ccnx:/,s4
+h8: _ ccnx:/,s2
+[routers]
+s2: ccnx:/music,s1
+s3: ccnx:/music,s1
+s5: ccnx:/music/moveis,h7
+s4: ccnx:/music/skank,h6
+s1: ccnx:/music/skank,s4 ccnx:/music/moveis,s5
+[links]
+h6:s4
+s4:s1
+s1:s5
+s5:h7
+s1:s3
+s3:h9
+s1:s2
+s2:h8
diff --git a/ccn_utils/miniccnx.conf_bkp2 b/ccn_utils/miniccnx.conf_bkp2
new file mode 100644
index 0000000..0b8c19f
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_bkp2
@@ -0,0 +1,20 @@
+[hosts]
+h7: ./h7.sh ccnx:/,s5
+h9: _ ccnx:/,s3
+h6: ./h6.sh ccnx:/,s4
+h8: _ ccnx:/,s2
+[routers]
+s2: ccnx:/music,s1
+s3: ccnx:/music,s1
+s5: ccnx:/music/moveis,h7
+s4: ccnx:/music/skank,h6
+s1: ccnx:/music/skank,s4 ccnx:/music/moveis,s5
+[links]
+h6:s4 bw=1
+s4:s1 bw=1
+s1:s5 bw=1000
+s5:h7 bw=1000 loss=50
+s1:s3 bw=1
+s3:h9 bw=1
+s1:s2 bw=1
+s2:h8 bw=1
diff --git a/ccn_utils/miniccnx.conf_bkp3 b/ccn_utils/miniccnx.conf_bkp3
new file mode 100644
index 0000000..ee827c9
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_bkp3
@@ -0,0 +1,18 @@
+[hosts]
+h7: _ ccnx:/,s2
+h4: _ ccnx:/,s3
+h6: _ ccnx:/,s1
+h8: _ ccnx:/,s2
+h5: _ ccnx:/,s1
+[routers]
+s3: ccnx:/music,s1 ccnx:/video,s2
+s1: ccnx:/,s3 ccnx:/music,h5
+s2: ccnx:/,s3 ccnx:/video,h7
+[links]
+h5:s1 bw=1000
+h6:s1 bw=1000
+s2:h7 bw=1000
+s2:h8 bw=1000
+s1:s3 bw=1000
+s2:s3 bw=1000
+h4:s3 bw=1000
diff --git a/ccn_utils/miniccnx.conf_bw_3 b/ccn_utils/miniccnx.conf_bw_3
new file mode 100644
index 0000000..f317008
--- /dev/null
+++ b/ccn_utils/miniccnx.conf_bw_3
@@ -0,0 +1,16 @@
+[hosts]
+c1: _ ccnx:/,s1
+c2: _ ccnx:/,s1
+c3: _ ccnx:/,s1
+h1: _
+h2: _
+h3: _
+[routers]
+s1: ccnx:/1,h1 ccnx:/2,h2 ccnx:/3,h3
+[links]
+c1:s1
+c2:s1
+c3:s1
+s1:h1
+s1:h2
+s1:h3