org.virtualbox_4_1
Class INetworkAdapter

java.lang.Object
  extended by org.virtualbox_4_1.IUnknown
      extended by org.virtualbox_4_1.INetworkAdapter

public class INetworkAdapter
extends IUnknown

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(Long) 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 getAttachmentType() attribute. Interface ID: {8B2E705C-0547-4008-B7BC-788757346092}


Field Summary
 
Fields inherited from class org.virtualbox_4_1.IUnknown
obj, port
 
Constructor Summary
INetworkAdapter(java.lang.String wrapped, org.virtualbox_4_1.jaxws.VboxPortType port)
           
 
Method Summary
 NetworkAdapterType getAdapterType()
          Type of the virtual network adapter.
 NetworkAttachmentType getAttachmentType()
          Sets/Gets network attachment type of this network adapter.
 IBandwidthGroup getBandwidthGroup()
          The bandwidth group this network adapter is assigned to.
 java.lang.Long getBootPriority()
          Network boot priority of the adapter.
 java.lang.String getBridgedInterface()
          Name of the network interface the VM should be bridged to.
 java.lang.Boolean getCableConnected()
          Flag whether the adapter reports the cable as connected or not.
 java.lang.Boolean getEnabled()
          Flag whether the network adapter is present in the guest system.
 java.lang.String getGenericDriver()
          Name of the driver to use for the "Generic" network attachment type.
 java.lang.String getHostOnlyInterface()
          Name of the host only network interface the VM is attached to.
 java.lang.String getInternalNetwork()
          Name of the internal network the VM is attached to.
 java.lang.Long getLineSpeed()
          Line speed reported by custom drivers, in units of 1 kbps.
 java.lang.String getMACAddress()
          Ethernet MAC address of the adapter, 12 hexadecimal characters.
 INATEngine getNatDriver()
          Points to the NAT engine which handles the network address translation for this interface.
 java.lang.String getNATNetwork()
          Name of the NAT network the VM is attached to.
 NetworkAdapterPromiscModePolicy getPromiscModePolicy()
          The promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.
 java.util.List<java.lang.String> getProperties(java.lang.String names, Holder<java.util.List<java.lang.String>> returnNames)
          Returns values for a group of properties in one call.
 java.lang.String getProperty(java.lang.String key)
          Returns the value of the network attachment property with the given name.
 java.lang.Long getSlot()
          Slot number this adapter is plugged into.
 java.lang.Boolean getTraceEnabled()
          Flag whether network traffic from/to the network card should be traced.
 java.lang.String getTraceFile()
          Filename where a network trace will be stored.
static INetworkAdapter queryInterface(IUnknown obj)
           
 void setAdapterType(NetworkAdapterType value)
          Type of the virtual network adapter.
 void setAttachmentType(NetworkAttachmentType value)
          Sets/Gets network attachment type of this network adapter.
 void setBandwidthGroup(IBandwidthGroup value)
          The bandwidth group this network adapter is assigned to.
 void setBootPriority(java.lang.Long value)
          Network boot priority of the adapter.
 void setBridgedInterface(java.lang.String value)
          Name of the network interface the VM should be bridged to.
 void setCableConnected(java.lang.Boolean value)
          Flag whether the adapter reports the cable as connected or not.
 void setEnabled(java.lang.Boolean value)
          Flag whether the network adapter is present in the guest system.
 void setGenericDriver(java.lang.String value)
          Name of the driver to use for the "Generic" network attachment type.
 void setHostOnlyInterface(java.lang.String value)
          Name of the host only network interface the VM is attached to.
 void setInternalNetwork(java.lang.String value)
          Name of the internal network the VM is attached to.
 void setLineSpeed(java.lang.Long value)
          Line speed reported by custom drivers, in units of 1 kbps.
 void setMACAddress(java.lang.String value)
          Ethernet MAC address of the adapter, 12 hexadecimal characters.
 void setNATNetwork(java.lang.String value)
          Name of the NAT network the VM is attached to.
 void setPromiscModePolicy(NetworkAdapterPromiscModePolicy value)
          The promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.
 void setProperty(java.lang.String key, java.lang.String value)
          Sets the value of the network attachment property with the given name.
 void setTraceEnabled(java.lang.Boolean value)
          Flag whether network traffic from/to the network card should be traced.
 void setTraceFile(java.lang.String value)
          Filename where a network trace will be stored.
 
Methods inherited from class org.virtualbox_4_1.IUnknown
getRemoteWSPort, getWrapped, releaseRemote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

INetworkAdapter

public INetworkAdapter(java.lang.String wrapped,
                       org.virtualbox_4_1.jaxws.VboxPortType port)
Method Detail

getAdapterType

public NetworkAdapterType getAdapterType()
Type of the virtual network adapter. Depending on this value, VirtualBox will provide a different virtual network hardware to the guest.

Returns:
org.virtualbox_4_1.NetworkAdapterType

setAdapterType

public void setAdapterType(NetworkAdapterType value)
Type of the virtual network adapter. Depending on this value, VirtualBox will provide a different virtual network hardware to the guest.

Parameters:
value - org.virtualbox_4_1.NetworkAdapterType

getSlot

public java.lang.Long getSlot()
Slot number this adapter is plugged into. Corresponds to the value you pass to IMachine.getNetworkAdapter(Long) to obtain this instance.

Returns:
Long

getEnabled

public java.lang.Boolean getEnabled()
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.

Returns:
Boolean

setEnabled

public void setEnabled(java.lang.Boolean value)
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.

Parameters:
value - Boolean

getMACAddress

public java.lang.String getMACAddress()
Ethernet MAC address of the adapter, 12 hexadecimal characters. When setting it to null or an empty string, VirtualBox will generate a unique MAC address.

Returns:
String

setMACAddress

public void setMACAddress(java.lang.String value)
Ethernet MAC address of the adapter, 12 hexadecimal characters. When setting it to null or an empty string, VirtualBox will generate a unique MAC address.

Parameters:
value - String

getAttachmentType

public NetworkAttachmentType getAttachmentType()
Sets/Gets network attachment type of this network adapter.

Returns:
org.virtualbox_4_1.NetworkAttachmentType

setAttachmentType

public void setAttachmentType(NetworkAttachmentType value)
Sets/Gets network attachment type of this network adapter.

Parameters:
value - org.virtualbox_4_1.NetworkAttachmentType

getBridgedInterface

public java.lang.String getBridgedInterface()
Name of the network interface the VM should be bridged to.

Returns:
String

setBridgedInterface

public void setBridgedInterface(java.lang.String value)
Name of the network interface the VM should be bridged to.

Parameters:
value - String

getHostOnlyInterface

public java.lang.String getHostOnlyInterface()
Name of the host only network interface the VM is attached to.

Returns:
String

setHostOnlyInterface

public void setHostOnlyInterface(java.lang.String value)
Name of the host only network interface the VM is attached to.

Parameters:
value - String

getInternalNetwork

public java.lang.String getInternalNetwork()
Name of the internal network the VM is attached to.

Returns:
String

setInternalNetwork

public void setInternalNetwork(java.lang.String value)
Name of the internal network the VM is attached to.

Parameters:
value - String

getNATNetwork

public java.lang.String getNATNetwork()
Name of the NAT network the VM is attached to.

Returns:
String

setNATNetwork

public void setNATNetwork(java.lang.String value)
Name of the NAT network the VM is attached to.

Parameters:
value - String

getGenericDriver

public java.lang.String getGenericDriver()
Name of the driver to use for the "Generic" network attachment type.

Returns:
String

setGenericDriver

public void setGenericDriver(java.lang.String value)
Name of the driver to use for the "Generic" network attachment type.

Parameters:
value - String

getCableConnected

public java.lang.Boolean getCableConnected()
Flag whether the adapter reports the cable as connected or not. It can be used to report offline situations to a VM.

Returns:
Boolean

setCableConnected

public void setCableConnected(java.lang.Boolean value)
Flag whether the adapter reports the cable as connected or not. It can be used to report offline situations to a VM.

Parameters:
value - Boolean

getLineSpeed

public java.lang.Long getLineSpeed()
Line speed reported by custom drivers, in units of 1 kbps.

Returns:
Long

setLineSpeed

public void setLineSpeed(java.lang.Long value)
Line speed reported by custom drivers, in units of 1 kbps.

Parameters:
value - Long

getPromiscModePolicy

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

Returns:
org.virtualbox_4_1.NetworkAdapterPromiscModePolicy

setPromiscModePolicy

public void setPromiscModePolicy(NetworkAdapterPromiscModePolicy value)
The promiscuous mode policy of the network adapter when attached to an internal network, host only network or a bridge.

Parameters:
value - org.virtualbox_4_1.NetworkAdapterPromiscModePolicy

getTraceEnabled

public java.lang.Boolean getTraceEnabled()
Flag whether network traffic from/to the network card should be traced. Can only be toggled when the VM is turned off.

Returns:
Boolean

setTraceEnabled

public void setTraceEnabled(java.lang.Boolean value)
Flag whether network traffic from/to the network card should be traced. Can only be toggled when the VM is turned off.

Parameters:
value - Boolean

getTraceFile

public java.lang.String getTraceFile()
Filename where a network trace will be stored. If not set, VBox-pid.pcap will be used.

Returns:
String

setTraceFile

public void setTraceFile(java.lang.String value)
Filename where a network trace will be stored. If not set, VBox-pid.pcap will be used.

Parameters:
value - String

getNatDriver

public INATEngine getNatDriver()
Points to the NAT engine which handles the network address translation for this interface. This is active only when the interface actually uses NAT.

Returns:
org.virtualbox_4_1.INATEngine

getBootPriority

public java.lang.Long getBootPriority()
Network boot priority of the adapter. Priority 1 is highest. If not set, the priority is considered to be at the lowest possible setting.

Returns:
Long

setBootPriority

public void setBootPriority(java.lang.Long value)
Network boot priority of the adapter. Priority 1 is highest. If not set, the priority is considered to be at the lowest possible setting.

Parameters:
value - Long

getBandwidthGroup

public IBandwidthGroup getBandwidthGroup()
The bandwidth group this network adapter is assigned to.

Returns:
org.virtualbox_4_1.IBandwidthGroup

setBandwidthGroup

public void setBandwidthGroup(IBandwidthGroup value)
The bandwidth group this network adapter is assigned to.

Parameters:
value - org.virtualbox_4_1.IBandwidthGroup

queryInterface

public static INetworkAdapter queryInterface(IUnknown obj)

getProperty

public java.lang.String getProperty(java.lang.String key)
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:
key - Name of the property to get.
Returns:
Current property value. Expected result codes:
E_INVALIDARG name is null or empty.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String 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:
key - Name of the property to set.
value - Property value to set. Expected result codes:
E_INVALIDARG name is null or empty.

getProperties

public java.util.List<java.lang.String> getProperties(java.lang.String names,
                                                      Holder<java.util.List<java.lang.String>> returnNames)
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:
names - Names of properties to get.
returnNames - Names of returned properties.
Returns:
Values of returned properties. NOTE: Currently the value of this argument is ignored and the method always returns all existing properties.