Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
tftp.c File Reference

Go to the source code of this file.

Functions

 int (W32_CALL *_tftp_write)(const void *
 
static void send_req (char request, const char *fname)
 
static void send_ack (WORD block)
 
static const char * tftp_strerror (int code)
 
static void udp_callback (_udp_Socket *s, int icmp_type, int icmp_code)
 
static int recv_packet (DWORD block)
 
static int tftp_open (DWORD server, const char *fname)
 
static void tftp_close (void)
 
char * tftp_set_server (const char *name, int len)
 
char * tftp_set_boot_fname (const char *name, int len)
 
static char * tftp_set_xfer_mode (const char *name)
 
static int tftp_get_block (const char **buf)
 
int tftp_boot_load (void)
 
static void (W32_CALL *prev_hook)(const char *
 
static const char *static void
W32_CALL 
tftp_cfg_hook (const char *name, const char *value)
 
static void tftp_exit (void)
 Free allocated memory.
 
int tftp_init (void)
 Initialize config-hook for TFTP protocol.
 
static int W32_CALL close_func (void)
 
static int W32_CALL write_func (const void *buf, size_t length)
 
void usage (char *argv0)
 
int main (int argc, char **argv)
 

Variables

 size_t = NULL
 
static struct tftphdrinbuf
 
static struct tftphdroutbuf
 
static sock_typesock
 
static DWORD currblock
 
static int blocksize
 
static int ibuflen
 
static int isopen
 
static int tftp_errno = 0
 
static DWORD tftp_server = 0
 
static int tftp_timeout = TFTP_TIMEOUT
 
static int tftp_retry = TFTP_RETRY
 
static int tftp_lport = 0
 
static char tftp_server_name [MAX_HOSTLEN] = ""
 
static char tftp_xfer_mode [MAX_VALUELEN] = OCTET_STR
 
static char * tftp_boot_remote_file = NULL
 
static char * tftp_boot_local_file = NULL
 
static char * tftp_openmode = NULL
 
static FILE * file
 
static char * fname
 
static DWORD tot_size
 
static time_t start
 

Detailed Description

TFTP client.

Boot-ROM-Code to load (any file or) an operating system across a TCP/IP network.

Module: tftp.c Purpose: Get a file with TFTP protocol Entries: tftp_boot_load, tftp_set_server, tftp_set_boot_fname

Copyright (C) 1995,1996,1997 Gero Kuhlmann gero@.nosp@m.gkmi.nosp@m.nix.h.nosp@m.an.d.nosp@m.e

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Major changes for Watt-32 by G. Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o 1999

This client adheres to RFC-1350 (TFTP v2), but supports only reading from a remote host.

Todo:
Support option negotiation and ETFTP (RFC-1986)

Definition in file tftp.c.