value replacement

Alan DeKok aland at deployingradius.com
Tue Jul 14 02:05:23 CEST 2015


On Jul 13, 2015, at 4:03 PM, Jorge Pereira <jpereiran at gmail.com> wrote:
>    I have the variable.
> 
> ADSL-Agent-Circuit-Id = 0x35303a33393a35353a30643a31613a6134*00*
> 4a4f5247452d53534944*00*ok
> 
> And I am looking for some way to replace the '00' for ';' and transform in
> a String. Currently, I am doing:
> 
> Mon Jul 13 19:06:23 2015 : Debug: (5)       if (!&Called-Station-Id ||
> &Called-Station-Id == "" || &Called-Station-Id == "00:00:00:00:00:00")  {
> Mon Jul 13 19:06:23 2015 : Debug: (5)         if (&ADSL-Agent-Circuit-Id) {
> Mon Jul 13 19:06:23 2015 : Debug: (5)         if (&ADSL-Agent-Circuit-Id)
> -> TRUE
> Mon Jul 13 19:06:23 2015 : Debug: (5)         if (&ADSL-Agent-Circuit-Id)  {
> Mon Jul 13 19:06:23 2015 : Debug: (5)           update {
> Mon Jul 13 19:06:23 2015 : Debug: (5)             EXPAND
> %{string:&ADSL-Agent-Circuit-Id}
> Mon Jul 13 19:06:23 2015 : Debug: (5)                -->
> ca:fe:ca:fe:00:01\000JORGE-SSID\000ok
> Mon Jul 13 19:06:23 2015 : Debug: (5)             *&request:Called-Station-Id
> := ca:fe:ca:fe:00:01*
> Mon Jul 13 19:06:23 2015 : Debug: (5)           } # update = noop
> Mon Jul 13 19:06:23 2015 : Debug: (5)         } # if
> (&ADSL-Agent-Circuit-Id)  = noop

  You can move the data to a temporary string attribute, manipulate it there as hex, and then move it back to ADSL-Agent-Circuit-Id.

  Alan DeKok.




More information about the Freeradius-Users mailing list