diff --git a/mininet/1sw_demo.py b/mininet/1sw_demo.py index 9744231b6..0f76ed43e 100755 --- a/mininet/1sw_demo.py +++ b/mininet/1sw_demo.py @@ -36,13 +36,15 @@ type=str, action="store", required=True) parser.add_argument('--pcap-dump', help='Dump packets on interfaces to pcap files', type=str, action="store", required=False, default=False) +parser.add_argument('--enable-debugger', help='Enable debugger (Please ensure debugger support is enabled in behavioral exe, as it is disabled by default)', + action="store_true", required=False, default=False) args = parser.parse_args() class SingleSwitchTopo(Topo): "Single switch connected to n (< 256) hosts." - def __init__(self, sw_path, json_path, thrift_port, pcap_dump, n, **opts): + def __init__(self, sw_path, json_path, thrift_port, pcap_dump, enable_debugger, n, **opts): # Initialize topology and default options Topo.__init__(self, **opts) @@ -50,7 +52,8 @@ def __init__(self, sw_path, json_path, thrift_port, pcap_dump, n, **opts): sw_path = sw_path, json_path = json_path, thrift_port = thrift_port, - pcap_dump = pcap_dump) + pcap_dump = pcap_dump, + enable_debugger = enable_debugger) for h in range(n): host = self.addHost('h%d' % (h + 1), @@ -66,6 +69,7 @@ def main(): args.json, args.thrift_port, args.pcap_dump, + args.enable_debugger, num_hosts) net = Mininet(topo = topo, host = P4Host,