VirtualBox Main API
|
Interface for managing a NAT engine which is used with a virtual machine. More...
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. | |
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. | |
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. | |
void | removeRedirect (in wstring name) |
Removes a port-forwarding rule that was previously registered. | |
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). | |
attribute wstring | hostIP |
IP of host interface to bind all opened sockets to. | |
attribute wstring | TFTPPrefix |
TFTP prefix attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. | |
attribute wstring | TFTPBootFile |
TFTP boot file attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. | |
attribute wstring | TFTPNextServer |
TFTP server attribute which is used with the built-in DHCP server to fill the corresponding fields of DHCP leases. | |
attribute unsigned long | aliasMode |
attribute boolean | DNSPassDomain |
Whether the DHCP server should pass the DNS domain used by the host. | |
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. | |
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. | |
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". | |
attribute boolean | localhostReachable |
Whether traffic from the guest directed to 10.0.2.2 will reach the host's loopback interface, i.e. | |
attribute boolean | forwardBroadcast |
Forwards broadcast packets sent by the guest to the host machine as such. | |
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.
{A06253A7-DCD2-44E3-8689-9C9C4B6B6234}
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.
mtu | MTU (maximum transmission unit) of the NAT engine in bytes. |
sockSnd | Capacity of the socket send buffer in bytes when creating a new socket. |
sockRcv | Capacity of the socket receive buffer in bytes when creating a new socket. |
TcpWndSnd | Initial size of the NAT engine's sending TCP window in bytes when establishing a new TCP connection. |
TcpWndRcv | Initial 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.
name | The name of the rule. An empty name is acceptable, in which case the NAT engine auto-generates one using the other parameters. |
proto | Protocol handled with the rule. |
hostIP | IP 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. |
hostPort | The port number to listen on. |
guestIP | The 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). |
guestPort | The port number to forward. |
void INATEngine::removeRedirect | ( | in wstring | name | ) |
Removes a port-forwarding rule that was previously registered.
name | The name of the rule to delete. |
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.
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.
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".
attribute boolean INATEngine::localhostReachable |
Whether traffic from the guest directed to 10.0.2.2 will reach the host's loopback interface, i.e.
localhost or 127.0.0.1.
attribute boolean INATEngine::forwardBroadcast |
Forwards broadcast packets sent by the guest to the host machine as such.
IP address will show to host as 255.255.255.255.