Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
TFTP_C.C
Package: ertos.rar [view]
Upload User: sunrenlu
Upload Date: 2022-06-13
Package Size: 1419k
Code Size: 1k
Category:
OS Develop
Development Platform:
DOS
- /*
- * tftp_c.c - sample tftp client
- */
- #include <rtos.h>
- #include <net.h>
- #include <process.h>
- #include <string.h>
- #include <tftp.h>
- main(int argc, char **argv)
- {
- DWORD host;
- int put;
- char *filename;
- char *hostname;
- int result;
- kdebug = 1;
- rt_init( 100 );
- sock_init();
- if ( argc < 4 ) {
- cprintf("%s GET|PUT hostname filenamern", argv[0]);
- exit( 3 );
- }
- put = !stricmp( argv[1], "put");
- hostname = argv[2];
- host = resolve( hostname );
- filename = argv[3];
- if ( host == 0 ) {
- cprintf("ERROR: unable to resolve %srn", hostname );
- exit( 3 );
- }
- if ( put ) {
- cprintf("rnUploading %s to %s...", filename, hostname );
- result = tftp( host, TFTP_PUT, filename );
- } else {
- cprintf("rnDownloading %s from %s...", filename, hostname );
- result = tftp( host, TFTP_GET, filename );
- }
- cprintf( "%srn", result ? "failed" : "success");
- return( result ? 2 : 0 );
- }