summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/tftp.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-111-4/+0
| | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson
* Fix transfer statistics in the "send file" case - The conditional usedgavin2010-06-271-4/+1
| | | | | | | | | | | | | to print the stats were using an uninitialised variable. [1] Fix trasnfer statistics in the "receive file" case - the statistics struct was being cleared both before and after the initial connect to the remote server. As a result, the printed time and calculated bandwidth covers the time to connect ad well as the time to transfer the file. This may not be ideal, but now at least matches the "send file" case. Found by: clang static analyser [1] Reviewed by: imp
* Fix core dump when server fails to respond.gavin2010-06-271-1/+4
| | | | Reviewed by: imp
* Go ahead and merge the work edwin@ on tftpd into the tree. It is aimp2010-05-041-396/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lot better than what's in the tree now. Edwin tested it at a prior employer, but can't test it today. I've found that it works a lot better with the various uboot versions that I've used in my embedded work. Here's the pkg-descr from the port that describes the changes: It all started when we got some new routers, which told me the following when trying to upload configuration or download images from it: The TFTP server doesn't support the blocksize option. My curiousity was triggered, it took me some reading of RFCs and other documentation to find out what was possible and what could be done. Was plain TFTP very simple in its handshake, TFTP with options was kind of messy because of its backwards capability: The first packet returned could either be an acknowledgement of options, or the first data packet. Going through the source code of src/libexec/tftpd and going through the code of src/usr.bin/tftp showed that there was a lot of duplicate code, and the addition of options would only increase the amount of duplicate code. After all, both the client and the server can act as a sender and receiver. At the end, it ended up with a nearly complete rewrite of the tftp client and server. It has been tested against the following TFTP clients and servers: - Itself (yay!) - The standard FreeBSD tftp client and server - The Fedora Core 6 tftp client and server - Cisco router tftp client - Extreme Networks tftp client It supports the following RFCs: RFC1350 - THE TFTP PROTOCOL (REVISION 2) RFC2347 - TFTP Option Extension RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) It supports the following unofficial TFTP Options as described at http://www.compuphase.com/tftp.htm: blksize2 - Block size restricted to powers of 2, excluding protocol headers rollover - Block counter roll-over (roll back to zero or to one) From the tftp program point of view the following things are changed: - New commands: "blocksize", "blocksize2", "rollover" and "options" - Development features: "debug" and "packetdrop" If you try this tftp/tftpd implementation, please let me know if it works (or doesn't work) and against which implementaion so I can get a list of confirmed working systems. Author: Edwin Groothuis <edwin@FreeBSD.org>
* Fix return code in the case of successful file transfer, broken ingavin2010-01-031-2/+6
| | | | | | | | | tftp.c 1.13 PR: bin/117452 Submitted by: Spencer Minear minear securecomputing.com Approved by: ed (mentor) MFC after: 2 weeks
* ANSIfy, plus constify interfaces where possible.delphij2008-10-131-32/+12
|
* Set txrx_error to 1 when we reach abort. This makes the program correctly ↵matteo2006-09-281-0/+2
| | | | | | | | | | set the exit code. The PR has further details on this. PR: bin/103206 Submitted by: John Hickey <jjh-freebsd@daedalian.us> MFC after: 3 days
* Use socklen_t where appropriate.stefanf2005-08-051-2/+2
|
* To perform even basic error checking, one must have an exit code thatbsd2002-05-121-0/+4
| | | | | | | | indicates that not everything worked as expected. Exit non-zero if we timed out while transmitting or receiving a file or if the file did not exist, etc. MFC After: 3 days (re@ willing)
* IPv6 support for tftp/tftpd.ume2002-04-111-16/+57
| | | | | Obtained from: KAME MFC after: 2 weeks
* Clean up vendor ID and FBSDID.dwmalone2002-03-301-5/+7
| | | | We now seem to include <arpa/inet.h> to get ntoh*.
* remove __Pimp2002-03-221-7/+7
|
* WARNS=2 fixes. NO_WERROR set as there are some hard-to-fixmarkm2001-12-111-21/+19
| | | | signed/unsigned comparisons. Use __FBSDID().
* Fix tftpd and tftp to support file transfers of over 65535 blocksasmodai2001-02-021-2/+4
| | | | | | | (about 31 MB - 32 MB). Submitted (partially) by: Pascal Hofstee <daeron@wit401305.student.utwente.nl>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Rename a function name so that it doesn't conflict with a future system call.dg1998-10-301-2/+2
|
* Add #include <string.h> to get prototypes.jb1998-02-201-1/+2
|
* Use err(3). 100 -> MAXHOSTNAMELEN from OpenBSD.charnier1997-08-141-7/+10
| | | | Obtained from: OpenBSD
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+453
OpenPOWER on IntegriCloud