Documentation
¶
Overview ¶
Package vmnet provides Go bindings for the vmnet framework.
Connect with network interfaces to read and write packets on guest operating systems.
The vmnet framework is an API for virtual machines to read and write packets.
Essentials ¶
- com.apple.vm.networking: A Boolean that indicates whether the app manages virtual network interfaces without escalating privileges to the root user.
Starting and Stopping Interfaces ¶
- Vmnet_start_interface: Starts host or shared mode on an interface with a specified configuration.
- Vmnet_interface_set_event_callback: Schedules a callback to be executed when events for the specified interface are received.
- Vmnet_stop_interface: Stops the interface.
Reading and Writing Packets ¶
- Vmnet_read: Attempts to read a specified number of packets from an interface.
- Vmnet_write: Attempts to write specified packets to an interface.
Data Types ¶
- Vmnet_return_t: Values returned by functions in the vmnet Framework.
- Vmpktdesc: Describes a packet.
- Interface_ref: A virtual network interface.
- Interface_event_t: Interface event types.
- Operating_modes_t: The operating modes for an interface.
Constants ¶
- interface_desc XPC Dictionary Keys: XPC dictionary keys supported by the parameter passed to the function to describe the parameters of the network interface.
- interface_param XPC Dictionary Keys: XPC dictionary keys used by the argument returned by the completion handler of the function that describes the parameters that should be used to configure the network interface.
- event XPC Dictionary: XPC dictionary keys used by the value returned to the client in the callback specified by the function that provides information about the callback event.
Variables ¶
- [vmnet_enable_virtio_header_key]
- [vmnet_read_max_packets_key]
- [vmnet_write_max_packets_key]
Functions ¶
- Vmnet_interface_start_with_network
- Vmnet_network_configuration_add_dhcp_reservation
- Vmnet_network_configuration_add_port_forwarding_rule
- Vmnet_network_configuration_create
- Vmnet_network_configuration_disable_dhcp
- Vmnet_network_configuration_disable_dns_proxy
- Vmnet_network_configuration_disable_nat44
- Vmnet_network_configuration_disable_nat66
- Vmnet_network_configuration_disable_router_advertisement
- Vmnet_network_configuration_set_external_interface
- Vmnet_network_configuration_set_ipv4_subnet
- Vmnet_network_configuration_set_ipv6_prefix
- Vmnet_network_configuration_set_mtu
- Vmnet_network_copy_serialization
- Vmnet_network_create
- Vmnet_network_create_with_serialization
- Vmnet_network_get_ipv4_subnet
- Vmnet_network_get_ipv6_prefix
Macros ¶
- [vmnet_enable_virtio_header_key]
Type Aliases ¶
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- func BindFunc(fptr any, name string) (err error)
- func NewVmnetInterfaceCompletionHandlerBlock(handler VmnetInterfaceCompletionHandler) (objc.ID, func())
- func NewVmnetInterfaceEventCallbackBlock(handler VmnetInterfaceEventCallback) (objc.ID, func())
- func NewVmnetInterfaceGetIPPortForwardingRulesHandlerBlock(handler VmnetInterfaceGetIPPortForwardingRulesHandler) (objc.ID, func())
- func NewVmnetInterfaceGetPortForwardingRulesHandlerBlock(handler VmnetInterfaceGetPortForwardingRulesHandler) (objc.ID, func())
- func NewVmnetStartInterfaceCompletionHandlerBlock(handler VmnetStartInterfaceCompletionHandler) (objc.ID, func())
- func SymbolAddress(name string) (uintptr, error)
- func TryVmnet_copy_shared_interface_list() (xpc.Xpc_object_t, error)
- func TryVmnet_network_configuration_disable_dhcp(config Vmnet_network_configuration_ref) error
- func TryVmnet_network_configuration_disable_dns_proxy(config Vmnet_network_configuration_ref) error
- func TryVmnet_network_configuration_disable_nat44(config Vmnet_network_configuration_ref) error
- func TryVmnet_network_configuration_disable_nat66(config Vmnet_network_configuration_ref) error
- func TryVmnet_network_configuration_disable_router_advertisement(config Vmnet_network_configuration_ref) error
- func TryVmnet_network_copy_serialization(network Vmnet_network_ref, status *Vmnet_return_t) (xpc.Xpc_object_t, error)
- func TryVmnet_network_get_ipv4_subnet(network Vmnet_network_ref, subnet *kernel.InAddr, mask *kernel.InAddr) error
- func TryVmnet_network_get_ipv6_prefix(network Vmnet_network_ref, prefix unsafe.Pointer, prefix_len []byte) error
- func Vmnet_copy_shared_interface_list() xpc.Xpc_object_t
- func Vmnet_network_configuration_disable_dhcp(config Vmnet_network_configuration_ref)
- func Vmnet_network_configuration_disable_dns_proxy(config Vmnet_network_configuration_ref)
- func Vmnet_network_configuration_disable_nat44(config Vmnet_network_configuration_ref)
- func Vmnet_network_configuration_disable_nat66(config Vmnet_network_configuration_ref)
- func Vmnet_network_configuration_disable_router_advertisement(config Vmnet_network_configuration_ref)
- func Vmnet_network_copy_serialization(network Vmnet_network_ref, status *Vmnet_return_t) xpc.Xpc_object_t
- func Vmnet_network_get_ipv4_subnet(network Vmnet_network_ref, subnet *kernel.InAddr, mask *kernel.InAddr)
- func Vmnet_network_get_ipv6_prefix(network Vmnet_network_ref, prefix unsafe.Pointer, prefix_len []byte)
- type InterfaceEvent
- type InterfaceRef
- type Interface_event_t
- type Interface_ref
- func TryVmnet_interface_start_with_network(network Vmnet_network_ref, interface_desc xpc.Xpc_object_t, ...) (Interface_ref, error)
- func TryVmnet_start_interface(interface_desc xpc.Xpc_object_t, queue dispatch.Queue, ...) (Interface_ref, error)
- func Vmnet_interface_start_with_network(network Vmnet_network_ref, interface_desc xpc.Xpc_object_t, ...) Interface_ref
- func Vmnet_start_interface(interface_desc xpc.Xpc_object_t, queue dispatch.Queue, ...) Interface_ref
- type OperatingModes
- type Operating_modes_t
- type VmnetInterfaceCompletionHandler
- type VmnetInterfaceEventCallback
- type VmnetInterfaceGetIPPortForwardingRulesHandler
- type VmnetInterfaceGetPortForwardingRulesHandler
- type VmnetMode
- type VmnetNetworkConfigurationRef
- type VmnetNetworkRef
- type VmnetReturn
- type VmnetStartInterfaceCompletionHandler
- type Vmnet_interface_completion_handler_t
- type Vmnet_interface_event_callback_t
- type Vmnet_interface_get_ip_port_forwarding_rules_handler_t
- type Vmnet_interface_get_port_forwarding_rules_handler_t
- type Vmnet_mode_t
- type Vmnet_network_configuration_ref
- type Vmnet_network_ref
- func TryVmnet_network_create(configuration Vmnet_network_configuration_ref, status *Vmnet_return_t) (Vmnet_network_ref, error)
- func TryVmnet_network_create_with_serialization(network xpc.Xpc_object_t, status *Vmnet_return_t) (Vmnet_network_ref, error)
- func Vmnet_network_create(configuration Vmnet_network_configuration_ref, status *Vmnet_return_t) Vmnet_network_ref
- func Vmnet_network_create_with_serialization(network xpc.Xpc_object_t, status *Vmnet_return_t) Vmnet_network_ref
- type Vmnet_return_t
- func TryVmnet_interface_add_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_add_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_get_ip_port_forwarding_rules(interface_ Interface_ref, address_family uint8, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_get_port_forwarding_rules(interface_ Interface_ref, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_remove_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_remove_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_interface_set_event_callback(interface_ Interface_ref, event_mask Interface_event_t, queue dispatch.Queue, ...) (Vmnet_return_t, error)
- func TryVmnet_ip_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_add_dhcp_reservation(config Vmnet_network_configuration_ref, client *[6]byte, ...) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_add_port_forwarding_rule(config Vmnet_network_configuration_ref, protocol_ uint8, address_family uint8, ...) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_set_external_interface(config Vmnet_network_configuration_ref, interface_name string) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_set_ipv4_subnet(config Vmnet_network_configuration_ref, subnet_addr *kernel.InAddr, ...) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_set_ipv6_prefix(config Vmnet_network_configuration_ref, prefix unsafe.Pointer, len_ uint8) (Vmnet_return_t, error)
- func TryVmnet_network_configuration_set_mtu(config Vmnet_network_configuration_ref, mtu uint32) (Vmnet_return_t, error)
- func TryVmnet_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, ...) (Vmnet_return_t, error)
- func TryVmnet_read(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) (Vmnet_return_t, error)
- func TryVmnet_stop_interface(interface_ Interface_ref, queue dispatch.Queue, ...) (Vmnet_return_t, error)
- func TryVmnet_write(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) (Vmnet_return_t, error)
- func Vmnet_interface_add_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) Vmnet_return_t
- func Vmnet_interface_add_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) Vmnet_return_tdeprecated
- func Vmnet_interface_get_ip_port_forwarding_rules(interface_ Interface_ref, address_family uint8, ...) Vmnet_return_t
- func Vmnet_interface_get_port_forwarding_rules(interface_ Interface_ref, ...) Vmnet_return_tdeprecated
- func Vmnet_interface_remove_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) Vmnet_return_t
- func Vmnet_interface_remove_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, ...) Vmnet_return_tdeprecated
- func Vmnet_interface_set_event_callback(interface_ Interface_ref, event_mask Interface_event_t, queue dispatch.Queue, ...) Vmnet_return_t
- func Vmnet_ip_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, ...) Vmnet_return_t
- func Vmnet_network_configuration_add_dhcp_reservation(config Vmnet_network_configuration_ref, client *[6]byte, ...) Vmnet_return_t
- func Vmnet_network_configuration_add_port_forwarding_rule(config Vmnet_network_configuration_ref, protocol_ uint8, address_family uint8, ...) Vmnet_return_t
- func Vmnet_network_configuration_set_external_interface(config Vmnet_network_configuration_ref, interface_name string) Vmnet_return_t
- func Vmnet_network_configuration_set_ipv4_subnet(config Vmnet_network_configuration_ref, subnet_addr *kernel.InAddr, ...) Vmnet_return_t
- func Vmnet_network_configuration_set_ipv6_prefix(config Vmnet_network_configuration_ref, prefix unsafe.Pointer, len_ uint8) Vmnet_return_t
- func Vmnet_network_configuration_set_mtu(config Vmnet_network_configuration_ref, mtu uint32) Vmnet_return_t
- func Vmnet_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, ...) Vmnet_return_tdeprecated
- func Vmnet_read(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) Vmnet_return_t
- func Vmnet_stop_interface(interface_ Interface_ref, queue dispatch.Queue, ...) Vmnet_return_t
- func Vmnet_write(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) Vmnet_return_t
- type Vmnet_start_interface_completion_handler_t
- type Vmpktdesc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFunc ¶
BindFunc binds the vmnet symbol name into fptr, which must be a pointer to a func variable.
The caller supplies the signature, and nothing checks it. A dylib records no argument count or types for a C symbol, so a wrong signature here is not a type error: it is the wrong number of machine words moved on a live stack, and the failure surfaces somewhere else entirely. Prefer a generated binding, whose signature carries recorded evidence, and reach for this only for a symbol that has none. purego.RegisterFunc panics on a signature it cannot lower; that is recovered and returned, because an escape hatch that takes down the process on a mistyped experiment is not one anybody can experiment with.
func NewVmnetInterfaceCompletionHandlerBlock ¶ added in v0.6.16
func NewVmnetInterfaceCompletionHandlerBlock(handler VmnetInterfaceCompletionHandler) (objc.ID, func())
NewVmnetInterfaceCompletionHandlerBlock wraps a Go VmnetInterfaceCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewVmnetInterfaceEventCallbackBlock ¶ added in v0.6.16
func NewVmnetInterfaceEventCallbackBlock(handler VmnetInterfaceEventCallback) (objc.ID, func())
NewVmnetInterfaceEventCallbackBlock wraps a Go VmnetInterfaceEventCallback as an Objective-C block. The caller must defer the returned cleanup function.
func NewVmnetInterfaceGetIPPortForwardingRulesHandlerBlock ¶ added in v0.6.16
func NewVmnetInterfaceGetIPPortForwardingRulesHandlerBlock(handler VmnetInterfaceGetIPPortForwardingRulesHandler) (objc.ID, func())
NewVmnetInterfaceGetIPPortForwardingRulesHandlerBlock wraps a Go VmnetInterfaceGetIPPortForwardingRulesHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewVmnetInterfaceGetPortForwardingRulesHandlerBlock ¶ added in v0.6.16
func NewVmnetInterfaceGetPortForwardingRulesHandlerBlock(handler VmnetInterfaceGetPortForwardingRulesHandler) (objc.ID, func())
NewVmnetInterfaceGetPortForwardingRulesHandlerBlock wraps a Go VmnetInterfaceGetPortForwardingRulesHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewVmnetStartInterfaceCompletionHandlerBlock ¶ added in v0.6.16
func NewVmnetStartInterfaceCompletionHandlerBlock(handler VmnetStartInterfaceCompletionHandler) (objc.ID, func())
NewVmnetStartInterfaceCompletionHandlerBlock wraps a Go VmnetStartInterfaceCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.
func SymbolAddress ¶
SymbolAddress returns the address of name in vmnet, whether or not this package generated a binding for it.
What is generated is bounded by what is documented, and for a private framework that is whatever a manifest happened to enumerate. The dylib usually exports far more. Without this, a symbol nobody wrote down is unreachable from a package that has already loaded the image holding it, and the generated surface becomes a ceiling instead of a floor.
The lookup is scoped to this framework's handle, not RTLD_DEFAULT, so a symbol some other loaded image exports is not reported as this one's.
func TryVmnet_copy_shared_interface_list ¶
func TryVmnet_copy_shared_interface_list() (xpc.Xpc_object_t, error)
TryVmnet_copy_shared_interface_list is like Vmnet_copy_shared_interface_list but returns an error instead of panicking if vmnet_copy_shared_interface_list is unavailable at run time.
func TryVmnet_network_configuration_disable_dhcp ¶
func TryVmnet_network_configuration_disable_dhcp(config Vmnet_network_configuration_ref) error
TryVmnet_network_configuration_disable_dhcp is like Vmnet_network_configuration_disable_dhcp but returns an error instead of panicking if vmnet_network_configuration_disable_dhcp is unavailable at run time.
func TryVmnet_network_configuration_disable_dns_proxy ¶
func TryVmnet_network_configuration_disable_dns_proxy(config Vmnet_network_configuration_ref) error
TryVmnet_network_configuration_disable_dns_proxy is like Vmnet_network_configuration_disable_dns_proxy but returns an error instead of panicking if vmnet_network_configuration_disable_dns_proxy is unavailable at run time.
func TryVmnet_network_configuration_disable_nat44 ¶
func TryVmnet_network_configuration_disable_nat44(config Vmnet_network_configuration_ref) error
TryVmnet_network_configuration_disable_nat44 is like Vmnet_network_configuration_disable_nat44 but returns an error instead of panicking if vmnet_network_configuration_disable_nat44 is unavailable at run time.
func TryVmnet_network_configuration_disable_nat66 ¶
func TryVmnet_network_configuration_disable_nat66(config Vmnet_network_configuration_ref) error
TryVmnet_network_configuration_disable_nat66 is like Vmnet_network_configuration_disable_nat66 but returns an error instead of panicking if vmnet_network_configuration_disable_nat66 is unavailable at run time.
func TryVmnet_network_configuration_disable_router_advertisement ¶
func TryVmnet_network_configuration_disable_router_advertisement(config Vmnet_network_configuration_ref) error
TryVmnet_network_configuration_disable_router_advertisement is like Vmnet_network_configuration_disable_router_advertisement but returns an error instead of panicking if vmnet_network_configuration_disable_router_advertisement is unavailable at run time.
func TryVmnet_network_copy_serialization ¶
func TryVmnet_network_copy_serialization(network Vmnet_network_ref, status *Vmnet_return_t) (xpc.Xpc_object_t, error)
TryVmnet_network_copy_serialization is like Vmnet_network_copy_serialization but returns an error instead of panicking if vmnet_network_copy_serialization is unavailable at run time.
func TryVmnet_network_get_ipv4_subnet ¶
func TryVmnet_network_get_ipv4_subnet(network Vmnet_network_ref, subnet *kernel.InAddr, mask *kernel.InAddr) error
TryVmnet_network_get_ipv4_subnet is like Vmnet_network_get_ipv4_subnet but returns an error instead of panicking if vmnet_network_get_ipv4_subnet is unavailable at run time.
func TryVmnet_network_get_ipv6_prefix ¶
func TryVmnet_network_get_ipv6_prefix(network Vmnet_network_ref, prefix unsafe.Pointer, prefix_len []byte) error
TryVmnet_network_get_ipv6_prefix is like Vmnet_network_get_ipv6_prefix but returns an error instead of panicking if vmnet_network_get_ipv6_prefix is unavailable at run time.
func Vmnet_copy_shared_interface_list ¶
func Vmnet_copy_shared_interface_list() xpc.Xpc_object_t
Vmnet_copy_shared_interface_list.
It panics if vmnet_copy_shared_interface_list is unavailable at run time; use TryVmnet_copy_shared_interface_list to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_copy_shared_interface_list()
func Vmnet_network_configuration_disable_dhcp ¶
func Vmnet_network_configuration_disable_dhcp(config Vmnet_network_configuration_ref)
Vmnet_network_configuration_disable_dhcp.
It panics if vmnet_network_configuration_disable_dhcp is unavailable at run time; use TryVmnet_network_configuration_disable_dhcp to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_disable_dhcp(_:)
func Vmnet_network_configuration_disable_dns_proxy ¶
func Vmnet_network_configuration_disable_dns_proxy(config Vmnet_network_configuration_ref)
Vmnet_network_configuration_disable_dns_proxy.
It panics if vmnet_network_configuration_disable_dns_proxy is unavailable at run time; use TryVmnet_network_configuration_disable_dns_proxy to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_disable_dns_proxy(_:)
func Vmnet_network_configuration_disable_nat44 ¶
func Vmnet_network_configuration_disable_nat44(config Vmnet_network_configuration_ref)
Vmnet_network_configuration_disable_nat44.
It panics if vmnet_network_configuration_disable_nat44 is unavailable at run time; use TryVmnet_network_configuration_disable_nat44 to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_disable_nat44(_:)
func Vmnet_network_configuration_disable_nat66 ¶
func Vmnet_network_configuration_disable_nat66(config Vmnet_network_configuration_ref)
Vmnet_network_configuration_disable_nat66.
It panics if vmnet_network_configuration_disable_nat66 is unavailable at run time; use TryVmnet_network_configuration_disable_nat66 to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_disable_nat66(_:)
func Vmnet_network_configuration_disable_router_advertisement ¶
func Vmnet_network_configuration_disable_router_advertisement(config Vmnet_network_configuration_ref)
Vmnet_network_configuration_disable_router_advertisement.
It panics if vmnet_network_configuration_disable_router_advertisement is unavailable at run time; use TryVmnet_network_configuration_disable_router_advertisement to get an error instead.
func Vmnet_network_copy_serialization ¶
func Vmnet_network_copy_serialization(network Vmnet_network_ref, status *Vmnet_return_t) xpc.Xpc_object_t
Vmnet_network_copy_serialization.
It panics if vmnet_network_copy_serialization is unavailable at run time; use TryVmnet_network_copy_serialization to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_copy_serialization(_:_:)
func Vmnet_network_get_ipv4_subnet ¶
func Vmnet_network_get_ipv4_subnet(network Vmnet_network_ref, subnet *kernel.InAddr, mask *kernel.InAddr)
Vmnet_network_get_ipv4_subnet.
It panics if vmnet_network_get_ipv4_subnet is unavailable at run time; use TryVmnet_network_get_ipv4_subnet to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_get_ipv4_subnet(_:_:_:)
func Vmnet_network_get_ipv6_prefix ¶
func Vmnet_network_get_ipv6_prefix(network Vmnet_network_ref, prefix unsafe.Pointer, prefix_len []byte)
Vmnet_network_get_ipv6_prefix.
It panics if vmnet_network_get_ipv6_prefix is unavailable at run time; use TryVmnet_network_get_ipv6_prefix to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_get_ipv6_prefix(_:_:_:)
Types ¶
type InterfaceEvent ¶ added in v0.6.4
type InterfaceEvent = Interface_event_t
InterfaceEvent is a Go-name alias for Interface_event_t.
type InterfaceRef ¶ added in v0.6.4
type InterfaceRef = Interface_ref
InterfaceRef is a Go-name alias for Interface_ref.
type Interface_event_t ¶
type Interface_event_t uint32
See: https://developer.apple.com/documentation/vmnet/interface_event_t
const ( // VMNET_INTERFACE_PACKETS_AVAILABLE: # Discussion VMNET_INTERFACE_PACKETS_AVAILABLE Interface_event_t = 1 )
func (Interface_event_t) String ¶
func (e Interface_event_t) String() string
type Interface_ref ¶
type Interface_ref = uintptr
Interface_ref is a virtual network interface.
See: https://developer.apple.com/documentation/vmnet/interface_ref
func TryVmnet_interface_start_with_network ¶
func TryVmnet_interface_start_with_network(network Vmnet_network_ref, interface_desc xpc.Xpc_object_t, queue dispatch.Queue, start_block Vmnet_start_interface_completion_handler_t) (Interface_ref, error)
TryVmnet_interface_start_with_network is like Vmnet_interface_start_with_network but returns an error instead of panicking if vmnet_interface_start_with_network is unavailable at run time.
func TryVmnet_start_interface ¶
func TryVmnet_start_interface(interface_desc xpc.Xpc_object_t, queue dispatch.Queue, handler Vmnet_start_interface_completion_handler_t) (Interface_ref, error)
TryVmnet_start_interface is like Vmnet_start_interface but returns an error instead of panicking if vmnet_start_interface is unavailable at run time.
func Vmnet_interface_start_with_network ¶
func Vmnet_interface_start_with_network(network Vmnet_network_ref, interface_desc xpc.Xpc_object_t, queue dispatch.Queue, start_block Vmnet_start_interface_completion_handler_t) Interface_ref
Vmnet_interface_start_with_network.
It panics if vmnet_interface_start_with_network is unavailable at run time; use TryVmnet_interface_start_with_network to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_start_with_network(_:_:_:_:)
func Vmnet_start_interface ¶
func Vmnet_start_interface(interface_desc xpc.Xpc_object_t, queue dispatch.Queue, handler Vmnet_start_interface_completion_handler_t) Interface_ref
Vmnet_start_interface starts host or shared mode on an interface with a specified configuration.
It panics if vmnet_start_interface is unavailable at run time; use TryVmnet_start_interface to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_start_interface(_:_:_:)
type OperatingModes ¶ added in v0.6.4
type OperatingModes = Operating_modes_t
OperatingModes is a Go-name alias for Operating_modes_t.
type Operating_modes_t ¶
type Operating_modes_t uint32
See: https://developer.apple.com/documentation/vmnet/operating_modes_t
const ( VMNET_BRIDGED_MODE Operating_modes_t = 1002 // VMNET_HOST_MODE: # Discussion VMNET_HOST_MODE Operating_modes_t = 1000 // VMNET_SHARED_MODE: # Discussion VMNET_SHARED_MODE Operating_modes_t = 1001 )
func (Operating_modes_t) String ¶ added in v0.5.1
func (e Operating_modes_t) String() string
type VmnetInterfaceCompletionHandler ¶ added in v0.6.4
type VmnetInterfaceCompletionHandler = Vmnet_interface_completion_handler_t
VmnetInterfaceCompletionHandler is a Go-name alias for Vmnet_interface_completion_handler_t.
type VmnetInterfaceEventCallback ¶ added in v0.6.4
type VmnetInterfaceEventCallback = Vmnet_interface_event_callback_t
VmnetInterfaceEventCallback is a Go-name alias for Vmnet_interface_event_callback_t.
type VmnetInterfaceGetIPPortForwardingRulesHandler ¶ added in v0.6.4
type VmnetInterfaceGetIPPortForwardingRulesHandler = Vmnet_interface_get_ip_port_forwarding_rules_handler_t
VmnetInterfaceGetIPPortForwardingRulesHandler is a Go-name alias for Vmnet_interface_get_ip_port_forwarding_rules_handler_t.
type VmnetInterfaceGetPortForwardingRulesHandler ¶ added in v0.6.4
type VmnetInterfaceGetPortForwardingRulesHandler = Vmnet_interface_get_port_forwarding_rules_handler_t
VmnetInterfaceGetPortForwardingRulesHandler is a Go-name alias for Vmnet_interface_get_port_forwarding_rules_handler_t.
type VmnetMode ¶ added in v0.6.4
type VmnetMode = Vmnet_mode_t
VmnetMode is a Go-name alias for Vmnet_mode_t.
type VmnetNetworkConfigurationRef ¶ added in v0.6.4
type VmnetNetworkConfigurationRef = Vmnet_network_configuration_ref
VmnetNetworkConfigurationRef is a Go-name alias for Vmnet_network_configuration_ref.
type VmnetNetworkRef ¶ added in v0.6.4
type VmnetNetworkRef = Vmnet_network_ref
VmnetNetworkRef is a Go-name alias for Vmnet_network_ref.
type VmnetReturn ¶ added in v0.6.4
type VmnetReturn = Vmnet_return_t
VmnetReturn is a Go-name alias for Vmnet_return_t.
type VmnetStartInterfaceCompletionHandler ¶ added in v0.6.4
type VmnetStartInterfaceCompletionHandler = Vmnet_start_interface_completion_handler_t
VmnetStartInterfaceCompletionHandler is a Go-name alias for Vmnet_start_interface_completion_handler_t.
type Vmnet_interface_completion_handler_t ¶
type Vmnet_interface_completion_handler_t = func(Vmnet_return_t)
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_completion_handler_t
type Vmnet_interface_event_callback_t ¶
type Vmnet_interface_event_callback_t = func(Interface_event_t, objectivec.Object)
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_event_callback_t
type Vmnet_interface_get_ip_port_forwarding_rules_handler_t ¶
type Vmnet_interface_get_ip_port_forwarding_rules_handler_t = func(objectivec.Object)
type Vmnet_interface_get_port_forwarding_rules_handler_t ¶
type Vmnet_interface_get_port_forwarding_rules_handler_t = func(objectivec.Object)
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_get_port_forwarding_rules_handler_t
type Vmnet_mode_t ¶
type Vmnet_mode_t = Operating_modes_t
See: https://developer.apple.com/documentation/vmnet/vmnet_mode_t
type Vmnet_network_configuration_ref ¶
type Vmnet_network_configuration_ref = uintptr
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_ref
func TryVmnet_network_configuration_create ¶
func TryVmnet_network_configuration_create(mode Operating_modes_t, status *Vmnet_return_t) (Vmnet_network_configuration_ref, error)
TryVmnet_network_configuration_create is like Vmnet_network_configuration_create but returns an error instead of panicking if vmnet_network_configuration_create is unavailable at run time.
func Vmnet_network_configuration_create ¶
func Vmnet_network_configuration_create(mode Operating_modes_t, status *Vmnet_return_t) Vmnet_network_configuration_ref
Vmnet_network_configuration_create.
It panics if vmnet_network_configuration_create is unavailable at run time; use TryVmnet_network_configuration_create to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_create(_:_:)
type Vmnet_network_ref ¶
type Vmnet_network_ref = uintptr
See: https://developer.apple.com/documentation/vmnet/vmnet_network_ref
func TryVmnet_network_create ¶
func TryVmnet_network_create(configuration Vmnet_network_configuration_ref, status *Vmnet_return_t) (Vmnet_network_ref, error)
TryVmnet_network_create is like Vmnet_network_create but returns an error instead of panicking if vmnet_network_create is unavailable at run time.
func TryVmnet_network_create_with_serialization ¶
func TryVmnet_network_create_with_serialization(network xpc.Xpc_object_t, status *Vmnet_return_t) (Vmnet_network_ref, error)
TryVmnet_network_create_with_serialization is like Vmnet_network_create_with_serialization but returns an error instead of panicking if vmnet_network_create_with_serialization is unavailable at run time.
func Vmnet_network_create ¶
func Vmnet_network_create(configuration Vmnet_network_configuration_ref, status *Vmnet_return_t) Vmnet_network_ref
Vmnet_network_create.
It panics if vmnet_network_create is unavailable at run time; use TryVmnet_network_create to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_create(_:_:)
func Vmnet_network_create_with_serialization ¶
func Vmnet_network_create_with_serialization(network xpc.Xpc_object_t, status *Vmnet_return_t) Vmnet_network_ref
Vmnet_network_create_with_serialization.
It panics if vmnet_network_create_with_serialization is unavailable at run time; use TryVmnet_network_create_with_serialization to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_create_with_serialization(_:_:)
type Vmnet_return_t ¶
type Vmnet_return_t uint32
See: https://developer.apple.com/documentation/vmnet/vmnet_return_t
const ( // VMNET_BUFFER_EXHAUSTED: # Discussion VMNET_BUFFER_EXHAUSTED Vmnet_return_t = 1007 // VMNET_FAILURE: # Discussion VMNET_FAILURE Vmnet_return_t = 1001 // VMNET_INVALID_ACCESS: # Discussion VMNET_INVALID_ACCESS Vmnet_return_t = 1005 // VMNET_INVALID_ARGUMENT: # Discussion VMNET_INVALID_ARGUMENT Vmnet_return_t = 1003 // VMNET_MEM_FAILURE: # Discussion VMNET_MEM_FAILURE Vmnet_return_t = 1002 VMNET_NOT_AUTHORIZED Vmnet_return_t = 1010 // VMNET_PACKET_TOO_BIG: # Discussion VMNET_PACKET_TOO_BIG Vmnet_return_t = 1006 // VMNET_SETUP_INCOMPLETE: # Discussion VMNET_SETUP_INCOMPLETE Vmnet_return_t = 1004 VMNET_SHARING_SERVICE_BUSY Vmnet_return_t = 1009 // VMNET_SUCCESS: # Discussion VMNET_SUCCESS Vmnet_return_t = 1000 // VMNET_TOO_MANY_PACKETS: # Discussion VMNET_TOO_MANY_PACKETS Vmnet_return_t = 1008 )
func TryVmnet_interface_add_ip_port_forwarding_rule ¶
func TryVmnet_interface_add_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, address_family uint8, internal_address unsafe.Pointer, internal_port uint16, handler Vmnet_interface_completion_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_add_ip_port_forwarding_rule is like Vmnet_interface_add_ip_port_forwarding_rule but returns an error instead of panicking if vmnet_interface_add_ip_port_forwarding_rule is unavailable at run time.
func TryVmnet_interface_add_port_forwarding_rule ¶
func TryVmnet_interface_add_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, internal_address kernel.In_addr, internal_port uint16, handler Vmnet_interface_completion_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_add_port_forwarding_rule is like Vmnet_interface_add_port_forwarding_rule but returns an error instead of panicking if vmnet_interface_add_port_forwarding_rule is unavailable at run time.
func TryVmnet_interface_get_ip_port_forwarding_rules ¶
func TryVmnet_interface_get_ip_port_forwarding_rules(interface_ Interface_ref, address_family uint8, handler Vmnet_interface_get_ip_port_forwarding_rules_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_get_ip_port_forwarding_rules is like Vmnet_interface_get_ip_port_forwarding_rules but returns an error instead of panicking if vmnet_interface_get_ip_port_forwarding_rules is unavailable at run time.
func TryVmnet_interface_get_port_forwarding_rules ¶
func TryVmnet_interface_get_port_forwarding_rules(interface_ Interface_ref, handler Vmnet_interface_get_port_forwarding_rules_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_get_port_forwarding_rules is like Vmnet_interface_get_port_forwarding_rules but returns an error instead of panicking if vmnet_interface_get_port_forwarding_rules is unavailable at run time.
func TryVmnet_interface_remove_ip_port_forwarding_rule ¶
func TryVmnet_interface_remove_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, address_family uint8, handler Vmnet_interface_completion_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_remove_ip_port_forwarding_rule is like Vmnet_interface_remove_ip_port_forwarding_rule but returns an error instead of panicking if vmnet_interface_remove_ip_port_forwarding_rule is unavailable at run time.
func TryVmnet_interface_remove_port_forwarding_rule ¶
func TryVmnet_interface_remove_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, handler Vmnet_interface_completion_handler_t) (Vmnet_return_t, error)
TryVmnet_interface_remove_port_forwarding_rule is like Vmnet_interface_remove_port_forwarding_rule but returns an error instead of panicking if vmnet_interface_remove_port_forwarding_rule is unavailable at run time.
func TryVmnet_interface_set_event_callback ¶
func TryVmnet_interface_set_event_callback(interface_ Interface_ref, event_mask Interface_event_t, queue dispatch.Queue, callback Vmnet_interface_event_callback_t) (Vmnet_return_t, error)
TryVmnet_interface_set_event_callback is like Vmnet_interface_set_event_callback but returns an error instead of panicking if vmnet_interface_set_event_callback is unavailable at run time.
func TryVmnet_ip_port_forwarding_rule_get_details ¶
func TryVmnet_ip_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, address_family uint8, internal_address unsafe.Pointer, internal_port *uint16) (Vmnet_return_t, error)
TryVmnet_ip_port_forwarding_rule_get_details is like Vmnet_ip_port_forwarding_rule_get_details but returns an error instead of panicking if vmnet_ip_port_forwarding_rule_get_details is unavailable at run time.
func TryVmnet_network_configuration_add_dhcp_reservation ¶
func TryVmnet_network_configuration_add_dhcp_reservation(config Vmnet_network_configuration_ref, client *[6]byte, reservation *kernel.InAddr) (Vmnet_return_t, error)
TryVmnet_network_configuration_add_dhcp_reservation is like Vmnet_network_configuration_add_dhcp_reservation but returns an error instead of panicking if vmnet_network_configuration_add_dhcp_reservation is unavailable at run time.
func TryVmnet_network_configuration_add_port_forwarding_rule ¶
func TryVmnet_network_configuration_add_port_forwarding_rule(config Vmnet_network_configuration_ref, protocol_ uint8, address_family uint8, internal_port uint16, external_port uint16, internal_address unsafe.Pointer) (Vmnet_return_t, error)
TryVmnet_network_configuration_add_port_forwarding_rule is like Vmnet_network_configuration_add_port_forwarding_rule but returns an error instead of panicking if vmnet_network_configuration_add_port_forwarding_rule is unavailable at run time.
func TryVmnet_network_configuration_set_external_interface ¶
func TryVmnet_network_configuration_set_external_interface(config Vmnet_network_configuration_ref, interface_name string) (Vmnet_return_t, error)
TryVmnet_network_configuration_set_external_interface is like Vmnet_network_configuration_set_external_interface but returns an error instead of panicking if vmnet_network_configuration_set_external_interface is unavailable at run time.
func TryVmnet_network_configuration_set_ipv4_subnet ¶
func TryVmnet_network_configuration_set_ipv4_subnet(config Vmnet_network_configuration_ref, subnet_addr *kernel.InAddr, subnet_mask *kernel.InAddr) (Vmnet_return_t, error)
TryVmnet_network_configuration_set_ipv4_subnet is like Vmnet_network_configuration_set_ipv4_subnet but returns an error instead of panicking if vmnet_network_configuration_set_ipv4_subnet is unavailable at run time.
func TryVmnet_network_configuration_set_ipv6_prefix ¶
func TryVmnet_network_configuration_set_ipv6_prefix(config Vmnet_network_configuration_ref, prefix unsafe.Pointer, len_ uint8) (Vmnet_return_t, error)
TryVmnet_network_configuration_set_ipv6_prefix is like Vmnet_network_configuration_set_ipv6_prefix but returns an error instead of panicking if vmnet_network_configuration_set_ipv6_prefix is unavailable at run time.
func TryVmnet_network_configuration_set_mtu ¶
func TryVmnet_network_configuration_set_mtu(config Vmnet_network_configuration_ref, mtu uint32) (Vmnet_return_t, error)
TryVmnet_network_configuration_set_mtu is like Vmnet_network_configuration_set_mtu but returns an error instead of panicking if vmnet_network_configuration_set_mtu is unavailable at run time.
func TryVmnet_port_forwarding_rule_get_details ¶
func TryVmnet_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, internal_address *kernel.InAddr, internal_port *uint16) (Vmnet_return_t, error)
TryVmnet_port_forwarding_rule_get_details is like Vmnet_port_forwarding_rule_get_details but returns an error instead of panicking if vmnet_port_forwarding_rule_get_details is unavailable at run time.
func TryVmnet_read ¶
func TryVmnet_read(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) (Vmnet_return_t, error)
TryVmnet_read is like Vmnet_read but returns an error instead of panicking if vmnet_read is unavailable at run time.
func TryVmnet_stop_interface ¶
func TryVmnet_stop_interface(interface_ Interface_ref, queue dispatch.Queue, handler Vmnet_interface_completion_handler_t) (Vmnet_return_t, error)
TryVmnet_stop_interface is like Vmnet_stop_interface but returns an error instead of panicking if vmnet_stop_interface is unavailable at run time.
func TryVmnet_write ¶
func TryVmnet_write(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) (Vmnet_return_t, error)
TryVmnet_write is like Vmnet_write but returns an error instead of panicking if vmnet_write is unavailable at run time.
func Vmnet_interface_add_ip_port_forwarding_rule ¶
func Vmnet_interface_add_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, address_family uint8, internal_address unsafe.Pointer, internal_port uint16, handler Vmnet_interface_completion_handler_t) Vmnet_return_t
Vmnet_interface_add_ip_port_forwarding_rule.
It panics if vmnet_interface_add_ip_port_forwarding_rule is unavailable at run time; use TryVmnet_interface_add_ip_port_forwarding_rule to get an error instead.
func Vmnet_interface_add_port_forwarding_rule
deprecated
func Vmnet_interface_add_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, internal_address kernel.In_addr, internal_port uint16, handler Vmnet_interface_completion_handler_t) Vmnet_return_t
Vmnet_interface_add_port_forwarding_rule.
It panics if vmnet_interface_add_port_forwarding_rule is unavailable at run time; use TryVmnet_interface_add_port_forwarding_rule to get an error instead.
Deprecated: Deprecated since macOS 12.0.
func Vmnet_interface_get_ip_port_forwarding_rules ¶
func Vmnet_interface_get_ip_port_forwarding_rules(interface_ Interface_ref, address_family uint8, handler Vmnet_interface_get_ip_port_forwarding_rules_handler_t) Vmnet_return_t
Vmnet_interface_get_ip_port_forwarding_rules.
It panics if vmnet_interface_get_ip_port_forwarding_rules is unavailable at run time; use TryVmnet_interface_get_ip_port_forwarding_rules to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_get_ip_port_forwarding_rules(_:_:_:)
func Vmnet_interface_get_port_forwarding_rules
deprecated
func Vmnet_interface_get_port_forwarding_rules(interface_ Interface_ref, handler Vmnet_interface_get_port_forwarding_rules_handler_t) Vmnet_return_t
Vmnet_interface_get_port_forwarding_rules.
It panics if vmnet_interface_get_port_forwarding_rules is unavailable at run time; use TryVmnet_interface_get_port_forwarding_rules to get an error instead.
Deprecated: Deprecated since macOS 12.0.
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_get_port_forwarding_rules(_:_:)
func Vmnet_interface_remove_ip_port_forwarding_rule ¶
func Vmnet_interface_remove_ip_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, address_family uint8, handler Vmnet_interface_completion_handler_t) Vmnet_return_t
Vmnet_interface_remove_ip_port_forwarding_rule.
It panics if vmnet_interface_remove_ip_port_forwarding_rule is unavailable at run time; use TryVmnet_interface_remove_ip_port_forwarding_rule to get an error instead.
func Vmnet_interface_remove_port_forwarding_rule
deprecated
func Vmnet_interface_remove_port_forwarding_rule(interface_ Interface_ref, protocol_ uint8, external_port uint16, handler Vmnet_interface_completion_handler_t) Vmnet_return_t
Vmnet_interface_remove_port_forwarding_rule.
It panics if vmnet_interface_remove_port_forwarding_rule is unavailable at run time; use TryVmnet_interface_remove_port_forwarding_rule to get an error instead.
Deprecated: Deprecated since macOS 12.0.
func Vmnet_interface_set_event_callback ¶
func Vmnet_interface_set_event_callback(interface_ Interface_ref, event_mask Interface_event_t, queue dispatch.Queue, callback Vmnet_interface_event_callback_t) Vmnet_return_t
Vmnet_interface_set_event_callback schedules a callback to be executed when events for the specified interface are received.
It panics if vmnet_interface_set_event_callback is unavailable at run time; use TryVmnet_interface_set_event_callback to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_interface_set_event_callback(_:_:_:_:)
func Vmnet_ip_port_forwarding_rule_get_details ¶
func Vmnet_ip_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, address_family uint8, internal_address unsafe.Pointer, internal_port *uint16) Vmnet_return_t
Vmnet_ip_port_forwarding_rule_get_details.
It panics if vmnet_ip_port_forwarding_rule_get_details is unavailable at run time; use TryVmnet_ip_port_forwarding_rule_get_details to get an error instead.
func Vmnet_network_configuration_add_dhcp_reservation ¶ added in v0.6.3
func Vmnet_network_configuration_add_dhcp_reservation(config Vmnet_network_configuration_ref, client *[6]byte, reservation *kernel.InAddr) Vmnet_return_t
Vmnet_network_configuration_add_dhcp_reservation.
It panics if vmnet_network_configuration_add_dhcp_reservation is unavailable at run time; use TryVmnet_network_configuration_add_dhcp_reservation to get an error instead.
func Vmnet_network_configuration_add_port_forwarding_rule ¶
func Vmnet_network_configuration_add_port_forwarding_rule(config Vmnet_network_configuration_ref, protocol_ uint8, address_family uint8, internal_port uint16, external_port uint16, internal_address unsafe.Pointer) Vmnet_return_t
Vmnet_network_configuration_add_port_forwarding_rule.
It panics if vmnet_network_configuration_add_port_forwarding_rule is unavailable at run time; use TryVmnet_network_configuration_add_port_forwarding_rule to get an error instead.
func Vmnet_network_configuration_set_external_interface ¶
func Vmnet_network_configuration_set_external_interface(config Vmnet_network_configuration_ref, interface_name string) Vmnet_return_t
Vmnet_network_configuration_set_external_interface.
It panics if vmnet_network_configuration_set_external_interface is unavailable at run time; use TryVmnet_network_configuration_set_external_interface to get an error instead.
func Vmnet_network_configuration_set_ipv4_subnet ¶
func Vmnet_network_configuration_set_ipv4_subnet(config Vmnet_network_configuration_ref, subnet_addr *kernel.InAddr, subnet_mask *kernel.InAddr) Vmnet_return_t
Vmnet_network_configuration_set_ipv4_subnet.
It panics if vmnet_network_configuration_set_ipv4_subnet is unavailable at run time; use TryVmnet_network_configuration_set_ipv4_subnet to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_set_ipv4_subnet(_:_:_:)
func Vmnet_network_configuration_set_ipv6_prefix ¶
func Vmnet_network_configuration_set_ipv6_prefix(config Vmnet_network_configuration_ref, prefix unsafe.Pointer, len_ uint8) Vmnet_return_t
Vmnet_network_configuration_set_ipv6_prefix.
It panics if vmnet_network_configuration_set_ipv6_prefix is unavailable at run time; use TryVmnet_network_configuration_set_ipv6_prefix to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_set_ipv6_prefix(_:_:_:)
func Vmnet_network_configuration_set_mtu ¶
func Vmnet_network_configuration_set_mtu(config Vmnet_network_configuration_ref, mtu uint32) Vmnet_return_t
Vmnet_network_configuration_set_mtu.
It panics if vmnet_network_configuration_set_mtu is unavailable at run time; use TryVmnet_network_configuration_set_mtu to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_network_configuration_set_mtu(_:_:)
func Vmnet_port_forwarding_rule_get_details
deprecated
func Vmnet_port_forwarding_rule_get_details(rule xpc.Xpc_object_t, protocol_ []byte, external_port *uint16, internal_address *kernel.InAddr, internal_port *uint16) Vmnet_return_t
Vmnet_port_forwarding_rule_get_details.
It panics if vmnet_port_forwarding_rule_get_details is unavailable at run time; use TryVmnet_port_forwarding_rule_get_details to get an error instead.
Deprecated: Deprecated since macOS 12.0.
See: https://developer.apple.com/documentation/vmnet/vmnet_port_forwarding_rule_get_details(_:_:_:_:_:)
func Vmnet_read ¶
func Vmnet_read(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) Vmnet_return_t
Vmnet_read attempts to read a specified number of packets from an interface.
It panics if vmnet_read is unavailable at run time; use TryVmnet_read to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_read(_:_:_:)
func Vmnet_stop_interface ¶
func Vmnet_stop_interface(interface_ Interface_ref, queue dispatch.Queue, handler Vmnet_interface_completion_handler_t) Vmnet_return_t
Vmnet_stop_interface stops the interface.
It panics if vmnet_stop_interface is unavailable at run time; use TryVmnet_stop_interface to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_stop_interface(_:_:_:)
func Vmnet_write ¶
func Vmnet_write(interface_ Interface_ref, packets *Vmpktdesc, pktcnt *int32) Vmnet_return_t
Vmnet_write attempts to write specified packets to an interface.
It panics if vmnet_write is unavailable at run time; use TryVmnet_write to get an error instead.
See: https://developer.apple.com/documentation/vmnet/vmnet_write(_:_:_:)
func (Vmnet_return_t) String ¶ added in v0.5.1
func (e Vmnet_return_t) String() string
type Vmnet_start_interface_completion_handler_t ¶
type Vmnet_start_interface_completion_handler_t = func(Vmnet_return_t, objectivec.Object)
See: https://developer.apple.com/documentation/vmnet/vmnet_start_interface_completion_handler_t
type Vmpktdesc ¶
type Vmpktdesc struct {
Vm_pkt_size uintptr // The size of the packet, in bytes.
Vm_pkt_iov *kernel.Iovec // An array of packet buffers.
Vm_pkt_iovcnt uint32 // The number of packet buffers in `vm_pkt_iov`.
Vm_flags uint32 // Option flags. Should be set to `0` on read.
}
Vmpktdesc - Describes a packet.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/vmnet/vmpktdesc