Re: How to send an all ones broadcast
Re: How to send an all ones broadcast
- Subject: Re: How to send an all ones broadcast
- From: Joshua Graessley <email@hidden>
- Date: Fri, 8 Aug 2003 14:24:12 -0700
On Friday, August 8, 2003, at 13:26, Robert G Palmer Jr wrote:
Pardon my post if this is not the appropriate list - I looked at
darwin-userlevel and it seemed too general. If this isn't the
appropriate place, please let me know.
I'm working on my cocoa application, which does some network
communication. I am using sockets with the sin_addr portion of the
sockaddr_in set to INADDR_BROADCAST. I have run into a problem and
need some help. I need to send a general network broadcast (IP =
255.255.255.255), but under BSD implementations of sockets, if I
specify the general broadcast address, the sockets layer automatically
masks it to the interface's subnet, thus creating a subnet broadcast
(e.g. if the subnet mask is 255.255.255.0 and my IP is 192.168.20.73,
then the broadcast would be 192.168.20.255). I MUST have a full
general broadcast. Steven's book says that BSD v3.0 includes a new
flag IP_ONESBROADCAST (pg 471) that will do this, but I can't find any
reference to this in the OS X headers or documentation (or man pages).
Does anyone know how to get OS X to send a general broadcast instead
of a subnet broadcast?
If you can use a link-local multicast instead of fighting the system to
send an all ones broadcast, you'll probably end up much happier. The
multicast APIs let you specify which interface a packet should be sent
on. You'll have no way of doing this with the broadcast packet, so you
can only broadcast on one interface.
I think there is a way to send the all ones multicast, but I don't
recall what it is. I think it does require root privileges.
-josh
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.