Documentation
¶
Overview ¶
Package network provides network configuration helpers for Apple Virtualization virtual machines.
It covers the common network attachment modes used by vzkit's high-level VM builders and exposes lower-level attachment constructors for callers that need more control.
Index ¶
- func CreateAttachment(cfg Config) (vz.VZNetworkDeviceAttachment, error)
- func CreateBridgedAttachment(identifier string, macNAT bool) (vz.VZNetworkDeviceAttachment, error)
- func CreateDevice(cfg Config) (vz.VZVirtioNetworkDeviceConfiguration, error)
- func CreateHostOnlyNetworkAttachment() (vz.VZNetworkDeviceAttachment, error)
- func CreateNATAttachment(isolate bool) (vz.VZNetworkDeviceAttachment, error)
- func CreateVhostUserNetworkAttachment(cfg VhostUserConfig) (vz.VZNetworkDeviceAttachment, error)
- func LookupBridgedNetworkInterface(identifier string) (vz.VZBridgedNetworkInterface, error)
- type Config
- type Mode
- type VhostUserConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAttachment ¶
func CreateAttachment(cfg Config) (vz.VZNetworkDeviceAttachment, error)
CreateAttachment creates a network device attachment based on cfg.
func CreateBridgedAttachment ¶
func CreateBridgedAttachment(identifier string, macNAT bool) (vz.VZNetworkDeviceAttachment, error)
CreateBridgedAttachment creates a bridged attachment for the named interface.
func CreateDevice ¶
func CreateDevice(cfg Config) (vz.VZVirtioNetworkDeviceConfiguration, error)
CreateDevice creates a Virtio network device with a random MAC address.
func CreateHostOnlyNetworkAttachment ¶
func CreateHostOnlyNetworkAttachment() (vz.VZNetworkDeviceAttachment, error)
CreateHostOnlyNetworkAttachment creates a host-only attachment.
func CreateNATAttachment ¶
func CreateNATAttachment(isolate bool) (vz.VZNetworkDeviceAttachment, error)
CreateNATAttachment creates a NAT attachment.
func CreateVhostUserNetworkAttachment ¶
func CreateVhostUserNetworkAttachment(cfg VhostUserConfig) (vz.VZNetworkDeviceAttachment, error)
CreateVhostUserNetworkAttachment creates a private vhost-user attachment.
func LookupBridgedNetworkInterface ¶
func LookupBridgedNetworkInterface(identifier string) (vz.VZBridgedNetworkInterface, error)
LookupBridgedNetworkInterface resolves a bridged interface by identifier.
Types ¶
type VhostUserConfig ¶
type VhostUserConfig struct {
Interface string
XPCService int64
MaximumTransmissionUnit int64
HostChecksumOffload int64
GuestChecksumOffload int64
HostTCPSegmentationOffload int64
GuestTCPSegmentationOffload int64
}
VhostUserConfig describes a private vhost-user network attachment.
func DefaultVhostUserConfig ¶
func DefaultVhostUserConfig(interfaceName string) VhostUserConfig
DefaultVhostUserConfig returns a config populated with framework defaults.