Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 13392
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: OLAF [...] cpan.org
Requestors: ehall [...] ehsco.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: request for ->sort method in Net::DNS::RR::MX and ::SRV
I'd love a "sort" option for weighted RRs like MX and SRV. It's pretty painful to extract, sort and reassemble a nested array, which is why so few implementations do it. Without double-checking, I think ::MX already uses a sorted list internally, but I konw that ::SRV does not. Note that the "weight" subfield is provided for use with app-specific SRV definitions, but the default rules for SRV ignore it and only use "priority". That's probably the proper behavior for the default ->sort method as well.
[guest - Thu Jun 23 14:02:58 2005]: Show quoted text
> I'd love a "sort" option for weighted RRs like MX and SRV. It's pretty > painful to extract, sort and reassemble a nested array, which is > why so few implementations do it.
Hi Eric, I just added an rrsort() function. This is what the changes writes about it: This was a little tricky as I think that the sort functions are in fact RR specific class attributes that should be accessed through class methods. This is difficult to implement. I do think I found a fairly clean manner. It does require a global variable in Net::DNS to store the functions and some trickery when the sorting functions are defined. See Net::DNS and Net::DNS::RR documentation for details. Defaults sorting functions are currently implemented in SRV, .. The code lives on the SVN trunk since about 2 hours and I would appreciate if you would like to have a look at the documentation you can extract with perldoc from http//www.net- dns.org/svn/net-dns/trunk/lib/Net/DNS.pm and http//www.net-dns.org/svn/net-dns/ trunk/lib/Net/DNS/RR.pm If you want to have a look at examples see:http//www.net-dns.org/svn/net-dns/trunk/t/05- rr-rrsort.t Sorry it took so long but I wanted to try this in a somewhat generic way and I knew that would be tricky. I do think we have something useful with the possibility to overwrite the sorting functions for certain resource record attributes. The work is not yet finished (I'll have a look at sorting functions for MX and other RRs soon) but if you have comments or suggestions about improving the interface or documentation than rather sooner than later :-). --Olaf
The rrsort() function was added in version 0.56. (http://www.net-dns.org/blog/post/1/32) Please, let me know if this is useful and if you need more. I'm stalling the ticket while waiting for feedback. In a future cleanup round I will probably resolve the ticket. --Olaf
Subject: Re: [rt.cpan.org #13392] request for ->sort method in Net::DNS::RR::MX and ::SRV
Date: Tue, 18 Apr 2006 19:11:17 -0400
To: bug-Net-DNS [...] rt.cpan.org
From: "Eric A. Hall" <ehall [...] ehsco.com>
On 4/18/2006 5:20 AM, Olaf Kolkman via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=13392 > > > The rrsort() function was added in version 0.56. > (http://www.net-dns.org/blog/post/1/32) > > Please, let me know if this is useful and if you need more. > > I'm stalling the ticket while waiting for feedback. In a future cleanup > round I will probably resolve the ticket.
Hi Olaf, I haven't done any perl programming since that request and I don't know when I'll be doing any more. I've got projects I need to do but dunno when I'll get to them. Anyway. I won't be able to really give substantive feedback until then. Sorry for not being more responsive -- Eric A. Hall http://www.ehsco.com/ Internet Core Protocols http://www.oreilly.com/catalog/coreprot/
I close the ticket for now. Feel free to open it again once you have comments. :-) --Olaf