returning a HEX String as a HEX String (bit string) instead of the decimal equivalent - FreeRADIUS 2.1.10

Arran Cudbard-Bell a.cudbardb at
Wed Aug 7 15:06:25 CEST 2013

On 7 Aug 2013, at 13:46, Alan DeKok <aland at> wrote:

> Arran Cudbard-Bell wrote:
>> I'm honestly not entirely sure why the freeradius dictionary has the attribute as an unsigned int
>  That's what the RFCs say.  And the server doesn't really have a way of
> packing arbitrary structures from attributes.

It says the value is 4 octets.  That's not quite saying it's an integer, was there a later one?

I think it's arguably more useful as an integer though, for the reasons listed previously, and because 
you can use expr to build the bit string easily.

For example:

update reply {
	Egress-VLANID += "%{expr:822083584 + %{Tagged-VID}}"

With hex you need to manually pad the VID out to 12 bits.

Arran Cudbard-Bell <a.cudbardb at>
FreeRADIUS Development Team

More information about the Freeradius-Users mailing list