1 --- 0.8.7e/configure.ac 2009-06-28 21:45:02.000000000 -0400
2 +++ ../branches/0.8.7/configure.ac 2009-08-18 20:51:30.000000000 -0400
7 +# ****************** Force Net-SNMP Version Checks ***********************
8 +# If we should use the system popen or nifty popen
9 +AC_MSG_CHECKING(whether to verify net-snmp library vs header versions)
10 +AC_ARG_ENABLE(strict-snmp,
11 + [ --enable-strict-snmp Enable checking of Net-SNMP library vs header versions (default: disabled)],
12 + [ ENABLED_SNMP_VERSION=$enableval ],
13 + [ ENABLED_SNMP_VERSION=no ]
15 +if test "$ENABLED_SNMP_VERSION" = "yes"; then
16 + AC_MSG_RESULT([yes])
17 + AC_DEFINE(VERIFY_PACKAGE_VERSION, 1, If we are going to force Net-SNMP library and header versons to be the same)
22 # ****************** gethostbyname_r Check ***********************
24 AC_MSG_CHECKING([for glibc gethostbyname_r])
25 --- 0.8.7e/snmp.c 2009-06-28 21:45:02.000000000 -0400
26 +++ ../branches/0.8.7/snmp.c 2009-08-18 20:51:30.000000000 -0400
28 netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_BARE_VALUE, 1);
29 netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS, 1);
31 - #ifdef PACKAGE_VERSION
32 + #if defined(VERIFY_PACKAGE_VERSION) && defined(PACKAGE_VERSION)
33 /* check that the headers we compiled with match the library we linked with -
34 apparently not defined in UCD-SNMP...
37 session.securityName = snmp_username;
38 session.securityNameLen = strlen(session.securityName);
40 + if (snmp_context && strlen(snmp_context)) {
41 session.contextName = snmp_context;
42 session.contextNameLen = strlen(session.contextName);
45 session.securityAuthKeyLen = USM_AUTH_KU_LEN;
47 - /* set the engineBoots and engineTime to null so that they are discovered */
48 - session.engineBoots = 0;
49 - session.engineTime = 0;
51 /* set the authentication protocol */
52 if (strcmp(snmp_auth_protocol, "MD5") == 0) {
53 /* set the authentication method to MD5 */
54 - session.securityAuthProto = snmp_duplicate_objid(usmHMACMD5AuthProtocol, OIDSIZE(usmHMACMD5AuthProtocol));
55 - session.securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
56 + session.securityAuthProto = snmp_duplicate_objid(usmHMACMD5AuthProtocol, USM_AUTH_PROTO_MD5_LEN);
57 + session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
59 /* set the authentication method to SHA1 */
60 - session.securityAuthProto = snmp_duplicate_objid(usmHMACSHA1AuthProtocol, OIDSIZE(usmHMACSHA1AuthProtocol));
61 - session.securityAuthProtoLen = OIDSIZE(usmHMACSHA1AuthProtocol);
62 + session.securityAuthProto = snmp_duplicate_objid(usmHMACSHA1AuthProtocol, USM_AUTH_PROTO_SHA_LEN);
63 + session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
66 /* set the authentication key to the hashed version. The password must me at least 8 char */
68 session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
70 if (strcmp(snmp_priv_protocol, "DES") == 0) {
71 - session.securityPrivProto = snmp_duplicate_objid(usmDESPrivProtocol, OIDSIZE(usmDESPrivProtocol));
72 - session.securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
73 + session.securityPrivProto = snmp_duplicate_objid(usmDESPrivProtocol, USM_PRIV_PROTO_DES_LEN);
74 + session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
75 session.securityPrivKeyLen = USM_PRIV_KU_LEN;
77 /* set the security level to authenticate, and encrypted */
78 session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
80 - #if defined(usmAESPrivProtocol) && SNMP_DEFAULT_PRIV_PROTO == usmAESPrivProtocol
81 - session.securityPrivProto = snmp_duplicate_objid(usmAESPrivProtocol, OIDSIZE(usmAESPrivProtocol));
82 - session.securityPrivProtoLen = OIDSIZE(usmAESPrivProtocol);
83 + #if defined(USM_PRIV_PROTO_AES_LEN)
84 + session.securityPrivProto = snmp_duplicate_objid(usmAESPrivProtocol, USM_PRIV_PROTO_AES_LEN);
85 + session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
86 session.securityPrivKeyLen = USM_PRIV_KU_LEN;
88 session.securityPrivProto = snmp_duplicate_objid(usmAES128PrivProtocol, OIDSIZE(usmAES128PrivProtocol));