26 Feb
2018
26 Feb
'18
7:14 a.m.
On Feb 26, 2018, at 4:38 AM, Kylián Martin <kylianm@plzen.eu> wrote:
TBH, the simplest thing is to *not* use "foreach". I'd guess that the Cisco- AVPair attributes come in the same order all the time. So you can just rely on that. e.g.
if (Cisco-AVPair[0] =~ /^dhcp-option=/) { update request { Tmp-Integer-0 := "%{unpack:&Cisco-AVPair[0] 12 integer}" } }
That will get you the binary data (4 octets) into Tmp-Integer-0.
Thank you Alan. It works. AVPs always come in the same order. The unpacked data looks correctly. The last modest question yet - how the get the rest of the attribute (string following the TLV binary code)?
Keep using %{unpack: ... } Alan DeKok