Print this page
    
NEX-17772 libfmd_snmp should learn about new FmProblem fields
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/lib/fm/libfmd_adm/common/fmd_adm.h
          +++ new/usr/src/lib/fm/libfmd_adm/common/fmd_adm.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  
    | 
      ↓ open down ↓ | 
    16 lines elided | 
    
      ↑ open up ↑ | 
  
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
       27 +/*
       28 + * Copyright 2018 Nexenta Systems, Inc.
       29 + */
       30 +
  27   31  #ifndef _FMD_ADM_H
  28   32  #define _FMD_ADM_H
  29   33  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   34  #include <fm/fmd_api.h>
  33   35  
  34   36  #ifdef  __cplusplus
  35   37  extern "C" {
  36   38  #endif
  37   39  
  38   40  /*
  39   41   * Fault Management Daemon Administrative Interfaces
  40   42   *
  41   43   * Note: The contents of this file are private to the implementation of the
  42   44   * Solaris system and FMD subsystem and are subject to change at any time
  43   45   * without notice.  Applications and drivers using these interfaces will fail
  44   46   * to run on future releases.  These interfaces should not be used for any
  45   47   * purpose until they are publicly documented for use outside of Sun.
  46   48   */
  47   49  
  48   50  #define FMD_ADM_VERSION 1               /* library ABI interface version */
  49   51  #define FMD_ADM_PROGRAM 0               /* connect library to system fmd */
  50   52  
  51   53  typedef struct fmd_adm fmd_adm_t;
  52   54  
  53   55  extern fmd_adm_t *fmd_adm_open(const char *, uint32_t, int);
  54   56  extern void fmd_adm_close(fmd_adm_t *);
  55   57  extern const char *fmd_adm_errmsg(fmd_adm_t *);
  56   58  
  57   59  typedef struct fmd_adm_stats {
  58   60          fmd_stat_t *ams_buf;            /* statistics data array */
  59   61          uint_t ams_len;                 /* length of data array */
  60   62  } fmd_adm_stats_t;
  61   63  
  62   64  extern int fmd_adm_stats_read(fmd_adm_t *, const char *, fmd_adm_stats_t *);
  63   65  extern int fmd_adm_stats_free(fmd_adm_t *, fmd_adm_stats_t *);
  64   66  
  65   67  typedef struct fmd_adm_modinfo {
  66   68          const char *ami_name;           /* string name of module */
  67   69          const char *ami_desc;           /* module description */
  68   70          const char *ami_vers;           /* module version */
  69   71          uint_t ami_flags;               /* flags (see below) */
  70   72  } fmd_adm_modinfo_t;
  71   73  
  72   74  #define FMD_ADM_MOD_FAILED      0x1     /* module has failed */
  73   75  
  74   76  typedef int fmd_adm_module_f(const fmd_adm_modinfo_t *, void *);
  75   77  
  76   78  extern int fmd_adm_module_iter(fmd_adm_t *, fmd_adm_module_f *, void *);
  77   79  extern int fmd_adm_module_load(fmd_adm_t *, const char *);
  78   80  extern int fmd_adm_module_unload(fmd_adm_t *, const char *);
  79   81  extern int fmd_adm_module_reset(fmd_adm_t *, const char *);
  80   82  extern int fmd_adm_module_stats(fmd_adm_t *, const char *, fmd_adm_stats_t *);
  81   83  extern int fmd_adm_module_gc(fmd_adm_t *, const char *);
  82   84  
  83   85  typedef struct fmd_adm_rsrcinfo {
  84   86          const char *ari_fmri;           /* fmri name of resource */
  85   87          const char *ari_uuid;           /* uuid name of resource */
  86   88          const char *ari_case;           /* uuid of case associated w/ state */
  
    | 
      ↓ open down ↓ | 
    45 lines elided | 
    
      ↑ open up ↑ | 
  
  87   89          uint_t ari_flags;               /* flags (see below) */
  88   90  } fmd_adm_rsrcinfo_t;
  89   91  
  90   92  #define FMD_ADM_RSRC_FAULTY     0x1     /* resource is faulty */
  91   93  #define FMD_ADM_RSRC_UNUSABLE   0x2     /* resource is unusable */
  92   94  #define FMD_ADM_RSRC_INVISIBLE  0x4     /* resource is not directly visible */
  93   95  
  94   96  typedef struct fmd_adm_caseinfo {
  95   97          const char *aci_uuid;
  96   98          const char *aci_code;
       99 +        const char *aci_type;
      100 +        const char *aci_severity;
  97  101          const char *aci_url;
      102 +        const char *aci_desc;
      103 +        const char *aci_fmri;
  98  104          nvlist_t *aci_event;
  99  105  } fmd_adm_caseinfo_t;
 100  106  
 101  107  typedef int fmd_adm_rsrc_f(const fmd_adm_rsrcinfo_t *, void *);
 102  108  typedef int fmd_adm_case_f(const fmd_adm_caseinfo_t *, void *);
 103  109  
 104  110  extern int fmd_adm_rsrc_count(fmd_adm_t *, int, uint32_t *);
 105  111  extern int fmd_adm_rsrc_iter(fmd_adm_t *, int, fmd_adm_rsrc_f *, void *);
 106  112  extern int fmd_adm_rsrc_flush(fmd_adm_t *, const char *);
 107  113  extern int fmd_adm_rsrc_repaired(fmd_adm_t *, const char *);
 108  114  extern int fmd_adm_rsrc_replaced(fmd_adm_t *, const char *);
 109  115  extern int fmd_adm_rsrc_acquit(fmd_adm_t *, const char *, const char *);
 110  116  extern int fmd_adm_case_repair(fmd_adm_t *, const char *);
 111  117  extern int fmd_adm_case_acquit(fmd_adm_t *, const char *);
 112  118  extern int fmd_adm_case_iter(fmd_adm_t *, const char *, fmd_adm_case_f *,
 113  119      void *);
 114  120  
 115  121  typedef struct fmd_adm_serdinfo {
 116  122          const char *asi_name;           /* name of serd engine */
 117  123          uint64_t asi_delta;             /* nsecs from oldest event to now */
 118  124          uint64_t asi_n;                 /* N parameter (event count) */
 119  125          uint64_t asi_t;                 /* T parameter (nanoseconds) */
 120  126          uint_t asi_count;               /* number of events in engine */
 121  127          uint_t asi_flags;               /* flags (see below) */
 122  128  } fmd_adm_serdinfo_t;
 123  129  
 124  130  #define FMD_ADM_SERD_FIRED      0x1     /* serd engine has fired */
 125  131  
 126  132  typedef int fmd_adm_serd_f(const fmd_adm_serdinfo_t *, void *);
 127  133  
 128  134  extern int fmd_adm_serd_iter(fmd_adm_t *, const char *,
 129  135      fmd_adm_serd_f *, void *);
 130  136  extern int fmd_adm_serd_reset(fmd_adm_t *, const char *, const char *);
 131  137  
 132  138  typedef int fmd_adm_xprt_f(id_t, void *);
 133  139  
 134  140  extern int fmd_adm_xprt_iter(fmd_adm_t *, fmd_adm_xprt_f *, void *);
 135  141  extern int fmd_adm_xprt_stats(fmd_adm_t *, id_t, fmd_adm_stats_t *);
 136  142  
 137  143  extern int fmd_adm_log_rotate(fmd_adm_t *, const char *);
 138  144  
 139  145  #ifdef  __cplusplus
 140  146  }
 141  147  #endif
 142  148  
 143  149  #endif  /* _FMD_ADM_H */
  
    | 
      ↓ open down ↓ | 
    36 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX