10 Jul
2013
10 Jul
'13
1:48 a.m.
On 10.07.2013 05:20, Peter Lambrechtsen wrote:
In pseudo code it would be something like:
if (length(ADSL-Agent-Remote-Id) > 31) {
update reply { strncat(SubscriberID, ADSL-Agent-Remote-Id + (strlen(ADSL-Agent-Remote-Id) - 31), 31) } } else { update reply { SubscriberID := ADSL-Agent-Remote-Id } }
Where in effect if the string is longer than 31 chars take the right most 31 chars and only return that.
if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { update reply { SubscriberID := "%{1}" } } that should do it. Olivier -- Olivier Beytrison Network & Security Engineer, HES-SO Fribourg Mail: olivier@heliosnet.org