⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 一个简单的tftp服务器
💻
字号:
This server (tftpserverspV1.5) is single port TFTP Server based on Trivial FileTransfer Protocol and is normally used for PXE Boot or other Network Boots. Itsupports advance options like tsize, blksize, block number rollover and timeout.There is one multiport version (tftpservermtV1.5) also available on website. Ifyou donot have firewall issues, you should use that. Multiport server acceptsall requests on listening port but responds on a new port for each request, usinga separate thread. Multithreaded version runs little faster.On contrary, this single port server responds to requests back on samelistening port. This way firewall need to be opened for one port only.Despite using single port, it too can serve multiple clients at same time.This is Stable Release 1.5CHANGES  in 1.51) Bug about filename being too large is fixed2) Read, Write and Overwrite permissions can be configured independentlyBUGS FIXED in Release 1.411) LogFile bug fixed.ENHANCEMENTS in Release 1.41) Code Cleanup.BUGS FIXED in Release 1.311) Max Block Size is 65503 now.2) Code Cleanup and More Error HandlingNEW FEATURES in Release 1.31) Listening ports can also be specified. Ports more than 1024 do not need root account2) Block size can now be as large as 65464.3) Block Number rollover added, allowing transfer of files of any size.NEW FEATURES in release 1.21) Multiple Listening Interfaces can be specified.2) Logging has been added.3) Multiple directories can be added to home using aliases4) Permitted Hosts can be specifiedINSTALLATIONExpand the .gz file to an directory, using shell, goto that directory,edit tftpserver.ini file (may just specify home dir), move tftpserver.inifile to /etc directory or specify file locations with -i and -l flags.This program may be setup to start automaticallymodifying boot scripts /etc/rc.d/rc.local file or/etc/inittab file. Never include -v (verbatim flag) whilerunning as Daemon from these scripts.COMPILINGThe included file tftpserver is an executive file for Linux/Intel only.YOU NEED TO RE-COMPILE ON Other Platforms like AIX, Solaris on GCC as:-g++ tftpserver.cpp getServers.cpp -otftpserver -lpthread c++ tftpserver.cpp getServers.cpp -otftpserver -lsocket -lnsl -lpthread (on solaris)TESTINGThis server runs in Debug Mode (with flag -v) or as Service (without any flag).give following command as root:-tftpserver#./tftpserver -vYou will see following results:-Starting TFTP...Alias / is mapped to /home/Listening On: 192.168.0.19Listening On: 127.0.0.1Permitted Clients: Allmax blksize: 9192defult blksize: 512default interval: 5Overwrite Existing Files: YesAccepting Requests...Now open one more shell and give following commands:-$tftp localhosttftp>get [some file name in home dir]Received 13112 bytes in 0.0 secondsand on server you may seeclient 127.0.0.1:xxxxx file ...... # blocks servedRUNNINGThis program runs in two modes:-a) Verbatim Mode (using -v argument)b) Daemon (not using -v argument)This program uses helper files:-i)   -i[inifile], where configuration settings can be specified,     default is /etc/tftpserver.iniii) -l[logfile] dumps log to this file in daemon mode, default is syslogYou can run as:-[Install Dir]/tftpserver (daemon with default files)[Install Dir]/tftpserver -v (verbatim with default files)[Install Dir]/tftpserver -i inifile -l logfile (as daemon)[Install Dir]/tftpserver -i inifile (as daemon)[Install Dir]/tftpserver  -v -i inifile as verbatimDAEMONIZINGThis program should be setup to start automaticallymodifying boot scripts in /etc/rc.d/rc.local fileor /etc/inittab file or /etc/rc.d/rc.inet2 file.Never include -v (verbatim flag) while runningas Daemon from these scripts. There are two alternatives:-i)  Just add the start line in any of above files.ii) Add the enclosed rc.tftpserver script in /etc/rc.d    and make it executable (755). Also you need to add the    lines:-	    # Start the Dual DHCP DNS Server daemon:	    if [ -x /etc/rc.d/rc.tftpserver ]; then	      /etc/rc.d/rc.tftpserver start	    fi    to any of above scripts (preferably to /etc/rc.d/rc.inet2)Alternative ii) is recommendedCONFIGURATIONYou need home directory(s) to be set in tftpserver.ini file, andmove this ini file to /etc direcory. you may leave otherparameters commented like blksize and interval.You can use single directory as HOME directory. That case, all paths are appended to HOME directory. For example, your entry under [HOME] is:-[HOME]/opt/bootfilesThen any request would be translated as"get myfile/bootfile.boot" to /opt/bootfiles/myfile/bootfile.boot on server.it would be simply prepended to requested file path.But if you use an alias like[HOME]a=/opt/bootfilesb=/asdf/sdf/sfsdc=/opt/sfrd/dsfrThen your requests would be translated as:-"get a/myfile/bootfile.boot" to /opt/bootfiles/myfile/bootfile.boot"get b/myfile/bootfile.boot" to /asdf/sdf/sfsd/myfile/bootfile.boot"get c/myfile/bootfile.boot" to /opt/sfrd/dsfr/myfile/bootfile.booton server (alias would be substituted with it's value)In this case any request, not starting with any of alias a,b,c would be errored out.The advantage of using alias is you can specify multiple locations.LICENSE1) This program is released under GNU GENERAL PUBLIC LICENSE, Version 2, June 19912) This document is also released under above license.DEBUGIf program is not responding:-1) Ensure that you run this program as root only if listening on ports less than 1024.2) Check network hardware.3) Run in verbatim mode first (with -v flag), it will provide all debug information   as it verbatim the activities.4) Errors like "bind failed" means another tftpserver is running and listening   at port 69. You can only have one tftp server running at a time. It may also   come if interface specified under [LISTEN-ON] is not physically available on Server.   If you have specified [LISTEN-ON] option, check that ip and interface are Active.   Root account is needed for listening on ports less than 1024 including tftp default   port 69. If you are not using root account and using default port or port less than   1024, you may still get this error.5) You may try recompiling (see COMPILING above).6) Errors like "libstdc++.so.?: cannot open shared object file: No such file or directory"    are possible in some Unix/Linux flavours. Please recompile the program or create symbolic links:-	ln -s /usr/local/lib/libstdc++.so.? /usr/lib/libstdc++.so.? 	ln -s /usr/local/lib/libgcc_s.so.? /usr/lib/libgcc_s.so.?   (? is library version as reported in error)   or add the library path (directory where above file is) to env variable LD_LIBRARY_PATH.7) Max size of file being transfered depends on block size, the max block count being 65536,   it would be 512*65536 or 32MB. This limitation can be increased by increasing block size   upto 65464 which makes the max file size to 4.2 GB. However the block size also depent on   client. Most clients like Unix/Linux support block number rollover, which make the max    file size unlimited, irrespective of block size.UNINSTALLATIONJust remove the program directory. You should also remove entries from initialize scripts of your machine.If you find any problem with this program or need more features, please send mail to achaldhir@gmail.com.You may also send thanks email if it works fine for you.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -