[Swan-dev] Question on writefds fd

Antony Antony antony at phenome.org
Fri Jan 16 20:58:03 EET 2015


On Thu, Jan 15, 2015 at 01:22:43PM -0500, Paul Wouters wrote:
> On Thu, 15 Jan 2015, D. Hugh Redelmeier wrote:
> 
> >| From: Paul Wouters <paul at nohats.ca>
> >
> >| So only the adns code is using the writefds fd in pluto. Since that code
> >| is now being removed and replaced with a libevent variant, there is
> >| nothing left in the writefds. Is there any reason to not completely
> >| remove it? (I'm a little confused why we had a readfds and writefds)
> >
> >My understanding is that the ADNS code is being replaced by an unbound
> >variant, not a libevent variant.  Unless I misunderstand.
> 
> unbound events hooks into libevent.

Initially, in the time frame of Jan - Mar 2015, me and Paul are not planning add libunbound + libevent integration; This might happen after after March 2015.

> >I would have thought that we are either 100% libevent or 100% select.
> >I don't see how they can be mixed: each needs to be in control.

100% libevent. However, libevent monitors crypto helpers file descriptors. When there is something to read on the fd, libevent will evoke the callback function.

Currently libevent is monitoring the following FDs:
	kernel async fd (read only). 
	erypto helper fd (read only)
	Interface (UDP interface + port)  (read only)

And timer based events are handled by libevent have higher resolution than a second.  such as retransmit ( currently millisecond resolution), dpd, ...

It looks like we will drop ADNS lookup that was used by old OE only? Which is initialized by a call to init_adns()

There are two mysterious functions/events that I don't understand yet.
pfkey_dequeue(void). This is also probably related to old OE and klips.

connection_check_ddns() which calls 
	connection_check_ddns1(). It seems to wakeup every minute and do 
 ttoaddr(c->dnshostname, 0, AF_UNSPEC, &new_addr); 

For details try the branch #libevent

-antony


More information about the Swan-dev mailing list