From fc8f9b4b1721a029a30bf41e6086cfbff085089d Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Mon, 19 Mar 2018 16:31:31 +0100 Subject: Add a --secondary-network option to run-qemu-ota This sets up a simulated 'in vehicle' network. Add support for a Primary node with a DHCP server and a secondary node with a DHCP client. --- scripts/qemucommand.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/qemucommand.py') diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 6b1106d..e209a07 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -81,6 +81,7 @@ class QemuCommand(object): self.gdb = args.gdb self.pcap = args.pcap self.overlay = args.overlay + self.secondary_network = args.secondary_network def command_line(self): netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port @@ -104,6 +105,11 @@ class QemuCommand(object): ] if self.pcap: cmdline += ['-net', 'dump,file=' + self.pcap] + if self.secondary_network: + cmdline += [ + '-net', 'nic,vlan=1,macaddr='+random_mac(), + '-net', 'socket,vlan=1,mcast=230.0.0.1:1234', + ] if self.gui: cmdline += ["-serial", "stdio"] else: -- cgit v1.2.3-54-g00ecf