Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode bootfiles with numeric OIDs is not working (option “-o”) #18

Closed
sergessn opened this issue Apr 9, 2015 · 8 comments · Fixed by #19
Closed

Decode bootfiles with numeric OIDs is not working (option “-o”) #18

sergessn opened this issue Apr 9, 2015 · 8 comments · Fixed by #19

Comments

@sergessn
Copy link

sergessn commented Apr 9, 2015

I tried to decode my bootfiles in docsis 098-dev with option “-o” and don't see numeric OIDs on outputs. I always see OID names.

$ docsis098 -d test.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /* resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up /
$
$ docsis098 -o -d test.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /
resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up */
$

Please fix the issue with decoding bootfiles with numeric OIDs.

@AdrianSimionov
Copy link
Collaborator

Thanks, will take a look.

@AdrianSimionov
Copy link
Collaborator

Sergey, unfortunately I cannot reproduce this.

Please see below output.

$ ./docsis -d test.cm 
Main 
{
    MtaConfigDelimiter 1;
    SnmpMibObject pktcSigDefCallSigTos.0 Integer 26;
    SnmpMibObject pktcSigDefMediaStreamTos.0 Integer 46;
    SnmpMibObject pktcSigTosFormatSelector.0 Integer 2; /* dscpCodepoint */
    SnmpMibObject pktcNcsEndPntConfigCallAgentId.9 String "[192.168.28.40]";
    SnmpMibObject pktcNcsEndPntConfigCallAgentId.10 String "[192.168.28.40]";
    SnmpMibObject pktcMtaDevEnabled.0 Integer 1; /* true */
    SnmpMibObject pktcNcsEndPntConfigCallAgentUdpPort.9 Integer 2427;
    SnmpMibObject pktcNcsEndPntConfigCallAgentUdpPort.10 Integer 2427;
    SnmpMibObject pktcNcsEndPntConfigMWD.9 Integer 2;
    SnmpMibObject pktcNcsEndPntConfigMWD.10 Integer 2;
    SnmpMibObject pktcSigDevRgCadence.0 HexString 0x003ff00000000000;
    MtaConfigDelimiter 255;
}


$ ./docsis -o -d test.cm 
Main 
{
    MtaConfigDelimiter 1;
    SnmpMibObject enterprises.4491.2.2.2.1.1.8.0 Integer 26;
    SnmpMibObject enterprises.4491.2.2.2.1.1.9.0 Integer 46;
    SnmpMibObject enterprises.4491.2.2.2.1.1.10.0 Integer 2;
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.1.9 String "[192.168.28.40]";
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.1.10 String "[192.168.28.40]";
    SnmpMibObject enterprises.4491.2.2.1.1.1.7.0 Integer 1;
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.2.9 Integer 2427;
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.2.10 Integer 2427;
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.18.9 Integer 2;
    SnmpMibObject enterprises.4491.2.2.2.1.2.1.1.18.10 Integer 2;
    SnmpMibObject enterprises.4491.2.2.2.1.1.22.0 HexString 0x003ff00000000000;
    MtaConfigDelimiter 255;
}

@AdrianSimionov AdrianSimionov added Triage and removed Bug labels Apr 9, 2015
@sergessn
Copy link
Author

sergessn commented Apr 9, 2015

Adrian,

I need to see OID numbers for all SnmpMibObjects with "-o"
A few minutes ago I downloaded again the last sources from github and compiled a docsis 0.9.8-dev.
I decoded my bootfile with the last version:

./docsis -d cm.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /* resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up */
SnmpMibObject enterprises.4413.2.2.2.1.6.1.5.0 Integer 122;
SnmpMibObject docsDevNmAccessIp.16 IPAddress 0.0.0.0;
SnmpMibObject docsDevNmAccessIpMask.16 IPAddress 0.0.0.0;

./docsis -o -d cm.bin
Main
{
NetworkAccess 1;
SnmpMibObject docsDevEvControl.0 Integer 1; /* resetLog /
SnmpMibObject ifAdminStatus.1 Integer 1; /
up */
SnmpMibObject enterprises.4413.2.2.2.1.6.1.5.0 Integer 122;
SnmpMibObject docsDevNmAccessIp.16 IPAddress 0.0.0.0;

As you can see I don't have any changes and differences in output with “-o” and without “-o”

I compile and use docsis 0.9.8-dev on Centos 5.11 server.
Will you help my compile logs or something else?

@AdrianSimionov
Copy link
Collaborator

Please add a complete decoded config file. I will use that file for more tests.
The decoding is handled by libsnmp-dev libraries and I hope to be just a setting somewhere.

@sergessn
Copy link
Author

sergessn commented Apr 9, 2015

This is my test bootfile decoded with 0.9.8-dev.

Main
{
NetworkAccess 1;
MaxCPE 8;
SnmpMibObject docsDevEvControl.0 Integer 1;
SnmpMibObject ifAdminStatus.1 Integer 1;
SnmpMibObject enterprises.4413.2.2.2.1.6.1.5.0 Integer 122;
SnmpMibObject docsDevNmAccessIp.16 IPAddress 0.0.0.0;
SnmpMibObject docsDevNmAccessIpMask.16 IPAddress 0.0.0.0;
SnmpMibObject docsDevNmAccessCommunity.16 String "public";
SnmpMibObject docsDevNmAccessControl.16 Integer 2; /* read /
SnmpMibObject docsDevNmAccessInterfaces.16 HexString 0xffff;
SnmpMibObject docsDevNmAccessStatus.16 Integer 4; /
createAndGo /
SnmpMibObject docsDevNmAccessIp.18 IPAddress 0.0.0.0;
SnmpMibObject docsDevNmAccessIpMask.18 IPAddress 0.0.0.0;
SnmpMibObject docsDevNmAccessCommunity.18 String "private";
SnmpMibObject docsDevNmAccessControl.18 Integer 3; /
readWrite /
SnmpMibObject docsDevNmAccessInterfaces.18 HexString 0xffff;
SnmpMibObject docsDevNmAccessStatus.18 Integer 4; /
createAndGo /
ClassOfService
{
ClassID 1;
MaxRateDown 8000000;
MaxRateUp 2000000;
PriorityUp 7;
}
SNMPCPEAccessControl 1;
/
CmMic 386a71b997450a196ddd1a59119d58ea; /
/
CmtsMic 3650e65e1892903a7ebe4b13d5b59b75; _/
/_EndOfDataMkr*/
}

@AdrianSimionov
Copy link
Collaborator

I checked the source code and -o option does not do what we expected it to do. I think it was a misunderstanding into the description of that option. What it will do is that it will not load the MIB files which are loaded by default.

By not loading the MIBs, some of the OIDs will look more numerical, but it was never supposed to be a complete numerical option.

I will convert this into a feature request as we need another option together with -o to specifically make it look like:

$ snmptranslate -On SNMPv2-MIB::sysUpTime.0
.1.3.6.1.2.1.1.3.0

Is this what you are looking for?

I understand the real need for -o option especially when you are working with PacketCable / EuroPacketCable configuration files.

@sergessn
Copy link
Author

Thanks for researching.
Yes, it is that I'm looking (complete numerical option).
It will be perfect to have this new feature in docsis.

@AdrianSimionov
Copy link
Collaborator

Sergey, I think I finally have this fixed. Sorry that it took me so long but I had to learn A LOT about net-snmp libraries first.

Please download and compile the following code:

https://github.com/AdrianSimionov/docsis/archive/num_oid.zip

Here is how the output will look now:

$ ./docsis -d test.cm
Main 
{
    MtaConfigDelimiter 1;
    SnmpMibObject pktcSigDefCallSigTos.0 Integer 26;
    SnmpMibObject pktcSigDefMediaStreamTos.0 Integer 46;
    SnmpMibObject pktcSigTosFormatSelector.0 Integer 2; /* dscpCodepoint */
    SnmpMibObject pktcNcsEndPntConfigCallAgentId.9 String "[192.168.28.40]";
    SnmpMibObject pktcNcsEndPntConfigCallAgentId.10 String "[192.168.28.40]";
    SnmpMibObject pktcMtaDevEnabled.0 Integer 1; /* true */
    SnmpMibObject pktcNcsEndPntConfigCallAgentUdpPort.9 Integer 2427;
    SnmpMibObject pktcNcsEndPntConfigCallAgentUdpPort.10 Integer 2427;
    SnmpMibObject pktcNcsEndPntConfigMWD.9 Integer 2;
    SnmpMibObject pktcNcsEndPntConfigMWD.10 Integer 2;
    SnmpMibObject pktcSigDevRgCadence.0 HexString 0x003ff00000000000;
    MtaConfigDelimiter 255;
}

$ ./docsis -o -d test.cm
Main 
{
    MtaConfigDelimiter 1;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.1.8.0 Integer 26;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.1.9.0 Integer 46;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.1.10.0 Integer 2;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.1.9 String "[192.168.28.40]";
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.1.10 String "[192.168.28.40]";
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.1.1.1.7.0 Integer 1;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.2.9 Integer 2427;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.2.10 Integer 2427;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.18.9 Integer 2;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.2.1.1.18.10 Integer 2;
    SnmpMibObject .1.3.6.1.4.1.4491.2.2.2.1.1.22.0 HexString 0x003ff00000000000;
    MtaConfigDelimiter 255;
}

Give it a try, let me know if other changes are needed (maybe add this with a new argument?) and if everything is OK me or Richard will accept the changes.

This is a really nice feature in my opinion, especially when working with PacketCable configuration files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants