
Network Source Tree
================================================================================
1. rvl/lib/net:      socket lib source
2. rvl/os/net:       TCP/IP stack source
3. rvl/os/usbeth:    USB-Ethernet driver source
4. rvl/lib/net/test: some testing programs



TCP/IP Stack Source Tree
================================================================================
1. All source code (.c files) and all new headers files are located at os/net
2. The interface headers files are isolated into three parts: the public header 
   filesones that socket lib will use (socket.h and iop_sock.h), the public header 
   files that device drivers will use (iop_netif.h and iop_ethtool.h), and internal
   header files. 
3. The Nintendo headers files (internal ones) are kept in the original hierarchy, 
   and they are located at os/net/include
4. All new files are named as: iop_*.c or iop_*.h. These include:
    iop_sockrm.c: socker layer resource manager
    iop_ifrm.c:   network device interface resource manager
    iop_devif.c:  network device interface layer
    iop_alarm.c:  alarm handler
    iop_mutex.c:  mutex support (and disalbe/enable interrupts)
    iop_mem.c:    memory manager
    iop_os.c:     other OS functions
    iop_libc.c:   simple c lib



Changes in TCP/IP Stack
================================================================================
1. All changes are marked in the section of:
        #ifdef IOP_OS
        #endif // IOP_OS

   So it would be easy to go through all the changes by searching IOP_OS in the 
   source tree.

2. Major changes include
   -- fix compiling errors and warnings
   -- seperate the public and internal header files
   -- fix the data alignment issue in address comparison macros (IP_ADDR_EQ,
      IP_ADDR_NE and IP_ADDR_IN_NET)
   -- fix the data alignment issue in checksum computation (IP4CheckSum)
   -- fix the data alignment issue in IPRoute.c
   -- make the SendHeap 4 bytes aligned (IPInterface.c)
   -- make ARPCache structure 4 bytes aligned (IPArp.h)
   -- make IPHdlc structure 4 bytes aligned (ip.h)
   -- make IFDatagram structure 4 bytes aligned (ip.h)
   -- make DHCPInfo structure 4 bytes aligned (IPDhcp.h)
   -- make ARPEntry structure 4 bytes aligned (IPEntry.h)
   -- make changes based on limited libc functions on IOP OS
   -- reserve NET_IP_ALIGN space after ethernet headere so the IP headers will 
      4 bytes be aligned
   -- fix the deadlock problems (disabling interrupts while going to sleep will
      cause deadlock)
   -- define a function pointer (fpFilter) to fix the compiling errors and
      simpify the coding (IPInterface.c)
   -- Fix the pointer movement errors in IPIpcp.c, IPLcp.c and IPPPPoE.c. This 
      may be caused by different compiler (gcc)

3. Initial support for WiFi interface: IF_TYPE_WIFI, EXI_ETHER_WIFI
4. The maximum sockets is currently set to 16.
5. The stack does not allow the application to setup memory allocation/free
   functions via SOConfig. Therefore, these parameters will be ignored. 



Open Issues
================================================================================
1. TCPIsn() has not been ported.
2. Two asserts in IPEther.c have been disabled. We hit the assert during the test.
   However, we have not figured out a way to fix it.
3. Currently, only static IP address is supported.



How to run the testing program
================================================================================
Use sotcp_client.c as one example:
1. Build the server on Linux using:
        gcc -o tcpServer linuxTcpServer.c
2. Load ohci0.elf and run it. This is the USB host controller.
3. Load usbeth.elf and run it. This is the USB-Ethernet driver.
4. Load net.elf and run it. This is the network stack
5. Load sotcp_client.elf and run it. This is the TCP client testing program.



Testing programs
================================================================================
1. linuxTcpClient.c, linuxTcpServer.c and linuxUdpRecv.c are programs running on
   linux machine. They can be built by using gcc. For example,
   gcc -o tcpServer linuxTcpServer.c
2. sotcp_client.c, sotcp_server.c and soudp_send.c are programs running on IOP OS.
3. sotcp_client.c/linuxTcpClient.c are TCP client program.
4. sotcp_server.c/linuxTcpServer.c are TCP server program.
5. soudp_send.c and linuxUdpRecv.c are UDP test program.
