← pynet

exercise3

966c78557cecd41904c79c3db0b877269410c21b · ovidiucs · Sep 13, 2015 15:53

+10 · 1 file changed

  • course_2/ex3_as_path.py +10 −0
diff --git a/course_2/ex3_as_path.py b/course_2/ex3_as_path.py
new file mode 100644
index 0000000..5777d21
--- /dev/null
+++ b/course_2/ex3_as_path.py
@@ -0,0 +1,10 @@
+entry1 = "*  1.0.192.0/18   157.130.10.233        0 701 38040 9737 i"
+entry2 = "*  1.1.1.0/24       157.130.10.233        0 701 1299 15169 i"
+entry3 = "*  1.1.42.0/24     157.130.10.233        0 701 9505 17408 2.1465 i"
+entry4 = "*  1.0.192.0/19   157.130.10.233        0 701 6762 6762 6762 6762
+38040 9737 i"
+
+print "%15s %15s" % ("ip_prefix", "as_path")
+
+for entry in entry1,entry2, entry3, entry4:
+        print "%15s %15s" % (entry.split()[1], entry.s