Mercurial > illumos > illumos-gate
annotate usr/src/cmd/fm/modules/common/ext-event-transport/fmevt_outbound.c @ 12979:ab9ae749152f
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
author | Gavin Maltby <gavin.maltby@oracle.com> |
---|---|
date | Fri, 30 Jul 2010 17:04:17 +1000 |
parents | b91faef0c984 |
children |
rev | line source |
---|---|
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
1 /* |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
2 * CDDL HEADER START |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
3 * |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
4 * The contents of this file are subject to the terms of the |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
5 * Common Development and Distribution License (the "License"). |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
6 * You may not use this file except in compliance with the License. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
7 * |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
9 * or http://www.opensolaris.org/os/licensing. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
10 * See the License for the specific language governing permissions |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
11 * and limitations under the License. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
12 * |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
13 * When distributing Covered Code, include this CDDL HEADER in each |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
15 * If applicable, add the following below this CDDL HEADER, with the |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
16 * fields enclosed by brackets "[]" replaced with your own identifying |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
18 * |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
19 * CDDL HEADER END |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
20 */ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
21 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
22 /* |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
24 */ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
25 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
26 #include <sys/types.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
27 #include <strings.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
28 #include <fm/fmd_api.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
29 #include <sys/fm/protocol.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
30 #include <sys/fm/util.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
31 #include <sys/sysevent.h> |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
32 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
33 #include "fmevt.h" |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
34 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
35 static evchan_t *fmevt_outbound_chan; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
36 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
37 static struct fmevt_outbound_stats { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
38 fmd_stat_t recv_calls; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
39 fmd_stat_t recv_list; |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
40 fmd_stat_t recv_ireport; |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
41 fmd_stat_t recv_other; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
42 fmd_stat_t fwd_success; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
43 fmd_stat_t fwd_failure; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
44 } outbound_stats = { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
45 { "outbound_recv_calls", FMD_TYPE_UINT64, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
46 "total events received for forwarding" }, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
47 { "outbound_cat1class_list", FMD_TYPE_UINT64, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
48 "events received matching list.*" }, |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
49 { "outbound_cat1class_ireport", FMD_TYPE_UINT64, |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
50 "events received matching ireport.*" }, |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
51 { "outbound_cat1class_other", FMD_TYPE_UINT64, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
52 "events of other classes" }, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
53 { "outbound_fwd_success", FMD_TYPE_UINT64, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
54 "events forwarded successfully" }, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
55 { "outbound_fwd_failure", FMD_TYPE_UINT64, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
56 "events we failed to forward" } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
57 }; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
58 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
59 #define BUMPSTAT(stat) outbound_stats.stat.fmds_value.ui64++ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
60 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
61 /* |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
62 * In the .conf file we subscribe to list.* and ireport.* event classes. |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
63 * Any additions to that set could cause some unexpected behaviour. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
64 * For example adding fault.foo won't work (since we don't publish |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
65 * faults directly but only within a list.suspect) but we will get |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
66 * any list.* including fault.foo as a suspect. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
67 */ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
68 /*ARGSUSED*/ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
69 void |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
70 fmevt_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class) |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
71 { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
72 BUMPSTAT(recv_calls); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
73 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
74 if (strncmp(class, "list.", 5) == 0) |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
75 BUMPSTAT(recv_list); |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
76 else if (strncmp(class, "ireport.", 8) == 0) |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
77 BUMPSTAT(recv_ireport); |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
78 else |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
79 BUMPSTAT(recv_other); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
80 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
81 if (sysevent_evc_publish(fmevt_outbound_chan, class, "", |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
82 SUNW_VENDOR, FM_PUB, nvl, EVCH_SLEEP) == 0) { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
83 BUMPSTAT(fwd_success); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
84 } else { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
85 BUMPSTAT(fwd_failure); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
86 fmd_hdl_debug(hdl, "sysevent_evc_publish failed:"); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
87 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
88 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
89 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
90 void |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
91 fmevt_init_outbound(fmd_hdl_t *hdl) |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
92 { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
93 int32_t channel_depth; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
94 char *channel_name; |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
95 nvlist_t *nvl; |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
96 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
97 if (fmd_prop_get_int32(hdl, "protocol_forward_disable") == B_TRUE) { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
98 fmd_hdl_debug(hdl, "protocol forwarding disabled " |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
99 "through .conf file setting\n"); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
100 return; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
101 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
102 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
103 (void) fmd_stat_create(hdl, FMD_STAT_NOALLOC, sizeof (outbound_stats) / |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
104 sizeof (fmd_stat_t), (fmd_stat_t *)&outbound_stats); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
105 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
106 /* |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
107 * Allow simulation environment to change outbound channel name. |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
108 */ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
109 channel_name = fmd_prop_get_string(hdl, "outbound_channel"); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
110 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
111 if (sysevent_evc_bind(channel_name, &fmevt_outbound_chan, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
112 EVCH_CREAT | EVCH_HOLD_PEND_INDEF) != 0) { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
113 fmd_hdl_abort(hdl, "Unable to bind channel %s", |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
114 channel_name); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
115 return; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
116 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
117 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
118 channel_depth = fmd_prop_get_int32(hdl, "outbound_channel_depth"); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
119 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
120 if (sysevent_evc_control(fmevt_outbound_chan, EVCH_SET_CHAN_LEN, |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
121 (uint32_t)channel_depth) != 0) { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
122 fmd_hdl_abort(hdl, "Unable to set depth of channel %s to %d", |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
123 channel_name, channel_depth); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
124 } |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
125 fmd_prop_free_string(hdl, channel_name); |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
126 |
12979
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
127 nvl = fmd_nvl_alloc(hdl, FMD_SLEEP); |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
128 (void) nvlist_add_nvlist(nvl, "fmdauth", |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
129 (nvlist_t *)fmd_hdl_fmauth(hdl)); |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
130 (void) sysevent_evc_setpropnvl(fmevt_outbound_chan, nvl); |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
131 nvlist_free(nvl); |
ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents:
11102
diff
changeset
|
132 |
11102
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
133 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
134 |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
135 /*ARGSUSED*/ |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
136 void |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
137 fmevt_fini_outbound(fmd_hdl_t *hdl) |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
138 { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
139 if (fmevt_outbound_chan != NULL) { |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
140 (void) sysevent_evc_unbind(fmevt_outbound_chan); |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
141 fmevt_outbound_chan = NULL; |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
142 } |
b91faef0c984
PSARC/2009/554 door_xcreate - extended door creation interface for private doors
Gavin Maltby <Gavin.Maltby@Sun.COM>
parents:
diff
changeset
|
143 } |