This web page publishes two pieces of software: BTP (which is a client/server modeled after UNIX's ftp) and a TCP/IP client/server skeleton. These programs are published in source form. As noted, BTP is modeled after the Internet ftp, but it does not use ftp protocol, as defined by RFC 959
Well, actually there are no "frequently asked questions" about BTP, since no one has asked questions yet. This is really the BTP documentation in FAQ form.
Bear Transfer Protocol is designed to transfer files between any combination of UNIX and NT systems. The program is loosely based on the UNIX and NT utility FTP. Unlike FTP, the BTP program has no security features. Nor will it time out. It simply transfers files. Like FTP, the BTP program supports text and binary transfer modes and commands like 'cd', 'pwd' and 'ls' (the help command will print all the currently supported commands). You should use the "binary" mode to transfer binary files, ziped file and tar files. As far as I can tell, ftp will limit the amount of bandwidth it uses. In contrast, BTP is not shy about hogging as much of the available bandwidth as it can. Finally, BTP is provided in source form, subject to the copyright.
I wanted a program like BTP for my own use. Writing BTP was also a way to learn to write TCP/IP socket software. When I started writing BTP I had no experience with TCP/IP socket software. The program consists of about 5,000 lines of C++. It took me about five months of sporadic nights and weekends to arrive at a version that is good enough to publish. The book UNIX Network Programming: Networking APIs: Sockets and XTI, Volume I, second edition, by W. Richard Stevens was an invaluable reference in writing BTP. I also made use of the documentation provided as part of the Microsoft Developer Network level II subscription.
To be less coy... Many of the reasons for writing BTP are no longer valid now that the secure copy (scp) utility is widely available. Unlike some versions of ftp, BTP leaves no logs recording what it transfers. Secure copy (scp) is even better when it comes to privacy, since it leaves no logs and encrypts the data. Scp is also careful about the system it logs into and asks you about the system fingerprint.
Before I wrote BTP I searched around on the Internet for a similar program and could not find one. BTP may be useful to others, so I would like to share it. Providing it in source form also allows me to show off my software "chops" (as they say in jazz). And who knows, perhaps someone who uses BTP will realize I can help them with their networking software startup and we will make buckets of money together (hey, I can always dream). BTP is not published under a "copyleft" license. For an essay on free software and a discussion of why BTP is not copyleft free software, click here.
The BTP program is for software engineers or others who have software development and software build skills. BTP is published in source form, so if you don't have a C++ compiler, you can't use BTP. Please don't send me e-mail asking for a binary version. Also if you have never heard of a "makefile" then BTP may not be for you. No support is provided for BTP. Also, you use BTP at your own risk. I have tested the software and used it myself, but client-server software of this type is difficult to verify. If you find a bug, please send me email describing the bug. Even better, if you find a bug and have a fix, please send that. If I have time I will be happy to answer questions sent to me via e-mail, but sometimes my life gets pretty hectic and this time does not exist.
The BTP program has been tested and built on Windows NT, FreeBSD UNIX and Solaris 5.6. BTP has not been built or tested on Windows 98 or Windows 95.
I don't know about you, but I find zip (Pkzip) a pain. I was trying to unpack some files that had been ziped and it took half an hour to find the right version of zip and the right command line argument so that zip would respect the zip file directory structure. To avoid such nastiness the BTP source is in tar file format and gzip (GNU zip) compressed. Almost every UNIX system has these programs. If you are using a Windows system and you don't have these tools you can down load them here. This code is courtesy of Cygnus and is free software.
Bear Transfer Protocol source, version 1.2, June 3, 1999
gzip -d file
(where file will be either btp_tar.gz or btp.tar.gz, depending on whether the platform is UNIX or NT)
tar xvf file
(where file will either be btp_tar or btp.tar, depending on whether the platform is UNIX or NT)
This will unpack the BTP files in the current directory.
BTP was built and tested on three platforms:
There is a makefile for each system. Use the following commands for the associated operating system:
make -f Makefile_solaris
make -f Makefile_bsd
nmake -f Makefile_bsd
Note that the Windows NT build uses Microsoft's brain damaged version of "make", nmake.
This will build two executables:
Ok, you may have noticed that I'm a bit conflicted on the names (I've referred to the program as BTP and then what do you find - I call them ftp_client and ftp_server). When I developed the software I thought of it as a file transfer program. But it is not compatible with the FTP server supported by UNIX systems and Windows NT, so I call it BTP (after all, this is bearcave.com).
The ftp_server program is run on one system and the ftp_client program is run on another. The ftp_client program supports the command line prompt. Entering "help" will show all the supported commands.
Telnet into one system and run the ftp_server program. From the other system run the ftp_client, giving the name of the remote system or its IP address. For example:
ftp_client bearcave.comor
ftp_client 192.168.15.13The client and server use port 5001 by default. To use another port use the -p port command line argument (for example, -p 6543). Note that if you use a different port, you must use the port command with both the client and server.
BTP is single threaded so while you are using it, no one else can create a BTP session. This is a feature, not a limitation, since currently BTP does not support password security.
Do not leave the BTP server running on your system. There are hacker tools that will identify ports with associated servers. If someone else attaches to your BTP server they can wander around your file system transferring files back and forth if they have their own copy of BTP. This seems rather unlikely, but I wanted to warn you just in case.
The source in the tar'ed and gzip'ed file below implements a TCP/IP client/server command processor. The client and server can pass both commands and packages of commands and data between them. It should be possible to rapidly modify this code to support a variety of client/server applications. The client/server uses several of the classes from BTP. A couple of these classes are slightly modified.
This code has Makefiles for Solaris, Free BSD and Windows NT. However, the client and server do not adjust for endianness, as does BTP. So if you are using the client/server between, say, an iNTEL system and a Sun, you will have to call the class functions to handle endianness.
As with BTP, you use this software at your own risk. No support is provided. Also like BTP this is not free software. See the BTP copyright for restrictions.
TCP/IP client/server command processor source, version 1.2, November 14, 2002
This is a simple client/server set that is useful for testing and experimenting with TCP socket code. This is my version of the echo client/server published in UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI, by W. Richard Stevens. This code may be used without restriction (since it is based on published code).
Click here to down load the echo client/server (echo.tar)
I did a search on www.freshmeat.net, a free software repository, for "ftp source". Several programs turned up, but the most sophisticated one I found is www.ftp4all.de. This is an open source program that supports true FTP protocol, instead of simple file transfer (like BTP).
Ian Kaplan
June 1999
Last updated: April 2004