Is there any reason as to why 'pass' and 'pass_persistant' are
currently not supporting all the data types; in particular the
COUNTER64 and unsigned types ? Or is there some fundamental reason why
this is a bad idea ?

Thanks,

Dw





diff -c -r net-snmp-5.4.1.org/agent/mibgroup/ucd-snmp/pass.c net-
snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c
*** net-snmp-5.4.1.org/agent/mibgroup/ucd-snmp/pass.c 2005-08-18
02:44:02.000000000 +0200
--- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c 2008-03-17
10:41:26.000000000 +0100
***************
*** 365,386 ****
*var_len = strlen(buf2);
vp->type = ASN_OCTET_STR;
return ((unsigned char *) buf2);
! } else if (!strncasecmp(buf, "integer", 7)) {
! *var_len = sizeof(long_ret);
! long_ret = strtol(buf2, NULL, 10);
! vp->type = ASN_INTEGER;
! return ((unsigned char *) &long_ret);
! } else if (!strncasecmp(buf, "unsigned", 8)) {
! *var_len = sizeof(long_ret);
! long_ret = strtoul(buf2, NULL, 10);
! vp->type = ASN_UNSIGNED;
! return ((unsigned char *) &long_ret);
! } else if (!strncasecmp(buf, "counter", 7)) {
! *var_len = sizeof(long_ret);
! long_ret = strtoul(buf2, NULL, 10);
! vp->type = ASN_COUNTER;
! return ((unsigned char *) &long_ret);
! } else if (!strncasecmp(buf, "octet", 5)) {
*var_len = asc2bin(buf2);
vp->type = ASN_OCTET_STR;
return ((unsigned char *) buf2);
--- 365,414 ----
*var_len = strlen(buf2);
vp->type = ASN_OCTET_STR;
return ((unsigned char *) buf2);
! }
!
! #define _cnf(rtype,tag,function,asn_type) \
! else if (!strncasecmp(buf, tag, sizeof(tag))) { \
! static rtype long_ret; \
! *var_len = sizeof(rtype); \
! long_ret = function (buf2, NULL); \
! vp->type = asn_type; \
! return ((unsigned char *) &long_ret); \
! }
! #define _cnf32(rtype,tag,function,asn_type) \
! else if (!strncasecmp(buf, tag, sizeof(tag))) { \
! static rtype long_ret; \
! *var_len = sizeof(rtype); \
! long_ret = function (buf2, NULL, 10); \
! vp->type = asn_type; \
! return ((unsigned char *) &long_ret); \
! }
!
! #define _cnf64(rtype,tag,function,asn_type) \
! else if (!strncasecmp(buf, tag, sizeof(tag))) { \
! static rtype long_ret; static struct counter64 c64_ret; \
! *var_len = sizeof(struct counter64); \
! long_ret = function (buf2, NULL, 10); \
! c64_ret.low = long_ret & 0xffffffff; \
! c64_ret.high = long_ret >> 32; \
! vp->type = asn_type; \
! return ((unsigned char *) &long_ret); \
! }
!
! _cnf64(long long, "counter64", strtuol, ASN_COUNTER64)
! _cnf64(long long, "integer64", strtol, ASN_INTEGER64)
! _cnf64(unsigned long long, "unsigned64", strtuol, ASN_UNSIGNED64)
!
! _cnf32(unsigned long long, "unsigned", strtuol, ASN_UNSIGNED)
! _cnf32(long long, "integer", strtol, ASN_INTEGER)
! _cnf32(long long, "counter", strtuol, ASN_COUNTER)
! _cnf32(long long, "timeticks", strtuol, ASN_TIMETICKS)
! _cnf32(long long, "gauge", strtoul, ASN_GAUGE)
! _cnf32(double, "double", strtol, ASN_DOUBLE)
!
! _cnf(float, "float", strtof, ASN_FLOAT)
!
! else if (!strncasecmp(buf, "octet", 5)) {
*var_len = asc2bin(buf2);
vp->type = ASN_OCTET_STR;
return ((unsigned char *) buf2);
***************
*** 388,408 ****
*var_len = asc2bin(buf2);
vp->type = ASN_OPAQUE;
return ((unsigned char *) buf2);
- } else if (!strncasecmp(buf, "gauge", 5)) {
- *var_len = sizeof(long_ret);
- long_ret = strtoul(buf2, NULL, 10);
- vp->type = ASN_GAUGE;
- return ((unsigned char *) &long_ret);
} else if (!strncasecmp(buf, "objectid", 8)) {
newlen = parse_miboid(buf2, objid);
*var_len = newlen * sizeof(oid);
vp->type = ASN_OBJECT_ID;
return ((unsigned char *) objid);
- } else if (!strncasecmp(buf, "timetick", 8)) {
- *var_len = sizeof(long_ret);
- long_ret = strtoul(buf2, NULL, 10);
- vp->type = ASN_TIMETICKS;
- return ((unsigned char *) &long_ret);
} else if (!strncasecmp(buf, "ipaddress", 9)) {
newlen = parse_miboid(buf2, objid);
if (newlen != 4) {
--- 416,426 ----



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders