xpc_dictionary_set_uint64(if_desc, vmnet_operation_mode_key, VMNET_HOST_MODE);
xpc_dictionary_set_bool(if_desc, vmnet_enable_isolation_key, 0);
xpc_dictionary_set_bool(if_desc, vmnet_allocate_mac_address_key, false);
+ if (macos_vmnet_addr) {
+ xpc_dictionary_set_string(if_desc, vmnet_start_address_key, macos_vmnet_addr);
+ xpc_dictionary_set_string(if_desc, vmnet_end_address_key, macos_vmnet_addr);
+ xpc_dictionary_set_string(if_desc, vmnet_subnet_mask_key, macos_vmnet_netmask);
+ }
+ if (macos_vmnet_nat66_prefix) {
+ xpc_dictionary_set_string(if_desc, vmnet_nat66_prefix_key, macos_vmnet_nat66_prefix);
+ }
dispatch_semaphore_t if_started_sem = dispatch_semaphore_create(0);
vmnet_if = vmnet_start_interface(
#include <sys/types.h>
+char * macos_vmnet_addr;
+char * macos_vmnet_netmask;
+char * macos_vmnet_nat66_prefix;
+
int macos_vmnet_open(void);
int macos_vmnet_close(int fd);
ssize_t macos_vmnet_write(uint8_t *buffer, size_t buflen);
else if(!strcasecmp(type, "vmnet")) {
device = xstrdup("vmnet");
device_type = DEVICE_TYPE_VMNET;
+ get_config_string(lookup_config(&config_tree, "VmnetAddr"), &macos_vmnet_addr);
+ get_config_string(lookup_config(&config_tree, "VmnetNetmask"), &macos_vmnet_netmask);
+ get_config_string(lookup_config(&config_tree, "VmnetNat66Prefix"), &macos_vmnet_nat66_prefix);
}
#endif