Using latest version of mininet

refs: #2851

Change-Id: Ica4936cb98245a0b1a22d8ceada4e7a0f6dbddc8
diff --git a/bin/minindn b/bin/minindn
index 1c92097..952c568 100755
--- a/bin/minindn
+++ b/bin/minindn
@@ -5,12 +5,13 @@
 from mininet.log import setLogLevel, output, info
 from mininet.cli import CLI
 from mininet.link import TCLink
-from mininet.conf_parser import parse_hosts, parse_links
+from mininet.util import ipStr, ipParse
 
 from ndn.experiments.multiple_failure_experiment import MultipleFailureExperiment
 from ndn.experiments.pingall_experiment import PingallExperiment
 from ndn.experiments.failure_experiment import FailureExperiment
 from ndn.ndn_host import NdnHost, CpuLimitedNdnHost
+from ndn.conf_parser import parse_hosts, parse_links
 
 import os.path, time
 import optparse
@@ -114,15 +115,12 @@
 def execute(template_file='minindn.conf', testbed=False, pingall=None, ctime=None, hr=False, faces=3, failure=False, isMultipleFailure=False, isCliEnabled=True):
     "Create a network based on template_file"
 
-    home = expanduser("~")
-
     if template_file == '':
         template_file='minindn.conf'
 
     if os.path.exists(template_file) == False:
         info('No template file given and default template file minindn.conf not found. Exiting...\n')
         quit()
-
     topo = NdnTopo(template_file)
 
     t = datetime.datetime.now()
@@ -144,6 +142,22 @@
 
     net.start()
 
+    # Giving proper IPs to intf so neighbor nodes can communicate
+    # This is one way of giving connectivity, another way could be
+    # to insert a switch between each pair of neighbors
+    ndnNetBase = "1.0.0.0"
+    interfaces = []
+    for host in net.hosts:
+        for intf in host.intfList():
+            link = intf.link
+            node1, node2 = link.intf1.node, link.intf2.node
+            if link.intf1 not in interfaces and link.intf2 not in interfaces:
+                interfaces.append(link.intf1)
+                interfaces.append(link.intf2)
+                node1.setIP(ipStr(ipParse(ndnNetBase) + 1) + '/30', intf=link.intf1)
+                node2.setIP(ipStr(ipParse(ndnNetBase) + 2) + '/30', intf=link.intf2)
+                ndnNetBase = ipStr(ipParse(ndnNetBase) + 4)
+
     nodes = ""    # Used later to check prefix name in checkFIB
 
     # NLSR initialization
@@ -160,7 +174,7 @@
             host.nlsrParameters["hyperbolic-state"] = "on"
 
         # Generate NLSR configuration file
-        configGenerator = NlsrConfigGenerator(host, home)
+        configGenerator = NlsrConfigGenerator(host)
         configGenerator.createConfigFile()
 
         # Start NLSR