public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How to generate broadcast TFTP read request?
@ 2024-11-07 18:06 Grant Edwards
  2024-11-08  3:44 ` Alexis
  2024-11-08  8:54 ` karl
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Edwards @ 2024-11-07 18:06 UTC (permalink / raw
  To: gentoo-user

I need to generate a broadcast UDP TFTP read request, and the usual
TFTP client tools I use (atftp, tftpy) can't do that.  Does anybody
have a suggestion for an easy wat to generate such a request?

All I need is to generate the initial request.  I don't need to handle
the actual data.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] How to generate broadcast TFTP read request?
  2024-11-07 18:06 [gentoo-user] How to generate broadcast TFTP read request? Grant Edwards
@ 2024-11-08  3:44 ` Alexis
  2024-11-08  8:54 ` karl
  1 sibling, 0 replies; 4+ messages in thread
From: Alexis @ 2024-11-08  3:44 UTC (permalink / raw
  To: gentoo-user


Grant Edwards <grant.b.edwards@gmail.com> writes:

> I need to generate a broadcast UDP TFTP read request, and the 
> usual
> TFTP client tools I use (atftp, tftpy) can't do that.  Does 
> anybody
> have a suggestion for an easy wat to generate such a request?
>
> All I need is to generate the initial request.  I don't need to 
> handle
> the actual data.

Use the Python `socket` module?

  https://wiki.python.org/moin/UdpCommunication


Alexis.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] How to generate broadcast TFTP read request?
  2024-11-07 18:06 [gentoo-user] How to generate broadcast TFTP read request? Grant Edwards
  2024-11-08  3:44 ` Alexis
@ 2024-11-08  8:54 ` karl
  2024-11-08 13:59   ` [gentoo-user] " Grant Edwards
  1 sibling, 1 reply; 4+ messages in thread
From: karl @ 2024-11-08  8:54 UTC (permalink / raw
  To: gentoo-user

Grant Edwards:
> I need to generate a broadcast UDP TFTP read request, and the usual
> TFTP client tools I use (atftp, tftpy) can't do that.  Does anybody
> have a suggestion for an easy wat to generate such a request?
...

 Tftp is specified by:
https://www.rfc-editor.org/rfc/rfc1350.txt

 To send datagrams to the broadcast address, you need to
 set SO_BROADCAST in setsockopt(), so unpatched the traditional
 clients won't work. For details see:
  man 7 socket
  man setsockopt

 Theese might help:
https://www.abc.se/~m6695/udp.html
https://people.cs.rutgers.edu/~pxk/417/notes/sockets/udp.html
https://users.cs.jmu.edu/bernstdh/web/common/lectures/summary_unix_udp.php

Regards,
/Karl Hammar



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] Re: How to generate broadcast TFTP read request?
  2024-11-08  8:54 ` karl
@ 2024-11-08 13:59   ` Grant Edwards
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2024-11-08 13:59 UTC (permalink / raw
  To: gentoo-user

On 2024-11-08, karl@aspodata.se <karl@aspodata.se> wrote:
> Grant Edwards:
>> I need to generate a broadcast UDP TFTP read request, and the usual
>> TFTP client tools I use (atftp, tftpy) can't do that.  Does anybody
>> have a suggestion for an easy wat to generate such a request?
> ...
>
>  Tftp is specified by:
> https://www.rfc-editor.org/rfc/rfc1350.txt
>
>  To send datagrams to the broadcast address, you need to
>  set SO_BROADCAST in setsockopt(), so unpatched the traditional
>  clients won't work. For details see:
>   man 7 socket
>   man setsockopt

I hacked up a version of tftpy so that it checked the destination
address and set the SO_BROADCAST flag when sending the request. That
did what I needed.

--
Grant





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-08 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07 18:06 [gentoo-user] How to generate broadcast TFTP read request? Grant Edwards
2024-11-08  3:44 ` Alexis
2024-11-08  8:54 ` karl
2024-11-08 13:59   ` [gentoo-user] " Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox