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

Interface for managing a NAT engine which is used with a virtual machine. More...

Inheritance diagram for INATEngine:

Public Member Functions

void setNetworkSettings (in unsigned long mtu, in unsigned long sockSnd, in unsigned long sockRcv, in unsigned long TcpWndSnd, in unsigned long TcpWndRcv)
 Sets network configuration of the NAT engine. More...
 
void getNetworkSettings (out unsigned long mtu, out unsigned long sockSnd, out unsigned long sockRcv, out unsigned long TcpWndSnd, out unsigned long TcpWndRcv)
 Returns network configuration of NAT engine. More...
 
void addRedirect (in wstring name, in NATProtocol proto, in wstring hostIP, in unsigned short hostPort, in wstring guestIP, in unsigned short guestPort)
 Adds a new NAT port-forwarding rule. More...
 
void removeRedirect (in wstring name)
 Removes a port-forwarding rule that was previously registered. More...
 

Public Attributes

attribute wstring network
 The network attribute of the NAT engine (the same value is used with built-in DHCP server to fill corresponding fields of DHCP leases). More...
 
attribute wstring hostIP
 IP of host interface to bind all opened sockets to. More...
 
attribute wstring TFTPPrefix
 TFTP prefix attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. More...
 
attribute wstring TFTPBootFile
 TFTP boot file attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. More...
 
attribute wstring TFTPNextServer
 TFTP server attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. More...
 
attribute unsigned long aliasMode
 
attribute boolean DNSPassDomain
 Whether the DHCP server should pass the DNS domain used by the host. More...
 
attribute boolean DNSProxy
 Whether the DHCP server (and the DNS traffic by NAT) should pass the address of the DNS proxy and process traffic using DNS servers registered on the host. More...
 
attribute boolean DNSUseHostResolver
 Whether the DHCP server (and the DNS traffic by NAT) should pass the address of the DNS proxy and process traffic using the host resolver mechanism. More...
 
readonly attribute wstring[] redirects
 Array of NAT port-forwarding rules in string representation, in the following format: "name,protocol id,host ip,host port,guest ip,guest port". More...
 

Detailed Description

Interface for managing a NAT engine which is used with a virtual machine.

This allows for changing NAT behavior such as port-forwarding rules. This interface is used in the INetworkAdapter::NATEngine attribute.

Interface ID:
{C1CDB6BF-44CB-E334-66FA-469A17FD09DF}

Member Function Documentation

void INATEngine::setNetworkSettings ( in unsigned long  mtu,
in unsigned long  sockSnd,
in unsigned long  sockRcv,
in unsigned long  TcpWndSnd,
in unsigned long  TcpWndRcv 
)

Sets network configuration of the NAT engine.

Parameters
mtuMTU (maximum transmission unit) of the NAT engine in bytes.
sockSndCapacity of the socket send buffer in bytes when creating a new socket.
sockRcvCapacity of the socket receive buffer in bytes when creating a new socket.
TcpWndSndInitial size of the NAT engine's sending TCP window in bytes when establishing a new TCP connection.
TcpWndRcvInitial size of the NAT engine's receiving TCP window in bytes when establishing a new TCP connection.
void INATEngine::getNetworkSettings ( out unsigned long  mtu,
out unsigned long  sockSnd,
out unsigned long  sockRcv,
out unsigned long  TcpWndSnd,
out unsigned long  TcpWndRcv 
)

Returns network configuration of NAT engine.

See setNetworkSettings for parameter descriptions.

void INATEngine::addRedirect ( in wstring  name,
in NATProtocol  proto,
in wstring  hostIP,
in unsigned short  hostPort,
in wstring  guestIP,
in unsigned short  guestPort 
)

Adds a new NAT port-forwarding rule.

Parameters
nameThe name of the rule. An empty name is acceptable, in which case the NAT engine auto-generates one using the other parameters.
protoProtocol handled with the rule.
hostIPIP of the host interface to which the rule should apply. An empty ip address is acceptable, in which case the NAT engine binds the handling socket to any interface.
hostPortThe port number to listen on.
guestIPThe IP address of the guest which the NAT engine will forward matching packets to. An empty IP address is acceptable, in which case the NAT engine will forward packets to the first DHCP lease (x.x.x.15).
guestPortThe port number to forward.
void INATEngine::removeRedirect ( in wstring  name)

Removes a port-forwarding rule that was previously registered.

Parameters
nameThe name of the rule to delete.

Member Data Documentation

attribute wstring INATEngine::network

The network attribute of the NAT engine (the same value is used with built-in DHCP server to fill corresponding fields of DHCP leases).

attribute wstring INATEngine::hostIP

IP of host interface to bind all opened sockets to.

Note
Changing this does not change binding of port forwarding.
attribute wstring INATEngine::TFTPPrefix

TFTP prefix attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases.

attribute wstring INATEngine::TFTPBootFile

TFTP boot file attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases.

attribute wstring INATEngine::TFTPNextServer

TFTP server attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases.

Note
The preferred form is IPv4 addresses.
attribute unsigned long INATEngine::aliasMode
attribute boolean INATEngine::DNSPassDomain

Whether the DHCP server should pass the DNS domain used by the host.

attribute boolean INATEngine::DNSProxy

Whether the DHCP server (and the DNS traffic by NAT) should pass the address of the DNS proxy and process traffic using DNS servers registered on the host.

attribute boolean INATEngine::DNSUseHostResolver

Whether the DHCP server (and the DNS traffic by NAT) should pass the address of the DNS proxy and process traffic using the host resolver mechanism.

readonly attribute wstring [] INATEngine::redirects

Array of NAT port-forwarding rules in string representation, in the following format: "name,protocol id,host ip,host port,guest ip,guest port".