tcpipstack
所属分类:网络编程
开发工具:C/C++
文件大小:818KB
下载次数:27
上传日期:2006-08-08 11:28:26
上 传 者:
wqian
说明: tcpipstack源程序用于C51的TCP/IP协议栈,,C-C++,TCP/IP Stack
(tcpipstack C51 source for the TCP/IP protocol stack, and C-C, TCP/IP Stack)
文件列表:
tinytcp\!INDEX (443, 2005-02-05)
tinytcp\8668-101.zip (34119, 2005-02-05)
tinytcp\code\ADDZ.C (692, 2005-02-05)
tinytcp\code\ADDZ.EXE (8569, 2005-02-05)
tinytcp\code\ARP.C (4216, 2005-02-05)
tinytcp\code\BU.BAT (126, 2005-02-05)
tinytcp\code\CASYNCMS.ASM (6868, 2005-02-05)
tinytcp\code\CASYNCMS.H (338, 2005-02-05)
tinytcp\code\COPYING (23447, 2005-02-05)
tinytcp\code\D.BAT (33, 2005-02-05)
tinytcp\code\DOS.MAK (5066, 2005-02-05)
tinytcp\code\FILEIO.C (3017, 2005-02-05)
tinytcp\code\FILEIO.H (836, 2005-02-05)
tinytcp\code\GRAPH.BAT (181, 2005-02-05)
tinytcp\code\L1.SUB (73, 2005-02-05)
tinytcp\code\MAIN.C (3007, 2005-02-05)
tinytcp\code\MAKECPM.SUB (252, 2005-02-05)
tinytcp\code\NETSCPM.RSP (258, 2005-02-05)
tinytcp\code\OPTIONS.H (2513, 2005-02-05)
tinytcp\code\PROTO.H (3424, 2005-02-05)
tinytcp\code\ROOM.AS (617, 2005-02-05)
tinytcp\code\ROOM.MAC (475, 2005-02-05)
tinytcp\code\SED.C (8035, 2005-02-05)
tinytcp\code\SED.H (3766, 2005-02-05)
tinytcp\code\SEDSLIP.C (4871, 2005-02-05)
tinytcp\code\TEST.C (1152, 2005-02-05)
tinytcp\code\TEST.EXE (8081, 2005-02-05)
tinytcp\code\TINYFT2.C (7123, 2005-02-05)
tinytcp\code\TINYFT3.C (6019, 2005-02-05)
tinytcp\code\TINYFT4.C (3850, 2005-02-05)
tinytcp\code\TINYFT5.C (3773, 2005-02-05)
tinytcp\code\TINYFTP.C (6707, 2005-02-05)
tinytcp\code\TINYTC1.C (4940, 2005-02-05)
tinytcp\code\TINYTC2.C (2323, 2005-02-05)
tinytcp\code\TINYTC2.SHA (1024, 2005-02-05)
tinytcp\code\TINYTC3.C (5581, 2005-02-05)
tinytcp\code\TINYTC3.SHA (16361, 2005-02-05)
tinytcp\code\TINYTC4.C (8791, 2005-02-05)
tinytcp\code\TINYTC5.C (9700, 2005-02-05)
... ...
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, 1***6
|===================================================================|
| 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.
近期下载者:
相关文件:
收藏者: