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

The IDHCPServer interface represents the VirtualBox DHCP server configuration. More...

Inheritance diagram for IDHCPServer:

Public Member Functions

void setConfiguration (in wstring IPAddress, in wstring networkMask, in wstring FromIPAddress, in wstring ToIPAddress)
 configures the server More...
 
void start (in wstring trunkName, in wstring trunkType)
 Starts DHCP server process. More...
 
void stop ()
 Stops DHCP server process. More...
 
void restart ()
 Restart running DHCP server process. More...
 
void findLeaseByMAC (in wstring mac, in long type, out wstring address, out wstring state, out long long issued, out long long expire)
 Queries the persistent lease database by MAC address. More...
 
void getConfig (in DHCPConfigScope scope, in wstring name, in unsigned long slot, in boolean mayAdd, [retval] out IDHCPConfig config)
 Gets or adds a configuration. More...
 

Public Attributes

readonly attribute IEventSource eventSource
 
attribute boolean enabled
 specifies if the DHCP server is enabled More...
 
readonly attribute wstring IPAddress
 specifies server IP More...
 
readonly attribute wstring networkMask
 specifies server network mask More...
 
readonly attribute wstring networkName
 specifies internal network name the server is used for More...
 
readonly attribute wstring lowerIP
 specifies from IP address in server address range More...
 
readonly attribute wstring upperIP
 specifies to IP address in server address range More...
 
readonly attribute IDHCPGlobalConfig globalConfig
 Global configuration that applies to all clients. More...
 
readonly attribute IDHCPGroupConfig [] groupConfigs
 Configuration groups that applies to selected clients, selection is flexible. More...
 
readonly attribute IDHCPIndividualConfig [] individualConfigs
 Individual NIC configurations either by MAC address or VM + NIC number. More...
 

Detailed Description

The IDHCPServer interface represents the VirtualBox DHCP server configuration.

To enumerate all the DHCP servers on the host, use the IVirtualBox::DHCPServers attribute.

Interface ID:
{CADEF0A2-A1A9-4AC2-8E80-C049AF69DAC8}

Member Function Documentation

◆ setConfiguration()

void IDHCPServer::setConfiguration ( in wstring  IPAddress,
in wstring  networkMask,
in wstring  FromIPAddress,
in wstring  ToIPAddress 
)

configures the server

Parameters
IPAddressserver IP address
networkMaskserver network mask
FromIPAddressserver From IP address for address range
ToIPAddressserver To IP address for address range
Expected result codes:
E_INVALIDARG invalid configuration supplied

◆ start()

void IDHCPServer::start ( in wstring  trunkName,
in wstring  trunkType 
)

Starts DHCP server process.

Parameters
trunkNameName of internal network trunk.
trunkTypeType of internal network trunk.
Expected result codes:
E_FAIL Failed to start the process.

◆ stop()

void IDHCPServer::stop ( )

Stops DHCP server process.

Expected result codes:
E_FAIL Failed to stop the process.

◆ restart()

void IDHCPServer::restart ( )

Restart running DHCP server process.

Expected result codes:
E_FAIL Failed to restart the process.

◆ findLeaseByMAC()

void IDHCPServer::findLeaseByMAC ( in wstring  mac,
in long  type,
out wstring  address,
out wstring  state,
out long long  issued,
out long long  expire 
)

Queries the persistent lease database by MAC address.

This is handy if the host wants to connect to a server running inside a VM on a host only network.

Parameters
macThe MAC address to look up.
typeReserved, MBZ.
addressThe assigned address.
stateThe lease state.
issuedTimestamp of when the lease was issued, in seconds since 1970-01-01 UTC.
expireTimestamp of when the lease expires/expired, in seconds since 1970-01-01 UTC.
Expected result codes:
VBOX_E_OBJECT_NOT_FOUND If MAC address not in the database.
VBOX_E_FILE_ERROR If not able to read the lease database file.

◆ getConfig()

void IDHCPServer::getConfig ( in DHCPConfigScope  scope,
in wstring  name,
in unsigned long  slot,
in boolean  mayAdd,
[retval] out IDHCPConfig  config 
)

Gets or adds a configuration.

Parameters
scopeThe kind of configuration being sought or added.
nameMeaning depends on the scope:
slotThe NIC slot when scope is set to DHCPConfigScope_MachineNIC, must be zero for all other scope values.
mayAddSet to TRUE if the configuration should be added if not found. If set to FALSE the method will fail with VBOX_E_OBJECT_NOT_FOUND.
configThe requested configuration.

Member Data Documentation

◆ eventSource

readonly attribute IEventSource IDHCPServer::eventSource

◆ enabled

attribute boolean IDHCPServer::enabled

specifies if the DHCP server is enabled

◆ IPAddress

readonly attribute wstring IDHCPServer::IPAddress

specifies server IP

◆ networkMask

readonly attribute wstring IDHCPServer::networkMask

specifies server network mask

◆ networkName

readonly attribute wstring IDHCPServer::networkName

specifies internal network name the server is used for

◆ lowerIP

readonly attribute wstring IDHCPServer::lowerIP

specifies from IP address in server address range

◆ upperIP

readonly attribute wstring IDHCPServer::upperIP

specifies to IP address in server address range

◆ globalConfig

readonly attribute IDHCPGlobalConfig IDHCPServer::globalConfig

Global configuration that applies to all clients.

◆ groupConfigs

readonly attribute IDHCPGroupConfig [] IDHCPServer::groupConfigs

Configuration groups that applies to selected clients, selection is flexible.

◆ individualConfigs

readonly attribute IDHCPIndividualConfig [] IDHCPServer::individualConfigs

Individual NIC configurations either by MAC address or VM + NIC number.