Hello,
in the last time I'm often handling MTA-configfiles with PacketCable and euroPacketCable
as there are both MIBs installed they are resolved to the same NAME.
As I'm not familiar with C I've just done a quick, dirty copy&past tryout to get this done.
I've just added a option -o (OID) and added a int snmp_oid which is 0 or something else.
This variable would be given to "setup_mib_flags(snmp_oid);"
The funcion now looks like this:
408 setup_mib_flags(snmp_oid) {
409 if(snmp_oid==0){
410 init_mib ();
411 } else {
412 setenv ("MIBS", "ALL", 1);
413 init_mib ();
414 #ifdef DEBUG
415 //snmp_set_mib_warnings (2);
416 #endif /* DEBUG */
417
418 if (!netsnmp_ds_get_boolean
419 (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS))
... original_code
Maybe this patch is of interest.
regards,
Benedikt
option to disable oid-resolving
I'm not 100% clear on what you want. Can you submit:
1) an example encoded file
2) that file decoded with -d
3) that file decoded with your patch and -o -d
Also, does the patch I've attached provide the same behavior as your patch?
If you submit any more patches, please use unified diff (diff -u) format.
Hi Richard,
the Idea is to print OID instead of Names for example:
docsis -d example.bin
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 example.bin
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.7432.1.1.1.6.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 mib-2.169.1.1.13.0 HexString 0x003ff00000000000 ;
MtaConfigDelimiter 255;
}
hope this helps.
regards,
Benedikt
I've attached a new patch against the latest git code. Does it meet your needs?
Hi Richard,
the last patch works as expectd. Thank you.
regards,
Benedikt
Thanks for the patch.