www.pudn.com > tcpipstack.rar > TINYTCP.SHA


107 readme.txt 
TinyTcp Public Domain Release 
 
The files in this release contain a simple implementation of 
TCP & FTP, suitable for burning into ROM.  It is, in effect, 
a big hack put together in two or three days.  It works for 
us, though, and you might like it, too.  Warning: the code 
was intended for a 68000, and doesn't have any byte swapping 
support in it.  Shouldn't be too hard to add, though. 
 
 - Geof Cooper 
 Imagen Corporation 
 [imagen!geof@decwrl.dec.com] 
 April 16, 1986 
 
|===================================================================| 
|  The author of this code hereby licenses all duplication and/or   | 
|  modification of this code, in whole or in part, consistent with  | 
|  the terms of the GNU Library General Public License.             | 
|              - Geoffrey H. Cooper 10/29/97                        | 
|===================================================================| 
 
|===================================================================| 
|  My changes can be considered public domain.  Geof's statement    | 
|  will cover everything.                                           | 
|              - Rick Rodman 09/02/97                               | 
|===================================================================| 
 
This library is free software; you can redistribute it and/or 
modify it under the terms of the GNU Library General Public 
License as published by the Free Software Foundation; either 
version 2 of the License, or (at your option) any later version. 
 
This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
Library General Public License for more details. 
 
You should have received a copy of the GNU Library General Public 
License along with this library; if not, write to the 
Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
Boston, MA  02111-1307, USA. 
 
The package requires some system support: 
 
 clock_ValueRough() - should be a procedure that returns the current 
   value of a millisecond clock.  The procedure is called frequently, 
   so that interrupts are not needed to service the clock.  Our 
   implementation polls the real time timer and assumes that it is 
   called frequently enough so that it doesn't miss clock ticks (Since 
   the timer is only used for network timeouts, it doesn't really matter 
   if it does miss clock ticks, of course).  Systems without a clock 
   could probably get by with a procedure that increments a static 
   variable and returns it, by adjusting the timeout constants in the 
   program. 
 
 Network driver - some network interface  driver is needed.  A driver for a 
   3Com multibus (ethernet) board is included; this board isn't made anymore 
   (at least not by 3Com), so you'll probably need to write a driver for the 
   board in your system. 
 
 
Guide to source files: 
 
 sed.c - Simple Ethernet Driver - Driver for 3Com multibus card.  If you 
       have another type of Ethernet board, you can use this driver as 
       a template. 
 
 sed.h - header file for the above. 
 
 arp.c - Implementation of Address Resolution Protocol.  Note that there 
       is no arp "mapping" per se.  The higher level code (tcp, in this case) 
       is required to keep track of internet and ethernet addresses. 
 
tinytcp.c - Implementation of TCP. 
 
tinytcp.h - Header file for above, and for everything else. 
 
tinyftp.c - Implementation of FTP, only allows files to be retrieved, not sent. 
 
---- 
Notes from R. Rodman: 
 
While the above says 'public domain release', all of the files contain 
copyright notices. 
 
940213 The TCP layer appears to be working now, after correction of a couple 
of minor errors.  However, the FTP server does not respond when I send a 
message (e.g. HELP), and the FTP layer here sits waiting for a response. 
 
940605 This release now provides a client which can RETR a file, and a server 
which can send a file.  Shortly I will be adding the reverse capabilities 
(STOR on the client and server).  At the same time, I will be porting to 
the Z-80.  I'm planning to use Eco-C/Z-80 for this job; although it produces 
large executables, they run fast and the compiler supports typedefs and 
structs. 
 
940925 Eco-C does not support typedefs. Removed all of them. Have not tested 
PC version since doing so. 
Eco-C hangs during compilation of main.c or sedslip.c. 
 
----- 
After discussions with Herb Johnson, I want to move the polling loop to main.c 
from tinytcp.c.  This will allow the entire package to be linked as a subrou- 
tine library to any other application (or operating system). 
 
The program has been broken into many parts to allow compilation with Hi-Tech 
C.  Hi-Tech is a very compatible compiler, with most of the features of 
Microsoft C and producing pretty good code, but it's big and doesn't have room 
for big source files.  This is a temporary limitation, however. 
 
I'm irritated by the fact that C is more complex than necessary and seems to 
be moving away from the simplicity one would expect of a 'high-level 
assembler'.  Small-C would be alright except for its arbitrary syntactical 
limitations and poor generated code.  BDS C does not support 'long' variables, 
which are used heavily in TCP/IP.  Coding all of the long operations to work 
with BDS C is certainly an option, but it will make the source code much 
bigger and harder to read. 
 
Long math is certainly not efficient on a Z80, especially multiplies and 
divides, so steps should be taken to minimize these. 
 
On the Xerox 820, this code does not perform well.  I have been able to trans- 
fer a file, but the program crashes shortly after.  I'd like to streamline 
the code, simplify it, so that it can be made more efficient. 
 
On the Kaypro, the interrupt logic is still not working correctly.  Interrupt 
code must be located above x8000, because the video display may be switched 
in.  The stack also must be located above that, but that should not be a 
problem.  Still, something is not working right. 
 
In both cases, we could eliminate the interrupt logic and run at 1200 baud or 
less, and things would probably work. 
 
On the PC, it all works fine.  We need to test for compatibility with KA9Q and 
IBM TCP/IP SLIP. 
-1	:BB: