1 /*
   2  * CDDL HEADER START
   3  *
   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.
   7  *
   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.
  12  *
  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]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2018 Nexenta Systems, Inc.
  25  */
  26 
  27 #ifndef _FMD_SNMP_H
  28 #define _FMD_SNMP_H
  29 
  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 /*
  35  * These values are derived from, and must remain consistent with, the
  36  * MIB definitions in SUN-FM-MIB.
  37  */
  38 #define MODNAME_STR     "sunFM"
  39 #define SUNFM_OID       1, 3, 6, 1, 4, 1, 42, 2, 195, 1
  40 
  41 #define SUNFMPROBLEMTABLE_OID           SUNFM_OID, 1
  42 
  43 #define SUNFMPROBLEM_COL_UUIDINDEX      1
  44 #define SUNFMPROBLEM_COL_UUID           2
  45 #define SUNFMPROBLEM_COL_HOSTNAME       3
  46 #define SUNFMPROBLEM_COL_CODE           4
  47 #define SUNFMPROBLEM_COL_TYPE           5
  48 #define SUNFMPROBLEM_COL_SEVERITY       6
  49 #define SUNFMPROBLEM_COL_URL            7
  50 #define SUNFMPROBLEM_COL_DESC           8
  51 #define SUNFMPROBLEM_COL_FMRI           9
  52 #define SUNFMPROBLEM_COL_DIAGENGINE     10
  53 #define SUNFMPROBLEM_COL_DIAGTIME       11
  54 #define SUNFMPROBLEM_COL_SUSPECTCOUNT   12
  55 
  56 #define SUNFMPROBLEM_COLMIN             SUNFMPROBLEM_COL_UUID
  57 #define SUNFMPROBLEM_COLMAX             SUNFMPROBLEM_COL_SUSPECTCOUNT
  58 
  59 #define SUNFMFAULTEVENTTABLE_OID        SUNFM_OID, 2
  60 
  61 #define SUNFMFAULTEVENT_COL_UUIDINDEX   1
  62 #define SUNFMFAULTEVENT_COL_INDEX       2
  63 #define SUNFMFAULTEVENT_COL_PROBLEMUUID 3
  64 #define SUNFMFAULTEVENT_COL_CLASS       4
  65 #define SUNFMFAULTEVENT_COL_CERTAINTY   5
  66 #define SUNFMFAULTEVENT_COL_ASRU        6
  67 #define SUNFMFAULTEVENT_COL_FRU         7
  68 #define SUNFMFAULTEVENT_COL_RESOURCE    8
  69 #define SUNFMFAULTEVENT_COL_STATUS      9
  70 #define SUNFMFAULTEVENT_COL_LOCATION    10
  71 
  72 #define SUNFMFAULTEVENT_COLMIN          SUNFMFAULTEVENT_COL_PROBLEMUUID
  73 #define SUNFMFAULTEVENT_COLMAX          SUNFMFAULTEVENT_COL_LOCATION
  74 
  75 #define SUNFMFAULTEVENT_STATE_OTHER     1
  76 #define SUNFMFAULTEVENT_STATE_FAULTY    2
  77 #define SUNFMFAULTEVENT_STATE_REMOVED   3
  78 #define SUNFMFAULTEVENT_STATE_REPLACED  4
  79 #define SUNFMFAULTEVENT_STATE_REPAIRED  5
  80 #define SUNFMFAULTEVENT_STATE_ACQUITTED 6
  81 
  82 #define SUNFMMODULETABLE_OID            SUNFM_OID, 3
  83 
  84 #define SUNFMMODULE_COL_INDEX           1
  85 #define SUNFMMODULE_COL_NAME            2
  86 #define SUNFMMODULE_COL_VERSION         3
  87 #define SUNFMMODULE_COL_STATUS          4
  88 #define SUNFMMODULE_COL_DESCRIPTION     5
  89 
  90 #define SUNFMMODULE_COLMIN              SUNFMMODULE_COL_NAME
  91 #define SUNFMMODULE_COLMAX              SUNFMMODULE_COL_DESCRIPTION
  92 
  93 #define SUNFMMODULE_STATE_OTHER         1
  94 #define SUNFMMODULE_STATE_ACTIVE        2
  95 #define SUNFMMODULE_STATE_FAILED        3
  96 
  97 #define SUNFMRESOURCECOUNT_OID          SUNFM_OID, 4
  98 
  99 #define SUNFMRESOURCETABLE_OID          SUNFM_OID, 5
 100 
 101 #define SUNFMRESOURCE_COL_INDEX         1
 102 #define SUNFMRESOURCE_COL_FMRI          2
 103 #define SUNFMRESOURCE_COL_STATUS        3
 104 #define SUNFMRESOURCE_COL_DIAGNOSISUUID 4
 105 
 106 #define SUNFMRESOURCE_COLMIN            SUNFMRESOURCE_COL_FMRI
 107 #define SUNFMRESOURCE_COLMAX            SUNFMRESOURCE_COL_DIAGNOSISUUID
 108 
 109 #define SUNFMRESOURCE_STATE_OTHER       1
 110 #define SUNFMRESOURCE_STATE_OK          2
 111 #define SUNFMRESOURCE_STATE_DEGRADED    3
 112 #define SUNFMRESOURCE_STATE_UNKNOWN     4
 113 #define SUNFMRESOURCE_STATE_FAULTED     5
 114 
 115 #define SUNFMTRAPS_OID                  SUNFM_OID, 7, 0
 116 #define SUNFMPROBLEMTRAP_OID            SUNFMTRAPS_OID, 1
 117 
 118 #define SNMP_URL_MSG    "snmp-url"
 119 
 120 /*
 121  * Definitions from SUN-IREPORT-MIB
 122  */
 123 #define SUNIREPORT_OID  1, 3, 6, 1, 4, 1, 42, 2, 197, 1
 124 
 125 #define SUNIREPORTNOTIFICATIONENTRY     SUNIREPORT_OID, 1
 126 
 127 #define SUNIREPORTHOSTNAME_OID          SUNIREPORTNOTIFICATIONENTRY, 1
 128 #define SUNIREPORTMSGID_OID             SUNIREPORTNOTIFICATIONENTRY, 2
 129 #define SUNIREPORTSEVERITY_OID          SUNIREPORTNOTIFICATIONENTRY, 3
 130 #define SUNIREPORTDESCRIPTION_OID       SUNIREPORTNOTIFICATIONENTRY, 4
 131 #define SUNIREPORTTIME_OID              SUNIREPORTNOTIFICATIONENTRY, 5
 132 #define SUNIREPORTSMFFMRI_OID           SUNIREPORTNOTIFICATIONENTRY, 6
 133 #define SUNIREPORTSMFFROMSTATE_OID      SUNIREPORTNOTIFICATIONENTRY, 7
 134 #define SUNIREPORTSMFTOSTATE_OID        SUNIREPORTNOTIFICATIONENTRY, 8
 135 #define SUNIREPORTTRANSITIONREASON_OID  SUNIREPORTNOTIFICATIONENTRY, 9
 136 
 137 #define SUNIREPORTTRAPS_OID             SUNIREPORT_OID, 2, 0
 138 #define SUNIREPORTTRAP_OID              SUNIREPORTTRAPS_OID, 1
 139 
 140 
 141 extern int      init_sunFM(void);
 142 
 143 #ifdef  __cplusplus
 144 }
 145 #endif
 146 
 147 #endif  /* _FMD_SNMP_H */