[prev in list] [next in list] [prev in thread] [next in thread]
List: freediameter-dev
Subject: [Dev] Hold extension callback execution until PSM event occurs
From: mbilski () eliberty ! pl (Michal Bilski)
Date: 2011-10-17 20:56:04
Message-ID: c8220f0fa7a4699bfe014541bd088e40 () eliberty ! pl
[Download RAW message or body]
Hello Sebastien,
I am currently working on a simple extension for freeDiameter that
would allow to dynamically discover peers using DNS lookups. The
extension registers an rt_out_cb that, in case when candidates list is
empty, performs a series of DNS queries as described in RFC 3588/3588bis
(NAPTR->SRV->A).
So far I am able to successfully connect to a peer discovered this way
using fd_peer_add. The problem in this case is that it actually happens
after the rt_out callback exits. Can you give me some hints on what
would be the best way to hold it's execution until the peer state
machine either enters STATE_OPEN or an error occurs for some reason
(host unreachable, TLS handshake failed, etc.)? I have noticed that a
callback for fd_peer_add can be provided, but I'm not exactly sure how
to use it. It would require the extension to wait for some kind of event
or change trigerred by the callback, and then decide if we can continue
with this peer or we should fallback to try another one with less
order/priority in DNS records tree. I think that this would be a better
(and faster) way to notice peer state change, rather than periodically
checking the state with d_peer_getstate.
I would appreciate any help form your side, including also any comments
not directly related to the problem descirbed above, but to peer
discovery in freeDiameter framework in general.
--
Best regards,
Michal Bilski
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic