tfNatConfigInnerFtpServer

Jump to: navigation, search

Table of Contents >> Optional Protocols >> NAT


#include <trsocket.h>


int tfNatConfigInnerFtpServer (
ttUserInterface interfaceHandle,
ttUserIpAddress ipPublic,
ttUserIpAddress ipPrivate,
ttUserIpPort portPublicMin,
ttUserIpPort portPublicMax
);


Function Description

This function configures an FTP server on the private network for access as an FTP server via the public network. The public world will know the server as ipPublic:21. On the private network, the server will be implemented as ipPrivate:21.

Only one FTP server can be configured for a public NAT interface.

In case the FTP server ever gets a PASV command from the public client, the inbound connection must be accommodated on a unique public port. Those ports are taken from the inclusive range specified by 'portPublicMin' and 'portPublicMax'. For PORT-mode transfers to work, you should have NAPT configured for the same public IP address. The data connection initiated by the private server will have a private port of 20 and a synthetic public port. Though unconventional, this does not appear to thwart the FTP client on SunOS (at least). Non-PORT, non-PASV transfers are not supported (i.e. with the sendport option in some Unix FTP clients turned off).


Parameters

  • interfaceHandle
    The interface handle of the public NAT device on which to configure the FTP server.
  • ipPublic
    The FTP server's public identity in network byte order.
  • ipPrivate
    The FTP server's private identity in network byte order.
  • portPublic
    The FTP server's public implementation in host byte order.
  • portPublic
    The FTP server's private implementation in host byte order.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    There is IP/port/protocol conflict.
  • TM_ENOMEM
    Insufficient memory to complete the operation, or too many triggers already added.


Table of Contents >> Optional Protocols >> NAT