diff options
author | Gavin Maltby <gavin.maltby@oracle.com> | 2010-07-30 17:04:17 +1000 |
---|---|---|
committer | Gavin Maltby <gavin.maltby@oracle.com> | 2010-07-30 17:04:17 +1000 |
commit | f6e214c7418f43af38bd8c3a557e3d0a1d311cfa (patch) | |
tree | 0f0e4cee5ead68ee30660107f9eccf7cd9e72c2e /usr/src/lib/libscf/inc/libscf.h | |
parent | 265a964d7aa43c47170d21d2f01bcf873d7fd79d (diff) | |
download | illumos-joyent-f6e214c7418f43af38bd8c3a557e3d0a1d311cfa.tar.gz |
PSARC/2009/617 Software Events Notification Parameters CLI
PSARC/2009/618 snmp-notify: SNMP Notification Daemon for Software Events
PSARC/2009/619 smtp-notify: Email Notification Daemon for Software Events
PSARC/2010/225 fmd for non-global Solaris zones
PSARC/2010/226 Solaris Instance UUID
PSARC/2010/227 nvlist_nvflag(3NVPAIR)
PSARC/2010/228 libfmevent additions
PSARC/2010/257 sysevent_evc_setpropnvl and sysevent_evc_getpropnvl
PSARC/2010/265 FMRI and FMA Event Stabilty, 'ireport' category 1 event class, and the 'sw' FMRI scheme
PSARC/2010/278 FMA/SMF integration: instance state transitions
PSARC/2010/279 Modelling panics within FMA
PSARC/2010/290 logadm.conf upgrade
6392476 fmdump needs to pretty-print
6393375 userland ereport/ireport event generation interfaces
6445732 Add email notification agent for FMA and software events
6804168 RFE: Allow an efficient means to monitor SMF services status changes
6866661 scf_values_destroy(3SCF) will segfault if is passed NULL
6884709 Add snmp notification agent for FMA and software events
6884712 Add private interface to tap into libfmd_msg macro expansion capabilities
6897919 fmd to run in a non-global zone
6897937 fmd use of non-private doors is not safe
6900081 add a UUID to Solaris kernel image for use in crashdump identification
6914884 model panic events as a defect diagnosis in FMA
6944862 fmd_case_open_uuid, fmd_case_uuisresolved, fmd_nvl_create_defect
6944866 log legacy sysevents in fmd
6944867 enumerate svc scheme in topo
6944868 software-diagnosis and software-response fmd modules
6944870 model SMF maintenance state as a defect diagnosis in FMA
6944876 savecore runs in foreground for systems with zfs root and dedicated dump
6965796 Implement notification parameters for SMF state transitions and FMA events
6968287 SUN-FM-MIB.mib needs to be updated to reflect Oracle information
6972331 logadm.conf upgrade PSARC/2010/290
Diffstat (limited to 'usr/src/lib/libscf/inc/libscf.h')
-rw-r--r-- | usr/src/lib/libscf/inc/libscf.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/usr/src/lib/libscf/inc/libscf.h b/usr/src/lib/libscf/inc/libscf.h index b3ded758bd..8e68b4dfcc 100644 --- a/usr/src/lib/libscf/inc/libscf.h +++ b/usr/src/lib/libscf/inc/libscf.h @@ -29,6 +29,7 @@ #include <stddef.h> #include <sys/types.h> +#include <libnvpair.h> #ifdef __cplusplus extern "C" { @@ -286,6 +287,7 @@ typedef struct scf_tmpl_error scf_tmpl_error_t; /* * Standard property names */ +#define SCF_PROPERTY_ACTIVE_POSTFIX ((const char *)"active") #define SCF_PROPERTY_AUX_STATE ((const char *)"auxiliary_state") #define SCF_PROPERTY_AUX_FMRI ((const char *)"auxiliary_fmri") #define SCF_PROPERTY_AUX_TTY ((const char *)"auxiliary_tty") @@ -401,6 +403,38 @@ typedef struct scf_tmpl_error scf_tmpl_error_t; #define SCF_STATE_DEGRADED 0x00000020 #define SCF_STATE_ALL 0x0000003F +/* + * software fma svc-transition class + */ +#define SCF_NOTIFY_PARAMS_VERSION 0X0 +#define SCF_NOTIFY_NAME_FMRI ((const char *)"fmri") +#define SCF_NOTIFY_NAME_VERSION ((const char *)"version") +#define SCF_NOTIFY_NAME_TSET ((const char *)"tset") +#define SCF_NOTIFY_PG_POSTFIX ((const char *)"fmnotify") +#define SCF_NOTIFY_PARAMS ((const char *)"notify-params") +#define SCF_NOTIFY_PARAMS_INST \ + ((const char *)"svc:/system/fm/notify-params:default") +#define SCF_SVC_TRANSITION_CLASS \ + ((const char *)"ireport.os.smf.state-transition") +#define SCF_NOTIFY_PARAMS_PG_TYPE ((const char *)"notify_params") + +/* + * Useful transition macros + */ +#define SCF_TRANS_SHIFT_INITIAL_STATE(s) ((s) << 16) +#define SCF_TRANSITION_ALL \ + (SCF_TRANS_SHIFT_INITIAL_STATE(SCF_STATE_ALL) | SCF_STATE_ALL) +#define SCF_TRANS(f, t) (SCF_TRANS_SHIFT_INITIAL_STATE(f) | (t)) +#define SCF_TRANS_VALID(t) (!((t) & ~SCF_TRANSITION_ALL)) +#define SCF_TRANS_INITIAL_STATE(t) ((t) >> 16 & SCF_STATE_ALL) +#define SCF_TRANS_FINAL_STATE(t) ((t) & SCF_STATE_ALL) + +/* + * Prefixes for states in state transition notification + */ +#define SCF_STN_PREFIX_FROM ((const char *)"from-") +#define SCF_STN_PREFIX_TO ((const char *)"to-") + #define SCF_PG_FLAG_NONPERSISTENT 0x1 #define SCF_TRACE_LIBRARY 0x1 @@ -775,6 +809,27 @@ void *scf_simple_prop_next_opaque(scf_simple_prop_t *, size_t *); void scf_simple_prop_next_reset(scf_simple_prop_t *); /* + * smf_state_from_string() + * return SCF_STATE_* value for the input + * -1 on error. String "all" maps to SCF_STATE_ALL macro + */ +int32_t smf_state_from_string(const char *); + +/* + * smf_state_to_string() + * return SCF_STATE_STRING* value for the input + * NULL on error. + */ +const char *smf_state_to_string(int32_t); + +/* + * Notification interfaces + */ +int smf_notify_set_params(const char *, nvlist_t *); +int smf_notify_get_params(nvlist_t **, nvlist_t *); +int smf_notify_del_params(const char *, const char *, int32_t); + +/* * SMF exit status definitions */ #define SMF_EXIT_OK 0 |