Grandfather Frost, this is not a request, but a real offer to earn ...

In one of the discussions, I promised to write a TFTP, so far only the server. I do not know how putting up solutions fits into the framework of this site, but let's try to find out what will come of it.

My description page: , SVN svn: // 2402 / usr / svn / opensource / msv-tftpd and code for those too lazy to climb on svn . Last saved in msv-tftpd.cpp and g ++ ./msv-tftpd.cpp. Test Linux tftp.

Please do not beat all the code in one file. It's easier for me to develop. If done according to the standard, there will be twenty files, headers in h, code in cpp. And the development will trivially rise.

It is worth reading the code from the bottom with the function main (), gradually getting higher. An attempt to read from above will blow up the brain as a result of a violation of logical connection.

I remember there were questions. The server is only on UDP, you have to think about TCP. For the API, I do not see the point and need. Someone said that in Linux and Windows a different format of text files. In general, they are the same, \ r \ n does not count. The problem with the transition to Linux is that you need to take into account some features and connect the necessary libraries. Advice to write on pure C, well, it's wrong to lose all power with ++.

Actually like that. Let the questions in your answers :)

  • one
    What is the essence of the proposal? $$$ for transferring the program under linuh? - gecube
  • To be honest, I thought it would be interesting to people. I see miscalculated with the popularity of the project. When I said that I wanted to write TFTP there were a lot of questions and suggestions. The point is to continue an interesting discussion. Can tie API or attach TCP. So I will add to the logical conclusion and put on the shelf. And it works under Linux. And under the android I will transfer, I will practice in adding programs to the market. - mikelsv
  • @mikelsv, while not working (in Linux). But, for a rush plus. Gathered with wrnings. To start not from the root, the port had to be corrected (at 1169). Help (./out --help) no (this is bad) . The file was not transmitted (at the end (up to 512 bytes) dirt). So far I don’t want to be a beta tester. - avp
  • It works for me. What is your Linux? It is a tradition to gather with Warning, there are three of them and they do not affect the performance. Yes, this port is available only from the root. Development in progress. Parameter analysis and help output will be in future versions, as well as reading settings from a file. In svn is a new version with logs, advanced settings and support for writing a file to the server. All my tests went fine, I checked tftp: connect ip, get msv-tftpd.cpp. And on other files, too, there are no problems. On two Linux debian and Fedora. What program did you check and with what settings, what compiler - mikelsv
  • one
    "It is a tradition to gather with the warnings." Yeah. Scary tradition. - alexlz

1 answer 1

@mikelsv , my comments ran out.

You would have laid out a more or less detailed description of your program somewhere (in an easily accessible place and text format) (what it should and should not do). And the protocol of access to it (including the format of UDP packets) and the reaction to erroneous packets.

Or do you think that there are many who want to test it, studying the source without normal comments? I hope you understand that studying (and even reading) the RFC is also lazy.

All the same, is your goal another TFTP server implementing rfc (with your additions about hackers)? Or are you going to add a new functionality (for example, viewing the table of contents, getting stat () for a file)? What do you think about different encodings of Russian (file names) in different systems?

It may be worthwhile to first solve (discuss) similar questions, and only then write code.