[olsr-dev] Bind to device an IPC socket

Sergio Cabrero Barros (spam-protected)
Wed Feb 21 18:36:01 CET 2007


Thanks

I didn't find olsr_cnf at olsr_cfg.h, but I have already done what I wanted 
using the ifnet struct:

setsockopt(ipc_socket, SOL_SOCKET, SO_BINDTODEVICE, ifnet->int_name, 
sizeof(ifnet->int_name)

and to bind the IP address:

sin.sin_addr.s_addr = inet_addr(olsr_ip_to_string(&ifnet->ip_addr));

Now, I have the ports listening in the tap interfaces IPs (check it with 
netstat) but I can't connect them yet.

--
Sergio


On Wednesday 21 February 2007 17:05, Andreas Tønnesen wrote:
> What you want can be found in the olsr_cnf struct. Have a look
> at olsr_cfg.h.
>
>
> - Andreas
>
> Sergio Cabrero Barros wrote:
> > I want to bind my socket to the same network Interface where the main
> > olsrd socket is already binded. So, what i am looking for is a variable,
> > accessible from my plugin, containing that interface name (ie: tap23)
> >
> > Sergio
> >
> > On Wednesday 21 February 2007 11:51, Bernd Petrovitsch wrote:
> >> On Wed, 2007-02-21 at 11:16 +0100, Sergio Cabrero Barros wrote:
> >> [...]
> >>
> >>> Does anyone know how to Bind (SO_BINDTODEVICE) the IPC socket of a
> >>> plugin (ie: Dot draw) to the interface that is running olsrd? Just like
> >>> the olsrd socket do.
> >>
> >> If you want to bind it to an IP-address use the bind system call.
> >> The setsockopt() call with the above option can be found in the source
> >> somewhere - just grep for it.
> >>
> >> Or did I misunderstand the question and what you are trying to do?
> >>
> >> 	Bernd
> >
> > _______________________________________________
> > olsr-dev mailing list
> > (spam-protected)
> > https://www.olsr.org/mailman/listinfo/olsr-dev
>
> _______________________________________________
> olsr-dev mailing list
> (spam-protected)
> https://www.olsr.org/mailman/listinfo/olsr-dev




More information about the Olsr-dev mailing list