jhthorsen / docsis-configfile

Perl module that decodes and encodes DOCSIS config-files
https://metacpan.org/release/DOCSIS-ConfigFile
11 stars 3 forks source link

ushort_list missing #14

Closed Flole998 closed 6 years ago

Flole998 commented 6 years ago

I'm getting the following error when trying to use this

Can't locate object method "ushort_list" via package "DOCSIS::ConfigFile::Decode" at /usr/local/share/perl/5.26.1/DOCSIS/ConfigFile.pm line 70.

jhthorsen commented 6 years ago

Can you provide a minimal config file that reproduces the problem?

Flole998 commented 6 years ago

It happens once you use the Subscriber Management Filter Groups:

Attached is a minimal config that causes this issue (just ignore the extension, github wanted one :D ).

broken.docx

jhthorsen commented 6 years ago

I don't get it. When I hexdump the file, I get this content:

0000000 03 01 01 18 07 01 02 00 01 06 01 07 19 07 01 02
0000010 00 02 06 01 07 25 14 00 00 00 00 00 00 00 00 00
0000020 00 00 00 00 00 00 00 00 00 00 00 06 10 30 1e d6
0000030 9d e7 a4 c8 90 57 38 a9 28 6c 00 21 9a 07 10 b2
0000040 54 fa ec 77 f5 7e 6e ae dd c9 f9 ee cc 6c 6a ff

And running it through DOCSIS::ConfigFile with DOCSIS_CONFIGFILE_DEBUG=1 set gives me this output:

[DOCSIS] Decode UsServiceFlow type=24 (0x18), len=7, with nested()
[DOCSIS]  Decode UsServiceFlowRef type=1 (0x01), len=2, with ushort()
[DOCSIS]  Decode QosParamSetType type=6 (0x06), len=1, with uchar()
[DOCSIS] Decode DsServiceFlow type=25 (0x19), len=7, with nested()
[DOCSIS]  Decode DsServiceFlowRef type=1 (0x01), len=2, with ushort()
[DOCSIS]  Decode QosParamSetType type=6 (0x06), len=1, with uchar()
[DOCSIS] Decode SubMgmtFilters type=37 (0x25), len=20, with ushort_list()
[DOCSIS] Decode CmMic type=6 (0x06), len=16, with mic()
[DOCSIS] Decode CmtsMic type=7 (0x07), len=16, with mic()

But I don't understand how this makes any sense, since the spec says that the length should be "8" and not "20":

The Subscriber Management MIB allows filter groups to be assigned to a CM and CPE attached to that CM. These include two CM filter groups, upstream and downstream, and two CPE filter groups, upstream and downstream. These four filter groups are encoded in the configuration file in a single TLV as follows: Type: 37, Length: 8 Value: group,group,group,group

https://community.cablelabs.com/wiki/plugins/servlet/cablelabs/alfresco/download?id=85c0e87f-1728-47c9-a507-ad85fe3eb2ca;1.0

Can you make any sense of this? Did you change the file manually?

jhthorsen commented 6 years ago

The changes I'm working on is here: 32edf2ee2e146af045a28ce77ac3f6a806c5fc92

Flole998 commented 6 years ago

The file was generated by the Excentis DOCSIS config file editor. It has an "extended" checkbox in the subscriber Filter Management, which enables additional textboxes to enter numbers to. That's probably why there are more entries. I do not know in what standard that is defined though, I'd guess its 3.0 specific.

jhthorsen commented 6 years ago

Which numbers did you enter?

Flole998 commented 6 years ago

I left them all at 0. I think your commit from 8 hours ago already fixes it, I will check that later today.

jhthorsen commented 6 years ago

I would appreciate a new sample file where you write "1, 2, 3, 4" to make it a bit easier to read. And not more than four numbers, since that's what the spec requires.

Flole998 commented 6 years ago

According to MULPI3.0 Chapter C.1.1.19.4 this is not true, it permits 8, 12, 16 and 20 Bytes. The standard you linked earlier is superseded.

jhthorsen commented 6 years ago

Ah! Awesome. This makes a lot more sense now 👍

Flole998 commented 6 years ago

Also the Excentis Docsis Config Editor is free, Excentis is the company responsible for DOCSIS in Europe. They only need an E-Mail Address to send you the download link. I created an empty config, then right clicked on Optional encodings -> (Euro)DOCSIS 1.1 encodings and added the subscriber management filter groups in there.

jhthorsen commented 6 years ago

Thanks for all the input!

This is fixed now, and the new release is soon available on CPAN