diff options
author | wesolows <none@none> | 2007-04-02 19:12:42 -0700 |
---|---|---|
committer | wesolows <none@none> | 2007-04-02 19:12:42 -0700 |
commit | 1fe76c0bac8011fcb2a7d8a4a83b76700787dd5c (patch) | |
tree | 47765437a313b760dde72201bd18696189f79146 | |
parent | 2b2a8a5e98b489c58877f7b40bd5d13509c9fa15 (diff) | |
download | illumos-joyent-1fe76c0bac8011fcb2a7d8a4a83b76700787dd5c.tar.gz |
6480198 Unable to retrieve fma data from snmp traps via snmpget
6541833 fma snmp plugin fails to provide ASRU/FRU data
6541834 dead code in libfmd_snmp's problem.c
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/Makefile.com | 4 | ||||
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/common/mapfile-vers | 4 | ||||
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/common/module.c | 10 | ||||
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/common/problem.c | 4 | ||||
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/common/resource.c | 12 | ||||
-rw-r--r-- | usr/src/lib/fm/libfmd_snmp/common/scheme.c | 21 |
6 files changed, 35 insertions, 20 deletions
diff --git a/usr/src/lib/fm/libfmd_snmp/Makefile.com b/usr/src/lib/fm/libfmd_snmp/Makefile.com index cc316a0a76..d6e530ba50 100644 --- a/usr/src/lib/fm/libfmd_snmp/Makefile.com +++ b/usr/src/lib/fm/libfmd_snmp/Makefile.com @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -56,7 +56,7 @@ SNMPLIBS = -L$(SFWLIBDIR) -lnetsnmp -lnetsnmphelpers -lnetsnmpagent lint := SNMPLIBS= LDLIBS += $(MACH_LDLIBS) -LDLIBS += -lfmd_adm -luutil -lnvpair +LDLIBS += -lfmd_adm -luutil -lnvpair -ltopo LDLIBS += $(SNMPLIBS) LDLIBS += -lc DYNFLAGS += -R$(SFWLIBDIR) diff --git a/usr/src/lib/fm/libfmd_snmp/common/mapfile-vers b/usr/src/lib/fm/libfmd_snmp/common/mapfile-vers index 5052a6aabf..4af3e953f4 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/mapfile-vers +++ b/usr/src/lib/fm/libfmd_snmp/common/mapfile-vers @@ -18,8 +18,9 @@ # # CDDL HEADER END # + # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -37,6 +38,7 @@ SUNWprivate { fmd_fmri_strdup; fmd_fmri_strescape; fmd_fmri_strfree; + fmd_fmri_topology; fmd_fmri_warn; fmd_fmri_zalloc; init_sunFM; diff --git a/usr/src/lib/fm/libfmd_snmp/common/module.c b/usr/src/lib/fm/libfmd_snmp/common/module.c index bcca2ce19c..811aef2937 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/module.c +++ b/usr/src/lib/fm/libfmd_snmp/common/module.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -154,10 +154,8 @@ module_lookup_index_nextvalid(const ulong_t index) data = uu_avl_nearest_next(mod_index_avl, idx); - while (data != NULL && !MODULE_DATA_VALID(data)) { - (void) uu_avl_find(mod_index_avl, data, NULL, &idx); - data = uu_avl_nearest_next(mod_index_avl, idx); - } + while (data != NULL && !MODULE_DATA_VALID(data)) + data = uu_avl_next(mod_index_avl, data); return (data); } @@ -528,7 +526,7 @@ sunFmModuleTable_nextmod(netsnmp_handler_registration *reginfo, return (NULL); } - *var->val.integer = index; + *var->val.integer = data->d_index; table_info->indexes = var; table_info->number_indexes = 1; diff --git a/usr/src/lib/fm/libfmd_snmp/common/problem.c b/usr/src/lib/fm/libfmd_snmp/common/problem.c index 712b1dc253..4a495c5a0a 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/problem.c +++ b/usr/src/lib/fm/libfmd_snmp/common/problem.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -63,8 +63,6 @@ static uu_avl_t *problem_uuid_avl; #define UCT_ALL 0x2 #define UCT_FLAGS 0x3 -#define MODULE_DATA_VALID(d) ((d)->d_valid == valid_stamp) - /* * Locking strategy is described in module.c. */ diff --git a/usr/src/lib/fm/libfmd_snmp/common/resource.c b/usr/src/lib/fm/libfmd_snmp/common/resource.c index 4ca77c619b..50b990f293 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/resource.c +++ b/usr/src/lib/fm/libfmd_snmp/common/resource.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -134,14 +134,12 @@ resource_lookup_index_nextvalid(const ulong_t index) if ((data = uu_avl_find(rsrc_index_avl, key, NULL, &idx)) != NULL && RESOURCE_DATA_VALID(data)) - return (data); + return (data); data = uu_avl_nearest_next(rsrc_index_avl, idx); - while (data != NULL && !RESOURCE_DATA_VALID(data)) { - (void) uu_avl_find(rsrc_index_avl, data, NULL, &idx); - data = uu_avl_nearest_next(rsrc_index_avl, idx); - } + while (data != NULL && !RESOURCE_DATA_VALID(data)) + data = uu_avl_next(rsrc_index_avl, data); return (data); } @@ -541,7 +539,7 @@ sunFmResourceTable_nextrsrc(netsnmp_handler_registration *reginfo, return (NULL); } - *var->val.integer = index; + *var->val.integer = data->d_index; table_info->indexes = var; table_info->number_indexes = 1; diff --git a/usr/src/lib/fm/libfmd_snmp/common/scheme.c b/usr/src/lib/fm/libfmd_snmp/common/scheme.c index 5fc4c5ab61..a9b776b6bf 100644 --- a/usr/src/lib/fm/libfmd_snmp/common/scheme.c +++ b/usr/src/lib/fm/libfmd_snmp/common/scheme.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -30,6 +30,7 @@ #include <sys/types.h> #include <sys/systeminfo.h> #include <fm/fmd_snmp.h> +#include <fm/libtopo.h> #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> @@ -72,6 +73,7 @@ typedef struct fmd_scheme { static fmd_scheme_t *sch_list; /* list of cached schemes */ static char *g_root; /* fmd root dir */ +static struct topo_hdl *g_thp; static long fmd_scheme_notsup(void) @@ -296,3 +298,20 @@ void fmd_fmri_warn(const char *format, ...) { } + +/*ARGSUSED*/ +struct topo_hdl * +fmd_fmri_topology(int version) +{ + int err; + + if (g_thp == NULL) { + if ((g_thp = topo_open(TOPO_VERSION, "/", &err)) == NULL) { + DEBUGMSGTL((MODNAME_STR, "topo_open failed: %s\n", + topo_strerror(err))); + return (NULL); + } + } + + return (g_thp); +} |