From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Ceresoli Date: Wed, 13 Apr 2011 14:47:26 +0200 Subject: [U-Boot] [RFC] Act as a TFTP server In-Reply-To: <20110413113735.3115914F02E@gemini.denx.de> References: <4DA5682A.8040203@comelit.it> <20110413113735.3115914F02E@gemini.denx.de> Message-ID: <4DA59B5E.5000105@comelit.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang, thanks for the feedback. Wolfgang Denk wrote: > ... >> From the user point of view, I would implement a new command, activated only >> when CONFIG_CMD_TFTPSRV is defined: >> >> Usage: tftpsrv [] >> >> This would be used almost like tftpboot, except no file name is specified on >> the commandline. >> would default to the environment variable. > I see some user interface issues here: > - When and how do you terminate this command? After a successful > download, ok. But how long do we wait for that? Forever? Or do we > time out? The TFTP client tries sending a RRQ packet TIMEOUT_COUNT times (default 10), spaced TIMEOUT msecs (default 5000) from each other. 50 seconds total by default. I would keep the same scheme for the server, except it would obviously not send anything after each timeout. This would allow to print something every 5 seconds, for user feedback. > - It would be nice if the user could terminate the command using ^C. Sure. The main loop in NetLoop() would be unchanged, so I expect ctrlc() to work for free in the same way it does for the TFTP client. Luca