From fbae85bcb4b3940024f8e3c127fac9da3671302d Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 15 Apr 2010 15:39:55 +0200 Subject: Sort SRV replies according to RFC 2782 RFC 2782 defines a way to sort replies to a SRV query. In short, the algorithm sorts all replies by priority and then does a weight-based selection for every priority level. For details, please see the sections "Usage rules" for overview of the algorithm and section "The 'Weight' field" for description on the weight selection. --- src/resolv/async_resolv.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/resolv/async_resolv.h') diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h index 5f87f12e3..b6a13d7fa 100644 --- a/src/resolv/async_resolv.h +++ b/src/resolv/async_resolv.h @@ -88,6 +88,10 @@ int resolv_getsrv_recv(TALLOC_CTX *mem_ctx, int *timeouts, struct ares_srv_reply **reply_list); +/* This is an implementation of section "Usage rules" of RFC 2782 */ +int +resolv_sort_srv_reply(TALLOC_CTX *mem_ctx, struct ares_srv_reply **reply); + /** Get TXT record **/ struct tevent_req *resolv_gettxt_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, -- cgit