Decoding complex CableLabs-Event-Message
Hi, We would like to use FreeRadius to decode Cablelabs accounting messages, as specified in http://www.cablelabs.com/packetcable/downloads/specs/PKT-SP-EM-I12-05812.pdf . FreeRadius has a CableLabs dictionary, which works fine, but... The value of one of the AVP, CableLabs-Event-Message, is actually an HEX value containing additional fields. For example: CableLabs-Event-Message = 0x0001d2d2026d30310000000000003030313030303000 0e812333000100033031000000000000303031303030300000000006323031323031333130363032 32312e3633390000000081000500 The FreeRadius does not decode that value to get all details. For example, bytes 4 to 28 (d2d2026d303100000000000030303130303030000e812333) is actually the BCID (Billing Correlation ID) field. The BCID itself contains 4 "sub" fields: NTP time reference (4 first bytes), Element ID (next 8 bytes), Time Zone (next 8 bytes), and Event counter (ast 4 bytes). See the packet cable specifications for more details. I understood the only way would be to write a perl module to decode those values. Before I start writing, does anyone know of any implementation of such a perl module? I would not like spending my time rewriting something that already exists. Thanks in advance for any help anyone could provide on this topic. Laurent.
Laurent Debacker wrote:
We would like to use FreeRadius to decode Cablelabs accounting messages, as specified in http://www.cablelabs.com/packetcable/downloads/specs/PKT-SP-EM-I12-05812.pdf.
Why do people do that? It's ridiculous.
FreeRadius has a CableLabs dictionary, which works fine, but... The value of one of the AVP, CableLabs-Event-Message, is actually an HEX value containing additional fields.
Because it wouldn't make sense to send it as binary data, right? Ugh.
The FreeRadius does not decode that value to get all details. For example, bytes 4 to 28 (d2d2026d303100000000000030303130303030000e812333) is actually the BCID (Billing Correlation ID) field. The BCID itself contains 4 "sub" fields: NTP time reference (4 first bytes), Element ID (next 8 bytes), Time Zone (next 8 bytes), and Event counter (ast 4 bytes). See the packet cable specifications for more details.
I understood the only way would be to write a perl module to decode those values.
Or write it in C. It should only be ~100 LoC. It should go into rlm_preprocess, just like the other functions that mangle stupid vendor formats.
Before I start writing, does anyone know of any implementation of such a perl module? I would not like spending my time rewriting something that already exists.
If one existed, it would be included with FreeRADIUS. Alan DeKok.
Laurent Debacker wrote:
We would like to use FreeRadius to decode Cablelabs accounting messages, as specified in http://www.cablelabs.com/packetcable/downloads/specs/PKT-SP-EM-I12-05812.pdf.
After reading that spec... those guys are crazy. They invented their own format, and didn't even use sub-TLVs. It will be a LOT of work to get this done. It's not difficult work. It's just that the document specifies a lot of "one off" data formats. This means every single case has to be handled by writing code. If they had used a generic format, then we could have done a "dictionary to attribute" mapping as with normal RADIUS. Alan DeKok.
participants (2)
-
Alan DeKok -
Laurent Debacker