Martin Sunstrum
2004-Jul-30 16:13 UTC
[syslinux] tftp-hpa server hooks to external programs
Hello tftp-hpa community, I am trying to locate a tftp server that I can integrate with an external program/database application, and was wondering if tftp-hpa might have the capability I am looking for. Upon the tftp server receiving a read request, and before it sending a read request reply, I would like to communicate to an external program (and/or database). In real-time, the external program may or may not place the requested file into the TFTP server directory. The purpose is to dynamically place files into the TFTP server location only based on certain database criteria being met. In addition, when a file is transferred from the TFTP server directory, the ability to know the status of the transfer would be desired. Any help on this issue is greatly appreciated, Regards, Martin Sunstrum msunstrum at aksysnetworks.com
Hi, I wrote a patch to tftp-hpa which provides the functionality you need. I also patched tftpd man, so you should find all the documentation needed. This patch was actually developped against tftpd-hpa debian source package (unstable 0.36-1), but it should work out of the box with tftp-hpa 0.36 sources. If my code can be reviewed and accepted, it could be great if it then get integrated into tftp-hpa main sources...:) NB: - I also added a -f switch to run the server in the foreground (a la named or dhcpd) - some read and write were replaced with fread ant fwrite as it was bug prone. Regards, -- Pierre NEYRON
> Martin Sunstrum wrote: > I am trying to locate a tftp server that I can integrate with an external > program/database application, and was wondering if tftp-hpa might have the > capability I am looking for.Hi Martin, I wrote a patch to tftp-hpa which provides the functionality you need: I added a -g switch which define a script to be run if the requested file is not found. The output of this script is then sent to the tftp client. I also patched tftpd man, so you should find all the documentation needed. This patch was actually developped against tftpd-hpa debian source package (unstable 0.36-1), but it should work out of the box with tftp-hpa 0.36 sources. You can download it there: http://npf.free.fr/tftpd-hpa/tftp-hpa-0.36-1_0.36-1cm.patch NB: - I use the -g switch to activate the functionality, but I am wondering if using a new remap action instead may be a better way to handle it. - I also added a -f switch to run the server in the foreground (a la named or dhcpd) for debugging purposes. - some read and write were replaced with fread ant fwrite as it was bug prone. PS: HPA, It's been 3 times I tried to send this message with the patch to the mailing list unsuccessfully, because of a "suspicious header" (?). Messages were told to be waiting for moderation, but they seem to simply be dropped. I don't understant where I was wrong, it was just normal replies with an attachment. Regards, -- Pierre NEYRON