ppp\ftpdircom1: Direct Serial FTP Application on /com/0


This application is uses /com/0 for direct serial PPP and /com/1 for
printfs.  The application starts the FTP server and allows network
access to the FTP server through ethernet or through the direct serial
PPP link.

The following #defines should be updated in ppp_test.h to the user
specific values:

REMOTE_PEER_CHAP_NAME      Linux CHAP name stored in the PPP user
                           table
REMOTE_PEER_CHAP_SECRET    Linux CHAP secret stored in the PPP user
                           table
REMOTE_PEER_PAP_NAME       Linux PAP username stored in the PPP user
                           table
REMOTE_PEER_PAP_PASSWORD   Linux PAP password stored in the PPP user
                           table
LOCAL_PEER_PAP_NAME        PAP user name used by PPP to authenticate
                           with Linux
LOCAL_PEER_PAP_PASSWORD    PAP password used by PPP to authenticate
                           with Linux
LOCAL_PEER_CHAP_NAME       CHAP name used by PPP to authenticate with
                           Linux
LOCAL_PEER_CHAP_SECRET     CHAP secret used by PPP to authenticate
                           with Linux


This application requires and allows PPP CHAP authentication on the PPP
direct serial link.  Thus, the direct serial link allows the PPP peers
to perform bidirectional authentication.  If you wish to change the
default authentication settings, change the values of

#define LCP_WANT_AUTH_PROTOCOL
#define LCP_ALLOW_AUTH_PROTOCOL

in ppp_test.h to either 0 or PPP_PAP_PROTOCOL.


The following parameters must be updated in NVRAM through the
dialog window during start up:

1) IP address on COM1 (/com/0)
2) Peer IP address connected to COM1 (/com/0)


There are two files to be edited in the Linux machine directory:
    /etc/ppp/pap-secrets
    /etc/ppp/chap-secrets

Edited pap-secrets file:

# client      server         secret        IP addresses

  linuxp      netarmp        machine        *

  netarmp     linuxp         board          *


Edited chap-secrets file:

# client      server         secret        IP addresses

  netarmc     linuxc         rhl52          *

  linuxc      netarmc        rhl52          *


The following diagram shows the connections required for this
application:

  +---------+        +---------+                   +-----------+
  |         |        |         |                   |           |
  |HyperTerm|--------|/com/1   |                   |           |
  |         |        |         |200.92.187.195     |  Remote   |
  +---------+        |   /com/0|-------------------| PPP Host  |
                     |         |     200.92.187.196| (Linux PC)|
                     | NET+ARM |                   |           |
                     |         |                   +-----------+
                     |         |7.92.187.134
                     | Ethernet|--+
                     |         |  |
                     +---------+  |
  +---------+                     |
  |         |                     |
  |         |7.92.187.218         |
  | Router  |---------------------+----> Local Subnet
  |         |
  |         |
  |         |--------> Internet
  |         |
  +---------+

In this setup, the PPP link is established between the Linux PC and the
target through a direct serial connection.  The PPP daemon on the Linux PC
can be run using the command

   pppd cua0 115200 crtscts ipcp-accept-local ipcp-accept-remote
   require-pap name linuxp

or

   pppd cua0 115200 crtscts ipcp-accept-local ipcp-accept-remote
   require-chap name linuxc

Note:  On some Linux versions, serial port devices are referenced
by "ttyS0" instead of "cua0".

The target board works as an FTP Server.  At the Linux command prompt type

   ftp  200.92.187.195

Afterwards, enter the user name and password (e.g. "john" & "doe").


The application redirects stdout (printf) to serial port /com/1.
See the bsp_sys.h file:

#define BSP_DIALOG_PORT         "/com/1"
#define BSP_STDIO_PORT          "/com/1"

To eliminate the dialog data and redirect the printf data to the
debug window, comment out both lines.  /com/1 is then available to
the application programmer.

Note:

User should refer to BSP configuration header files to check the features enabled 
for the specific board and modify them as needed.
If BSP is modified, the BSP for the specific platform must be rebuilt.

To enable using PPP, you must set the following #define in bsp_net.h to the
following:

#define BSP_WANT_PPP                        TRUE

For each specific platform, you must set the following #defines in
bsp_serial.h and gpio.h to the appropriate values:

#define BSP_SERIAL_PORT_1
#define BSP_SERIAL_PORT_x (if applicable)
#define BSP_GPIO_MUX_SERIAL_A
#define BSP_GPIO_MUX_SERIAL_x (if applicable)                       

Make sure the serial port is available on the platform. If different
serial port is used, root.c must be updated to use the correct serial port.

Since this application uses both two serial ports, if no other serial
ports are available for CLI (Command Line Interface) traces, you must
set the following #defines in bsp_cli.h have to the following:

#define BSP_CLI_TELNET_ENABLE   TRUE
#define BSP_CLI_SERIAL_ENABLE   FALSE

The above settings enable the CLI trace feature through telnet instead
of through a serial port.

End note

One GNU make file is provided.  Build the target 'image' to
generate an image that can be debugged with gdb, and the file 
image.bin which can be written to flash if the bootloader is used.
Build the target 'rom.bin' to create the file rom.bin which 
can be written to ROM if the bootloader is not used.

The following files are provided with this application:

appconf.h         sets application configuration settings
makefile          Make file for the GNU toolset.
readme            this file
root.c            contains the applicationStart() function, that creates
                  an application thread
naftpapp.c        contains the FTP application specific stubs


In addition, the following files in the BSP directory are built
as part of this application:

reset.s         contains the reset code
appconf_api.c   contains code used to read settings in appconf.h


The application build file links in the following libraries.

libbsp.a           contains the BSP code
libtcpip.a         contains the Net+Works TCP/IP stack
libtx.a            contains the ThreadX kernel
libfilesys.a       contains the file system libraries
libposix.a         contains the POSIX layer libraries
libflash.a         contains the Flash driver API library
libftpsvr.a        contains the FTP server library
libtelnsvr.a       contains the Telnet server library
libdnsclnt.a       contains the DNS client library
libaddp.a		   contains the ADDP Library
libssh.a		   contains the SSH Library
libpppintf.a       contains the PPP API library

The application uses the following files located in the
netos\src\linkerScripts directory.  These files are generated
when the BSP is built.

bootldr.dat     bootloader configuration file used to generate the
                file image.bin.  It controls the information placed
                in the bootloader header of the image.

image.ldr       GNU linker script used to build an image that can
                be debugged and used with the bootloader.
                
customize.ldr   Customizable GNU linker script


