No description
  • Go 90%
  • Makefile 10%
Find a file
2025-11-26 11:38:27 -07:00
.github Upgrade to GitHub-native Dependabot 2021-04-28 22:39:50 +00:00
.gitignore update tftp library to v3 2023-04-20 12:44:11 -06:00
go.mod bump 2025-11-26 11:38:27 -07:00
go.sum bump 2025-11-26 11:38:27 -07:00
gotftp.go update tftp library to v3 2023-04-20 12:44:11 -06:00
LICENSE add working code 2018-06-08 14:58:09 -06:00
Makefile rename main.go to project name and add Makefile 2019-09-26 09:21:37 -06:00
README.md update README 2019-09-26 10:14:07 -06:00

gotftp

Go TFTP client

TFTP Background

This is a very simple implementation of a TFTP server. TFTP is a very simple protocol to transfer files. It is from this that the name comes, Trivial File Transfer Protocol or TFTP.

TFTP is defined in RFC 1350

Usage

  -addr string
    	Server address (default "localhost:69")
  -file string
    	Name of the file on server (default "<filename>")
  -mode string
    	Transfer mode: 'octet' or 'netascii' (default "octet")
  -op string
    	What to do: download or upload file (default "<get|put>")
  -path string
    	Local file path (default ".")

-addr is the address/port that the system will connect to.

-file is the filename to be transferred

-mode is the mode using either ascii or octer (formerly binary) reference in Section 1 Paragraph 2 of RFC 1350 linked above.

-op is the transfer mode get downloads, put uploads

-path is the directory where the files that need to be transferred are stored.

Example

We want to download a firmware image for a router. The file is called newfirmware.bin and we are going to store it in our downloads folder. Our computer and user has the permissions to run on privileged ports (<1024).

Change directory to where the file is to be stored.

cd downloads

List the files to make sure the file is stored.

ls -l

total 0

Download the file from the tftp server.

gotftp -addr tftpserver:1069 -file newfirmware.bin -op get
1678336 bytes recieved

When the client downloads the file we can that the transfer happened.