Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Scripting/UTM.sdef
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,21 @@
description="Only used in emulated mode. Allows port forwarding from guest to host.">
<type type="qemu port forward" list="yes"/>
</property>

<property name="vlan guest address" code="VgAd" type="text"
description="IPv4 subnet of the emulated VLAN in CIDR notation (e.g. 192.168.222.0/24). Only used in shared or host mode. If empty, the existing value is preserved."/>

<property name="vlan guest address ipv6" code="Vga6" type="text"
description="IPv6 prefix of the emulated VLAN (e.g. fec0::/64). Only used in shared or host mode. If empty, the existing value is preserved."/>

<property name="vlan dhcp start address" code="VdSt" type="text"
description="First IPv4 address of the DHCP pool handed to the guest. Only used in shared or host mode. If empty, the existing value is preserved."/>

<property name="vlan dhcp end address" code="VdEn" type="text"
description="Last IPv4 address of the DHCP pool handed to the guest. Only used in shared or host mode. If empty, the existing value is preserved."/>

<property name="isolate from host" code="IsFh" type="boolean"
description="When true, the guest is isolated from the host on the shared network."/>
</record-type>

<enumeration name="qemu network mode" code="QeNm" description="Mode for networking device.">
Expand Down
20 changes: 20 additions & 0 deletions Scripting/UTMScriptingConfigImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ extension UTMScriptingConfigImpl {
"address": config.macAddress,
"hostInterface": config.bridgeInterface ?? "",
"portForwards": config.portForward.map({ serializeQemuPortForward($0) }),
"vlanGuestAddress": config.vlanGuestAddress ?? "",
"vlanGuestAddressIpv6": config.vlanGuestAddressIPv6 ?? "",
"vlanDhcpStartAddress": config.vlanDhcpStartAddress ?? "",
"vlanDhcpEndAddress": config.vlanDhcpEndAddress ?? "",
"isolateFromHost": config.isIsolateFromHost,
]
}

Expand Down Expand Up @@ -487,6 +492,21 @@ extension UTMScriptingConfigImpl {
if let portForwards = record["portForwards"] as? [[AnyHashable : Any]] {
network.portForward = portForwards.map({ unserializeQemuPortForward(from: $0) })
}
if let value = record["vlanGuestAddress"] as? String, !value.isEmpty {
network.vlanGuestAddress = value
}
if let value = record["vlanGuestAddressIpv6"] as? String, !value.isEmpty {
network.vlanGuestAddressIPv6 = value
}
if let value = record["vlanDhcpStartAddress"] as? String, !value.isEmpty {
network.vlanDhcpStartAddress = value
}
if let value = record["vlanDhcpEndAddress"] as? String, !value.isEmpty {
network.vlanDhcpEndAddress = value
}
if let value = record["isolateFromHost"] as? Bool {
network.isIsolateFromHost = value
}
}

private func parseNetworkProtocol(_ value: AEKeyword?) -> QEMUNetworkProtocol? {
Expand Down