jhthorsen / docsis-configfile Goto Github PK
View Code? Open in Web Editor NEWPerl module that decodes and encodes DOCSIS config-files
Home Page: https://metacpan.org/release/DOCSIS-ConfigFile
Perl module that decodes and encodes DOCSIS config-files
Home Page: https://metacpan.org/release/DOCSIS-ConfigFile
I need help, when I try to execute my script I see the following errors and many "can not adopt" (only I'm just showing some):
Cannot adopt OID in CL-PKTC-EUE-EDVA-MIB: pktcEDVAAnsSup ::= { pktcEDVAAnsSupEntry 1 }
Cannot adopt OID in CL-PKTC-EUE-EVENT-MIB: pktcEUEEventGroups ::= { pktcEUEEventConformance 2 }
Cannot adopt OID in CL-PKTC-EUE-EVENT-MIB: pktcEUEEventCompliances ::= { pktcEUEEventConformance 1 }
Cannot adopt OID in CLAB-GW-MIB: clabGWDeviceDNSIpv6QueryForDualMode ::= { clabGWDNSObjects 1 }
.
.
.
.
Cannot adopt OID in CL-PKTC-EUE-RST-MIB: pktcEUERSTUEActStatChgRegExp ::= { pktcEUERSTUEActStatChgEntry 2 }
Cannot adopt OID in CL-PKTC-EUE-RST-MIB: pktcEUERSTUEActStatChgIndex ::= { pktcEUERSTUEActStatChgEntry 1 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapRowStatus ::= { pktcEUEUsrAppMapEntry 9 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppOperStatInfo ::= { pktcEUEUsrAppMapEntry 8 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppOperStat ::= { pktcEUEUsrAppMapEntry 7 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppAdminStatInfo ::= { pktcEUEUsrAppMapEntry 6 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppAdminStat ::= { pktcEUEUsrAppMapEntry 5 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppIndexRef ::= { pktcEUEUsrAppMapEntry 4 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppIdentifier ::= { pktcEUEUsrAppMapEntry 3 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppOrgID ::= { pktcEUEUsrAppMapEntry 2 }
Cannot adopt OID in CL-PKTC-EUE-USER-MIB: pktcEUEUsrAppMapAppIndex ::= { pktcEUEUsrAppMapEntry 1 }
Cannot adopt OID in CL-PKTC-EUE-DEV-MIB: pktcEUEDevDnsEntry ::= { pktcEUEDevDnsTable 1 }
Cannot adopt OID in CL-PKTC-EUE-EDVA-MIB: pktcEDVAPrLossEntry ::= { pktcEDVAPrLossTable 1 }
Cannot adopt OID in CL-PKTC-EUE-EVENT-MIB: pktcEUEMEMVersion ::= { pktcEUEEventObjects 1 }
Cannot adopt OID in CLAB-GW-MIB: clabGWMAPDomainIfEntry ::= { clabGWMAPDomainIfTable 1 }
Passing a long list to key SingleDsChannel causes 'encode_docsis' to generate a truncated config and throws error:
Character in 'C' format wrapped in pack at /usr/local/share/perl/5.20.2/DOCSIS/ConfigFile.pm line 268
Attached below is an example data structure that can be used with 'encode_docsis' to trigger the error:
longdschannellist.txt
At 21'SingleDsChannel' entries or less it is fine, however 22 or more entries triggers the bug.
I am using an old version of this module, however I have been able to replicate the problem on version 0.71.
Does your implementation provide a possibility to read a docsis text file into perl structure like hash?
On the main README, all the links for Docsisious icons are dead.
Can you please clarify under which license is this CPAN module released?
You are stating it is free, but is it GPLv3 or MIT or LGPL license?
Later on you mention that you own the full copyright.
Also, it is hosted on GitHub which implies that you cannot hold the copyright for a project hosted as free.
Love this perl module, so first off - thanks. I was building some MTA files for our Arris modems and they would error out with "Hash digest check failed". After creating a file and looking at it vs. one that works I found a few calculation and file location issues. They all stem from within the _mta_eof sub in ConfigFile.pm.
What I noticed is that the 'MtaConfigDelimiter 255' needs to be part of the data being hashed and that the pktcMtaDevProvConfigHash.0 entry has to live within the MtaConfigDelimiter entries in the configuration file (not outside of them as the original code does).
It's a bit hacky, but what I did was the following with _mta_eof:
my $mta_algorithm = $_[1]->{mta_algorithm} || '';
my $hash = '';
## New line follows to create full set of data to be hashed with the final delimiter
my $data_to_encode = $_[0] . encode_docsis({MtaConfigDelimiter => 255}, {depth => 1});
if ($mta_algorithm) {
## hash the new variable created above
$hash = $mta_algorithm eq 'md5' ? Digest::MD5::md5_hex($data_to_encode)
: Digest::SHA::sha1_hex($data_to_encode);
$hash
= encode_docsis({SnmpMibObject => {oid => '1.3.6.1.4.1.4491.2.2.1.1.2.7.0', STRING => "0x$hash"}}, {depth => 1});
}
## Return the data in the proper order so that the hash falls within the MtaConfigDelimiter
return $_[0] . $hash . encode_docsis({MtaConfigDelimiter => 255}, {depth => 1});
}
So I created a new variable with the 255 delimiter in place, hashed that instead of $_[0] and then returned the "rearranged" version of the content so that the hash was placed correctly.
After I did this my MTAs come right online without a problem. Thought I'd passed this along in case some form of this could be incorporated into the base code.
Thanks.
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.
When trying to download a binary config I am getting an error through the online docsisious.
Cannot encode config file: Unknown SNMP type: HexString
These are valid config files in use. When I decode one that has has a HexString value in them it seems to change it to a String. In the parameters list it does show a few using hexstr. I have tried changing the type to HexStr and still errors. In the code it seems to support it, but not showing in the our %SNMP_TYPE, if I am reading it right it should be in there.
What I am entering in the textarea:
---
SnmpMibObject:
- HexString: 0x80
oid: 1.3.6.1.4.1.4413.2.2.2.1.2.2.1.1.5.10
First of all thumbs up for the module. We use it for configuring 300k+ config files cm+mta.
I was struggling with the pktcMtaDevProvConfigHash.0 that is created with:
my $data = $docsis->encode($config,'sha1');
It is working fine for let's say AVM (Fritz!Box Cable) while with let's say UBEE Cable modem, the mta config fails saying that pktcMtaDevProvConfigHash is not found. I took a closer look at the problem and found out that we have two different oids for the same MIB name!
AVM uses OID: 1.3.6.1.4.1.4491.2.2.1.1.2.7.0 - PKTC-MTA-MIB
UBEE uses OID: 1.3.6.1.4.1.7432.1.1.2.9.0 - PKTC-EXCENTIS-MTA-MIB
Maybe there should also be the third option in array configuring the OIDs above.
Regards,
Janko Bajc
I am new to perl and I'm curious if there is a readable file output and if so what's the location...
Curious if it would be possible to add Gauge32 as an OID value type? Just to clarify I'd like it added to the existing options like String, Integer, etc. I've run into some MTAs that want to set the SIP port using Gauge32 instead of something like Integer.
Thanks.
Is there any plan to add support for TLV type 81, the ManufacturerCVCChain? This new TLV is used for DOCSIS 3.1 provisioning in which the CVC length can exceed 254 bytes.
From Arris:
"The Manufacturer CVC Chain TLV (M-CVC-C) is used to enable the 3.1-compliant CM to download the code file from the TFTP server whether or not the CM is provisioned to run with BPI+.
If the length of the M-CVC-C exceeds 254 bytes, the M-CVC-C is fragmented into two or more successive Type 81 elements. Each fragment, except the last, is 254 bytes in length.
The CM MUST reconstruct the M-CVC-C by concatenating the contents (Value of the TLV) of successive Type 81 elements in the order in which they appear in the config file.
For example, the first byte following the length field of the second Type 81 element is treated as if it immediately follows the last byte of the first Type 81 element"
When decoding in advanced format of one of my cm configfiles, perl produces a lot of warnings:
Hexstring representation of a whole config file, witch produces this warnings is heare
http://pastebin.com/bFU4BSNy
Big thx for You, for this module it saved me a lot of time !
When I try to encode my file with this parameter SwUpgradeServer => 192.168.60.10, the program send me this error ip({ value => è=ü }) does not match (?^:^(?:\d{1,3}.){3}\d{1,3}$) at /usr/local/share/perl/5.22.1/DOCSIS/ConfigFile/Encode.pm line 484.
If I use TftpModemAddress => 192.168.60.10, I get the same error.
I'm using the follow guide: https://metacpan.org/pod/DOCSIS::ConfigFile::Syminfo#CONFIGURATION-TREE
thank you
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.