Re: sol_socket so_bindtodevice alternative
Re: sol_socket so_bindtodevice alternative
- Subject: Re: sol_socket so_bindtodevice alternative
- From: Rustam Muginov <email@hidden>
- Date: Tue, 07 Jan 2014 15:32:50 -0800
Hado,
you can use IP_BOUND_IF to bind socket to the particular interface index.
something like
int idx = if_nametoindex( "en1");
setsockopt(s, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx) );
--
Sincerely,
Rustam Muginov
On Jan 4, 2014, at 12:43 PM, Hado Hein <email@hidden> wrote:
> I’m trying to find a solution to send udp broadcasts over a specific network interface.
> Binding to an address is not an option.
>
> Since so_bindtodevice is not available on Darwin I’m looking for an alternative.
> I have two ethernet interfaces which both go to different class c subnets.
> The first interface has also a gateway set (Internet).
>
> Now I need to send a broadcast to a class a device physically on the second ethernet port. Neither of these (interface nor class a device) can change their ip or their subnet.
>
> Is there a possibility to achieve this at userlevel?
>
>
> thx,
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden