[erlang-questions] Sending UDP messages without IP
David Sveningsson
ext@REDACTED
Tue Jun 9 16:43:55 CEST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Lucas Robsahm wrote:
> Hi!
>
> I'm trying to get a dhcp-server
> (http://code.google.com/p/erlang-dhcp-server/) to work but right now I'm
> not able to answer on the broadcasted dhcp-discover message that's sent
> from IP 0.0.0.0.
> When I use a sniffer on the network-devices dhcp-offer message is sent
> from 127.0.0.1 to 127.0.0.1, I guess that's the way Erlang or Linux
> handle messages to 0.0.0.0.
>
> Is there any way to send UDP messages from Erlang to a computer without
> IP-address set?
> Is it possible to modify the ARP? I guess that would solve my problem
> somehow.
>
> //Lucas
>
Yes, using UDP broadcast.
{ok, Socket} = gen_udp:open(0, [binary, {broadcast, true}]),
gen_udp:send(Socket, {255,255,255,255}, ?PORT, Data),
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkoudSsACgkQ6pa1H/H5pqUikgCgnlFEPecZjK/VsvnYos5B0GWl
bgYAn2o3qIBplwLeZs+7mZhQ3Q4bzzdj
=OKqE
-----END PGP SIGNATURE-----
More information about the erlang-questions
mailing list