[bind10-dev] msgq and dhcp4

Michal 'vorner' Vaner michal.vaner at nic.cz
Mon May 14 15:12:50 UTC 2012


Hello

On Fri, May 11, 2012 at 06:36:51PM +0200, Tomek Mrugalski wrote:
> During normal dhcp operation 3 types of events may occur:
> 1. a packet was received over one of many sockets (typically one socket
> per interface, but it may vary)
> 2. a timer expires (e.g. lease expires)
> 3. a command or new config arrives over msgq
> 
> Doing 1 and 2 is easy (select() + calculated timeout). Doing 1-3 is more
> complicated.

Actually, as we talked, we may want to have some changes to the CC library to
support this. The reason is, we want to get rid of the separate python
implementation and wrap that one. What I think we will do is:

• Create a function that returns the file descriptor of the CC connection (some
  kind of getfileno()).
• Have some kind of „Check for new messages“ function.
• Replace run with a wrapper around these two, that would create some kind of
  asio object from the file number and check repeatedly for it.

So, you could put the getfileno() thing into select as well.

However, the problem is, we postponed the msgq modifications to some unknown
future time. I don't know if we could reschedule this when it would be needed by
both teams or something.

Anyway, the asio have some kind of wrappers that can be created from file
descriptors. I think you could get inspired in the way how sockets are received
from boss in auth (I don't know exactly where it is located, but you could start
tracking it from the portconfig library.

With regards

-- 
Operator	Name		Can occur
*		Whatever	Whereever

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20120514/4dfaf519/attachment.bin>


More information about the bind10-dev mailing list