VirtualBox Main API
Public Member Functions | Public Attributes | List of all members
INetworkAdapter Interface Reference

Represents a virtual network adapter that is attached to a virtual machine. More...

Inheritance diagram for INetworkAdapter:

Public Member Functions

void getProperty (in wstring key, [retval] out wstring value)
 Returns the value of the network attachment property with the given name.
 
void setProperty (in wstring key, in wstring value)
 Sets the value of the network attachment property with the given name.
 
void getProperties (in wstring names, out wstring[] returnNames, [retval] out wstring[] returnValues)
 Returns values for a group of properties in one call.
 

Public Attributes

attribute NetworkAdapterType adapterType
 Type of the virtual network adapter.
 
readonly attribute unsigned long slot
 Slot number this adapter is plugged into.
 
attribute boolean enabled
 Flag whether the network adapter is present in the guest system.
 
attribute wstring MACAddress
 Ethernet MAC address of the adapter, 12 hexadecimal characters.
 
attribute NetworkAttachmentType attachmentType
 Sets/Gets network attachment type of this network adapter.
 
attribute wstring bridgedInterface
 Name of the network interface the VM should be bridged to.
 
attribute wstring hostOnlyInterface
 Name of the host only network interface the VM is attached to.
 
attribute wstring hostOnlyNetwork
 Name of the host only network the VM is attached to.
 
attribute wstring internalNetwork
 Name of the internal network the VM is attached to.
 
attribute wstring NATNetwork
 Name of the NAT network the VM is attached to.
 
attribute wstring genericDriver
 Name of the driver to use for the "Generic" network attachment type.
 
attribute wstring cloudNetwork
 Name of the cloud network the VM is attached to.
 
attribute boolean cableConnected
 Flag whether the adapter reports the cable as connected or not.
 
attribute unsigned long lineSpeed
 Line speed reported by custom drivers, in units of 1 kbps.
 
attribute NetworkAdapterPromiscModePolicy promiscModePolicy
 The promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.
 
attribute boolean traceEnabled
 Flag whether network traffic from/to the network card should be traced.
 
attribute wstring traceFile
 Filename where a network trace will be stored.
 
readonly attribute INATEngine NATEngine
 Points to the NAT engine which handles the network address translation for this interface.
 
attribute unsigned long bootPriority
 Network boot priority of the adapter.
 
attribute IBandwidthGroup bandwidthGroup
 The bandwidth group this network adapter is assigned to.
 

Detailed Description

Represents a virtual network adapter that is attached to a virtual machine.

Each virtual machine has a fixed number of network adapter slots with one instance of this attached to each of them. Call IMachine::getNetworkAdapter to get the network adapter that is attached to a given slot in a given machine.

Each network adapter can be in one of five attachment modes, which are represented by the NetworkAttachmentType enumeration; see the attachmentType attribute.

Interface ID:
{DCF47A1D-ED70-4DB8-9A4B-2646BD166905}

Member Function Documentation

◆ getProperty()

void INetworkAdapter::getProperty ( in wstring  key,
[retval] out wstring  value 
)

Returns the value of the network attachment property with the given name.

If the requested data key does not exist, this function will succeed and return an empty string in the value argument.

Parameters
keyName of the property to get.
valueCurrent property value.
Expected result codes:
E_INVALIDARGname is null or empty.

◆ setProperty()

void INetworkAdapter::setProperty ( in wstring  key,
in wstring  value 
)

Sets the value of the network attachment property with the given name.

Setting the property value to null or an empty string is equivalent to deleting the existing value.

Parameters
keyName of the property to set.
valueProperty value to set.
Expected result codes:
E_INVALIDARGname is null or empty.

◆ getProperties()

void INetworkAdapter::getProperties ( in wstring  names,
out wstring[]  returnNames,
[retval] out wstring[]  returnValues 
)

Returns values for a group of properties in one call.

The names of the properties to get are specified using the names argument which is a list of comma-separated property names or an empty string if all properties are to be returned.

The method returns two arrays, the array of property names corresponding to the names argument and the current values of these properties. Both arrays have the same number of elements with each element at the given index in the first array corresponds to an element at the same index in the second array.

Parameters
namesNames of properties to get.
returnNamesNames of returned properties.
returnValuesValues of returned properties.
Note
Currently the value of this argument is ignored and the method always returns all existing properties.

Member Data Documentation

◆ adapterType

attribute NetworkAdapterType INetworkAdapter::adapterType

Type of the virtual network adapter.

Depending on this value, VirtualBox will provide a different virtual network hardware to the guest.

◆ slot

readonly attribute unsigned long INetworkAdapter::slot

Slot number this adapter is plugged into.

Corresponds to the value you pass to IMachine::getNetworkAdapter to obtain this instance.

◆ enabled

attribute boolean INetworkAdapter::enabled

Flag whether the network adapter is present in the guest system.

If disabled, the virtual guest hardware will not contain this network adapter. Can only be changed when the VM is not running.

◆ MACAddress

attribute wstring INetworkAdapter::MACAddress

Ethernet MAC address of the adapter, 12 hexadecimal characters.

When setting it to null or an empty string for an enabled adapter, VirtualBox will generate a unique MAC address. Disabled adapters can have an empty MAC address.

◆ attachmentType

attribute NetworkAttachmentType INetworkAdapter::attachmentType

Sets/Gets network attachment type of this network adapter.

◆ bridgedInterface

attribute wstring INetworkAdapter::bridgedInterface

Name of the network interface the VM should be bridged to.

◆ hostOnlyInterface

attribute wstring INetworkAdapter::hostOnlyInterface

Name of the host only network interface the VM is attached to.

◆ hostOnlyNetwork

attribute wstring INetworkAdapter::hostOnlyNetwork

Name of the host only network the VM is attached to.

◆ internalNetwork

attribute wstring INetworkAdapter::internalNetwork

Name of the internal network the VM is attached to.

◆ NATNetwork

attribute wstring INetworkAdapter::NATNetwork

Name of the NAT network the VM is attached to.

◆ genericDriver

attribute wstring INetworkAdapter::genericDriver

Name of the driver to use for the "Generic" network attachment type.

◆ cloudNetwork

attribute wstring INetworkAdapter::cloudNetwork

Name of the cloud network the VM is attached to.

◆ cableConnected

attribute boolean INetworkAdapter::cableConnected

Flag whether the adapter reports the cable as connected or not.

It can be used to report offline situations to a VM.

◆ lineSpeed

attribute unsigned long INetworkAdapter::lineSpeed

Line speed reported by custom drivers, in units of 1 kbps.

◆ promiscModePolicy

attribute NetworkAdapterPromiscModePolicy INetworkAdapter::promiscModePolicy

The promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.

◆ traceEnabled

attribute boolean INetworkAdapter::traceEnabled

Flag whether network traffic from/to the network card should be traced.

Can only be toggled when the VM is turned off.

◆ traceFile

attribute wstring INetworkAdapter::traceFile

Filename where a network trace will be stored.

If not set, VBox-pid.pcap will be used.

◆ NATEngine

readonly attribute INATEngine INetworkAdapter::NATEngine

Points to the NAT engine which handles the network address translation for this interface.

This is active only when the interface actually uses NAT.

◆ bootPriority

attribute unsigned long INetworkAdapter::bootPriority

Network boot priority of the adapter.

Priority 1 is highest. If not set, the priority is considered to be at the lowest possible setting.

◆ bandwidthGroup

attribute IBandwidthGroup INetworkAdapter::bandwidthGroup

The bandwidth group this network adapter is assigned to.