Linux/Ns-3/Dce cross experiments
[nepi.git] / src / nepi / resources / linux / scripts / linux-udp-connect.py
index ffd8740..330ed17 100644 (file)
@@ -60,51 +60,37 @@ def get_options():
     parser = OptionParser(usage = usage)
 
     parser.add_option("-N", "--vif-name", dest="vif_name",
-        help = "The name of the virtual interface",
-        type="str")
-
+        help="The name of the virtual interface", type="str")
     parser.add_option("-t", "--vif-type", dest="vif_type",
-        help = "Virtual interface type. Either IFF_TAP or IFF_TUN. "
-            "Defaults to IFF_TAP. ", 
-        default = IFF_TAP,
-        type="str")
-
-    parser.add_option("-n", "--pi", dest="pi", 
-            action="store_true", 
-            default = False,
-            help="Enable PI header")
+        help="Virtual interface type. Either IFF_TAP or IFF_TUN. "
+            "Defaults to IFF_TAP. ", default=IFF_TAP, type="str")
+    parser.add_option("-n", "--pi", dest="pi", action="store_true", 
+            default=False, help="Enable PI header")
 
     parser.add_option("-b", "--bwlimit", dest="bwlimit",
-        help = "Specifies the interface's emulated bandwidth in bytes ",
-        default = None, type="int")
-
+        help="Specifies the interface's emulated bandwidth in bytes ",
+        default=None, type="int")
     parser.add_option("-q", "--txqueuelen", dest="txqueuelen",
-        help = "Specifies the interface's transmission queue length. ",
-        default = 1000, type="int")
-
+        help="Specifies the interface's transmission queue length. ",
+        default=1000, type="int")
     parser.add_option("-c", "--cipher", dest="cipher",
-        help = "Cipher to encript communication. "
+        help="Cipher to encript communication. "
             "One of PLAIN, AES, Blowfish, DES, DES3. ",
-        default = None, type="str")
-
+        default=None, type="str")
     parser.add_option("-k", "--cipher-key", dest="cipher_key",
-        help = "Specify a symmetric encryption key with which to protect "
+        help="Specify a symmetric encryption key with which to protect "
             "packets across the tunnel. python-crypto must be installed "
             "on the system." ,
-        default = None, type="str")
+        default=None, type="str")
 
     parser.add_option("-l", "--local-port-file", dest="local_port_file",
         help = "File where to store the local binded UDP port number ", 
         default = "local_port_file", type="str")
-
     parser.add_option("-r", "--remote-port-file", dest="remote_port_file",
         help = "File where to read the remote UDP port number to connect to", 
         default = "remote_port_file", type="str")
-
     parser.add_option("-H", "--remote-host", dest="remote_host",
-        help = "Remote host IP", 
-        default = "remote_host", type="str")
-
+        help = "Remote host IP", default = "remote_host", type="str")
     parser.add_option("-R", "--ret-file", dest="ret_file",
         help = "File where to store return code (success of connection) ", 
         default = "ret_file", type="str")
@@ -178,7 +164,7 @@ if __name__ == '__main__':
 
     # Establish tunnel
     tunchannel.tun_fwd(tun, remote,
-        with_pi = True, # Planetlab TAP devices add PI headers 
+        with_pi = pi, # Planetlab TAP devices add PI headers 
         ether_mode = (vif_type == IFF_TAP),
         udp = True,
         cipher_key = cipher_key,