Introduction

What Do You Get?

PowerNet is a TCP/IP networking stack code written in Forth with support for:

  1. Ethernet Layer. Reference driver for SMSC LAN91C9x series of Ethernet chips. Includes a packet sniffer to test reception and Ping to test transmit and receive. Additional Ethernet drivers can be found in the CPU-specific drivers directories supplied with your Forth cross-compiler.
  2. SLIP Layer. Uses a serial Interface and multiple connections are supported
  3. Routing Table. IP/Hardware routing table, with life-timers on routes.
  4. IP Layers.
    1. ICMP handler. ECHO Request coded for PING, other codes have stubs.
    2. UDP handler. Unconnected data packets.
    3. DHCP client. Permits almost automatic configuration.
    4. DNS client. Converts URLs to IP addresses.
    5. SNTP client. Used to synchronise the local clock.
    6. TCP handler. Connected data streams.
  5. Socket Layer. The sockets interface being used is based on BSD/Winsock
  6. Services Layer
    1. Primitive TFTP client (Trivial File Transfer Protocol)
    2. Multi-threaded Telnet server for Forth Interpreter over TCP/IP
    3. Multi-threaded HTTP server with ASP and CGI.
    4. Modbus server template.
    5. Echo server
  7. Examples
    1. Sending mail by SMTP.
    2. ModBus client and server templates.
    3. POST handler with application binary updater.
    4. Configuration tools.

Documentation

The main commentary on the code and all the glossaries are generated directly from the source by the DocGen utility supplied with MPE’s VFX Forth for Windows. Both PDF and HTML versions are provided.

The code and its DocGen documentation should be considered the primary reference. Please read it.

Source Tree


PowerNet
|
+------ ARP                      Address Resolution Protocol
+------ DEFINES.FTH              Various IP Constants
+------ DHCP.FTH                 DHCP client
+------ DIAGS.FTH                Diagnostic / Test routines
+------ DNS.fth                  DNS client
+------ GLOBALS.FTH              Global Vars/Buffers
+------ ICMP.FTH                 ICMP Packet handlers
+------ IP.FTH                   LowLevel IP access
+------ NETCODE.FTH              Network and CPU dependent code
+------ POWERNET.BLD             Stack Build File
+------ PRIMITIV.FTH             Useful code fragments
+------ ROUTING.FTH              Routing table handler
+-------SNTP.fth                 SNTP client.
+------ STRUCTS.FTH              Various IP/BSD Structures
+------ TCP.FTH                  TCP Protocol Handler
+------ UDP.FTH                  UDP Protocol Handler
+------ USERVARS.FTH             Required System Variables
|
+------ ETHER
|       +------ ETHTASK.FTH      Ethernet TxRx Dispatcher Task
|       +------ SMC91C9X.FTH     Reference Ethernet Driver
|
+------ SLIP
|       +------ SLIPCOM.FTH      SLIP interface
|
|------ EXAMPLES
|       +------- SMTPmail        SMTP mail examples
|       +------- WebConfig.fth   Application Configuration
|       +------- WebPost.fth     POST and binary update
|       +------- MBusClnt.fth    Modbus framework
|
+------ SOCKETS
|       +------ BSD.FTH          BSD Sockets API
|       +------ SOCKPRIM.FTH     Low Level Socket struct manip.
|
+------ QUEUES
|       +------ PBUFFERS.FTH     Queue Buffer handlers
|       +------ QPRIMS.FTH       En/DeQueue code
|       +------ QUEUES.FTH       Describe/initialise queues
|       +------ RAM.FTH          Describe TxRx RAM Useage
|
+------ SERVICES
|       +------ HTTP.FTH         MultiThreaded Web Server
|       +------ MbusSrvr         ModBus Server framework
|       +------ Pages.fth        Example web page handlers
|       +------ Servers.fth      Server core code
|       +------ TcpEcho          TCP Echo Server
|       +------ TELNET.FTH       Multi-threaded Telnet Server
|       +------ TFTP.FTH         Simple TFTP Server
|
+------ TestPages                Example web pages
|
+------ CodeManual               PDF and HTML manuals