![Texas TMS320C6000 Programmer'S Reference Manual Download Page 132](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844132.webp)
Network Address Translation (NAT) Service
6-19
Network Tools Library Services
(192.168.0.x/255.255.255.0) on “If–2” and (192.168.1 .x/255.255.255.0) on
“If–3”. In order to run NAT on both home networks, the NAT interface would be
“If–1” (the public interface), and the NAT group (virtual) network would be
192.168.0.0/255.255.254.0, which covers both home networks.
For more information on NAT operation, including how to program proxy filters,
see the Network Address Translation appendix at the end of this document.
6.7.3
NAT Server Parameter Structure
The following structure defines the unique parameters of the DHCP server ser-
vice. It is located in the file: src\nettools\inc\dhcpsif.h.
//
// NAT Parameter Structure
//
typedef struct _ntparam_nat {
IPN IPVirt; // Virtual IP address
IPN IPMask; // Mask of virtual subnet
} NTPARAM_NAT;
-
IPVirt – NAT Group virtual network address
-
IPMask – Subnet mask of NAT Group virtual network
This structure is used both when specifying the service to the configuration
system or when bypassing the configuration and invoking the service API di-
rectly.
6.7.4
Specifying Service Using the Configuration
Since the NAT service executes on a specified public interface, it is never exe-
cuted based on an IP address. Thus, it can not be used with the ”CALLBYIP”
flag in the standard configuration service structure. In addition, since the public
IP host address is required to initialize the service, the “RESOLVEIP” flag
should be set in cases where the IP address is not pre-assigned.
For example, the following code specifies that the NAT service should run on
the interface specficied by the physical index natIdx. Here, we use the DHCP
client service to obtain our public IP address (the address assigned to natIdx),
so at this point we don’t know what our IP address is going to be. We thus set
the “RESOLVEIP” flag in the execution mode parameter. This informs the con-
figuration service manager not to invoke NAT until it has resolved an IP ad-
dress for the target interface. We also set the “RESTART” flag to tell the service
to restart NAT if we lose and then regain a public IP address. In this example,
we assume all networks in the 192.168.x.x/255.255.0.0 subnet are part of the
NAT group to be translated.