[Dnsmasq-discuss] Feature Request: tftp-script

Simon Kelley simon at thekelleys.org.uk
Mon Mar 19 11:18:34 GMT 2012


On 18/03/12 07:09, Shantanu Gadgil wrote:
> Hi,
>
> I was wondering whether it would be possible to have hooks for the TFTP operations, just like the DHCP operations.
>
> This is just a rough thought for now ...
> When a TFTP request is made from the client (or is successful when the file is /actually/ provided), I want to be able to log the IP adress (or maybe send a mail) to collect some data as to how many network based installations actually started, etc.
>
> If it could be possible to have the filename as one of the parameters in the hook, it would be even better, as then I can isolate actual installations that started, as opposed to TFTP requests which just loading the PXE menu.
>
> Regards,
> Shantanu

That sounds to me like a very sensible suggestion.

There are two obvious ways to do it: either add an extra hook 
(--tftp-script), or add an extra possible "action" value to the current 
--dhcp-script. I think the later is how I'd do it if starting from 
scratch, but it has the disadvantage of possibly breaking existing 
script code. On the other hand, any sane script should just ignore 
unrecognised actions; the example code supplied with dnsmasq does.

Any script users out there, please check your code, would adding another 
value to {add, old, del, init} break stuff?



Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list