This is a discussion on Re: SNMPv3 - problem with auth/encr sessions with Perl module within the SNMP Coders forums, part of the Networking and Network Related category; Dnia poniedzia=B3ek, 9 pa=BCdziernika 2006 18:58, ML napisa=B3: > So, this looks like some Windows-specific ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dnia poniedzia=B3ek, 9 pa=BCdziernika 2006 18:58, ML napisa=B3:
> So, this looks like some Windows-specific issue - I had some time to > experiment and it not only fails to run properly using 5.3.1 "official" > version from windows installer, but also on my own, private build built > with MS VC++ Express 2005. > > Are there any easy ways to debug a binary part of a perl module (maybe > except for poor man's debugging, i.e. printf() ;))? Having nothing else, I tried the poor man's debug, and here's what I found = out. It looks like there's some strange variable visibility problem here = (threads?). I'm not sure of the exact cause of this, because I don't know t= he = architecture of Net-SNMP as a whole, but the following dirty-hacky patch = allows the Perl module to work for us. ---8<--- --- SNMP.xs.orig 2006-10-10 18:55:47.894372444 +0200 +++ SNMP.xs 2006-10-10 19:00:19.851368694 +0200 @@ -2700,6 +2700,10 @@ /* u_char context_eng_id_buf[ENG_ID_BUF_SIZE]; */ SnmpSession session =3D {0}; SnmpSession *ss =3D NULL; + + oid mySHAOID[10] =3D { 1, 3, 6, 1, 6, 3, 10, 1, 1, 3 }; + oid myAESOID[10] =3D { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 }; + int verbose =3D SvIV(perl_get_sv("SNMP::verbose", 0x01 | 0x04)); __libraries_init("perl"); @@ -2742,7 +2746,7 @@ #endif if (!strcmp(auth_proto, "SHA")) { session.securityAuthProto =3D - snmp_duplicate_objid(usmHMACSHA1AuthProtocol, + snmp_duplicate_objid(/*usmHMACSHA1AuthProtocol*/ mySHAO= ID, USM_AUTH_PROTO_SHA_LEN); session.securityAuthProtoLen =3D USM_AUTH_PROTO_SHA_LEN; } else if (!strcmp(auth_proto, "DEFAULT")) { @@ -2792,7 +2796,7 @@ #endif if (!strncmp(priv_proto, "AES", 3)) { session.securityPrivProto =3D - snmp_duplicate_objid(usmAESPrivProtocol, + snmp_duplicate_objid(/*usmAESPrivProtocol*/ myAESOID, USM_PRIV_PROTO_AES_LEN); session.securityPrivProtoLen =3D USM_PRIV_PROTO_AES_LEN; } else if (!strcmp(priv_proto, "DEFAULT")) { ---8<--- (we were only interested in SHA and AES) Without this, usm... variables are pure garbage, and that's the reason why = generate_Ku fails (actually, it's snmp_oid_compare() causing the fault). This may have something to do with ActiveState's Perl - if I get this right= , = Perl is loading SNMP.dll when it needs something what SNMP.pm needs. And = usm... variables apparently are in netsnmp.dll and they are using the very = dll's stack (?), and they cannot be accessed from SNMP.dll (? right?). Anyway, I'm sure that would be a very straightforward fix for you knowing h= ow = Net-SNMP is structured. Please keep me informed about any news. -- = best regards, ML ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?p...orge&CID=3DDE= VDEV _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|