ppp\httpmod2: Advanced Web Server Application via Modem on /com/0


This application uses /com/0 for dial up PPP and /com/1 for printfs.
The application starts the HTTP server and allows network access to
the HTTP server through ethernet or through the dial up PPP link.
The following #defines should be updated in ppp_test.h to the user
specific values:

CLIENT_PAP_NAME     The dial-up PPP client's PAP username
CLIENT_PASSWORD     The dial-up PPP client's PAP password
CLIENT_CHAP_NAME    The dial-up PPP client's CHAP name
CLIENT_SECRET       The dial-up PPP client's CHAP secret key


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)
                

The application starts an HTTP server and passively waits for a
dialup connection on /com/0 through the modem.  The modem speed is
set to 115200 bps.  After a modem and PPP connection is established,
the remote (dial up client) PPP peer is assigned an IP address of
202.92.186.10.  Now the dialup client can use a web browser to browse
pages served through the target board's PPP interface by surfing to
http://202.92.186.151/.


This example application demonstrates the HTTP Server using the
features of the Advanced Web Server (AWS) interface through the Pbuilder
tool.  The HTML files in this example contain the source code for a set
of web pages.  The PBuilder.exe tool was used to convert these web
pages into C files.  These C files are built into the application to
create a web server.



The following diagrams the connections:

  +---------+    +---------+
  |         |    |         |
  |HyperTerm|----|/com/1   |              +-------+         +-------+
  |         |    |         |202.92.186.151|       |telephone|       |
  +---------+    |   /com/0|--------------| Modem |=========| Modem |
                 |         |              |       |         |       |
                 | NET+ARM |              +-------+         +---+---+
                 |         |                                    |
                 |         |  7.92.187.134                      |
                 | Ethernet|--+                                 |
                 |         |  |                    202.92.186.10|
                 +---------+  |                      +----------+--+
  +--------+                  |                      |             |
  |        |  7.92.187.218    |                      | Remote Host |
  | Router |------------------+---> Local Subnet     |             |
  |        |                                         +-------------+
  |        |--------> Internet
  |        |
  +--------+



This application routes printf data to /com/1, since the bsp_sys.h file
includes the following:

#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 applicationStart() function
security.c        contains the Realmname, username, and password specific
                  to this application

The following files are generic stubs required by all applications
that use and include the AWS (rphttpd.a) library.  These files are
located in directory .\..\..\..\src\rphttpd\:

cgi.c           contains the blank stubs for CGI functions
file.c          contains the blank stubs for File System functions

The following files are input/outputs to/from the Pbuilder tool,
and are contained in the pbuilder directory:

list.bat        file listing as parameter to Pbuilder tool
netarm1_v.c     stub file with fleshed out bodies; initially
                generated by the Pbuilder Utlity, naked stub
                originally located in the pbuilder\html directory
pbsetup.txt     Pbuilder Utility options file; do not alter
rppages.c       Pbuilder Utility output file containing all the
                application Web pages defined in List.bat
rpusrdct.h      Pbuilder Utility output file containing phrase
                dictionary prototypes
rpusrdct.c      Pbuilder Utility output file containing phrase
                dictionary data structures
rpusrdct.txt    Pbuilder Utility input file containing phrase
                dictionary definitions

The following Web content files are contained in the pbuilder\html
directory:

logo.gif        GIF file for Digi International logo
netarm1.c       source file generated by Pbuilder Utility
netarm1.htm     opening web page
netarm2.htm     secure web page with form components
netarm3.htm     reply page from Form page

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
librphttpd.a       contains the NET+Works AWS API library.
libmanapi.a        contains the NET+Works Management API 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

