Forum Discussion
Jonathan_Archer
Nimbostratus
Mar 15, 2013Match Radius.Class attributes
We need to compare variables in the radius class attribute that are returned via an APM radius auth. The class attribute is stored in the APM in hex so I need to convert the hex to string.
I ha...
Kevin_Stewart
Employee
Mar 16, 2013Try this:
set e_fields [split [mcget {session.radius.last.attr.class}] "|"];
foreach field $e_fields { set hex [binary format H* [string range [string trim $fields] 2 end]];if { [string match -nocase "*ace*" $hex] } { return $hex } else { return "NO" }};
Three things:
1. The "contains" keyword is iRules-specific and doesn't work in VPE rules.
2. You needed H* for the binary format.
3. The hex value is stored with leading "0x" characters, but the binary format won't work with this, so [string range [string trim $fields] 2 end]] gets rid of them.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects