# INATEngine Interface Reference

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

List of all members.

## 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".

## 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::natDriver attribute.

Interface ID:
  `{4B286616-EB03-11DE-B0FB-1701ECA42246}`

## 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:

  | 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.

Parameters:

  | 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.

Parameters:

  | name | The 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".