Skip to content

Commit

Permalink
Add enable-debugger option in 1sw_demo.py. (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f authored Jan 12, 2023
1 parent 9417f2d commit 7c86b70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mininet/1sw_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,24 @@
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)

switch = self.addSwitch('s1',
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),
Expand All @@ -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,
Expand Down

0 comments on commit 7c86b70

Please sign in to comment.