dynamic lookup of list entries

Nick Porter nick at portercomputing.co.uk
Mon Jan 29 15:37:36 UTC 2024


On 29/01/2024 15:21, James Potter via Freeradius-Users wrote:
> (not sure why its ${client.site} with a fullstop but %{client:site} with a colon - is there any info on all variables/?namespaces? available within FreeRad?)

%{ ... } is a run time expansion

  %{config: } and %{client: } are xlat functions, with their arguments 
starting after the :

${ ... } is an expansion which happens once at server startup and looks 
for a site option which is a child of the client option.

So - they are completely different purposes, hence the different syntax.

Your final implementation of

Tunnel-Private-Group-ID := "%{config:sites.%{client:site}.remote}"

is looking up the config item of sites.<n>.remote

where <n> is the "site" config item found in the client for the current request.

The expansion will work from the inside out - so first %{client:site} 
will be expanded, then it's result will be used to build the config 
structure that is going to be looked up.

Nick

-- 
Nick Porter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 665 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20240129/35ae0484/attachment.sig>


More information about the Freeradius-Users mailing list