4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #include <fm/fmd_snmp.h>
28 #include <net-snmp/net-snmp-config.h>
29 #include <net-snmp/net-snmp-includes.h>
30 #include <net-snmp/agent/net-snmp-agent-includes.h>
31 #include "sunFM_impl.h"
36 static const sunFm_table_t sun_fm_tables
[] = {
37 TABLE_REG(sunFmModuleTable
),
38 TABLE_REG(sunFmResourceTable
),
39 TABLE_REG(sunFmProblemTable
),
40 TABLE_REG(sunFmFaultEventTable
),
45 * This is our entry point for initialization by the agent, which
46 * (for reasons unknown) ignores the return value. The name is fixed
52 int max_err
= MIB_REGISTERED_OK
;
53 const sunFm_table_t
*table
;
55 for (table
= sun_fm_tables
; table
->t_name
!= NULL
; table
++) {
56 int err
= table
->t_init();
59 case MIB_REGISTERED_OK
:
60 DEBUGMSGTL((MODNAME_STR
, "registered table %s\n",
63 case MIB_DUPLICATE_REGISTRATION
:
64 (void) snmp_log(LOG_ERR
, MODNAME_STR
65 ": table %s initialization failed: duplicate "
66 "registration\n", table
->t_name
);
68 case MIB_REGISTRATION_FAILED
:
69 (void) snmp_log(LOG_ERR
, MODNAME_STR
70 ": table %s initialization failed: agent "
71 "registration failure\n", table
->t_name
);
74 (void) snmp_log(LOG_ERR
, MODNAME_STR
75 ": table %s initialization failed: "
76 "unknown reason\n", table
->t_name
);