On 11 Dec 2015, at 09:21, Alan DeKok <aland@deployingradius.com> wrote:
On Dec 11, 2015, at 9:17 AM, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
policy ipaddr resolve_fqdn (string hostname) { return <ipaddr>"%{a:&hostname}" }
Can I gouge out my eyes now?
Go ahead :)
I'm wary of adding things like that to the server. It might be useful, but it has a high potential for abuse and/or confusion.
People abuse policies now, using Tmp attributes as arguments and to hold return values has a far greater potential for confusion. By refusing to add proper functions, we're increasing real world abuse and confusion. Are you going to argue perl subroutines are more readable than C functions? I doubt anyone except Larry Wall's most devout followers would agree with you.
update request { &Tmp-ipaddr-0 := resolve_fqdn("google.com")
As opposed to:
&Tmp-ipaddr-0 := "google.com"
Which works today?
It has the potential to be dynamic, which doesn't work today, or at least I hope not. The unbound module would be a great test for converting to async as it has very little state, and the API in its normal form is asynchronous. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2