xref: /titanic_41/usr/src/uts/common/sys/sysevent/ipmp.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_SYSEVENT_IPMP_H
27 #define	_SYS_SYSEVENT_IPMP_H
28 
29 /*
30  * IPMP sysevent definitions.  Note that all of these definitions are
31  * Sun-private and are subject to change at any time.
32  */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Event channel associated with these events
40  */
41 #define	IPMP_EVENT_CHAN "com.sun:ipmp:events"
42 
43 /*
44  * Event type EC_IPMP/ESC_IPMP_GROUP_STATE event schema
45  *
46  *	Event Class     - EC_IPMP
47  *	Event Sub-Class - ESC_IPMP_GROUP_STATE
48  *	Event Vendor	- com.sun
49  *	Event Publisher - in.mpathd
50  *
51  * 	Attribute Name  - IPMP_EVENT_VERSION
52  *	Attribute Type  - SE_DATA_TYPE_UINT32
53  *	Attribute Value - <version>
54  *
55  *	Attribute Name  - IPMP_GROUP_NAME
56  *	Attribute Type  - SE_DATA_TYPE_STRING
57  *	Attribute Value - <group-name>
58  *
59  *	Attribute Name  - IPMP_GROUP_SIGNATURE
60  *	Attribute Type  - SE_DATA_TYPE_UINT64
61  * 	Attribute Value - <group-signature>
62  *
63  *	Attribute Name  - IPMP_GROUP_STATE
64  *	Attribute Type  - SE_DATA_TYPE_UINT32
65  *	Attribute Value - <group-state>
66  */
67 
68 #define	IPMP_EVENT_VERSION	"ipmp_event_version"
69 #define	IPMP_GROUP_NAME		"ipmp_group_name"
70 #define	IPMP_GROUP_SIGNATURE	"ipmp_group_signature"
71 #define	IPMP_GROUP_STATE	"ipmp_group_state"
72 
73 typedef enum {
74 	IPMP_GROUP_OK,		/* all interfaces in the group are ok */
75 	IPMP_GROUP_FAILED,	/* all interfaces in the group are unusable */
76 	IPMP_GROUP_DEGRADED	/* some interfaces in the group are unusable */
77 } ipmp_group_state_t;
78 
79 #define	IPMP_EVENT_CUR_VERSION	2
80 
81 /*
82  * Event type EC_IPMP/ESC_IPMP_GROUP_CHANGE event schema
83  *
84  *	Event Class     - EC_IPMP
85  *	Event Sub-Class - ESC_IPMP_GROUP_CHANGE
86  *	Event Vendor	- com.sun
87  *	Event Publisher - in.mpathd
88  *
89  *	Attribute Name  - IPMP_GROUP_NAME
90  *	Attribute Type  - SE_DATA_TYPE_STRING
91  *	Attribute Value - <group-name>
92  *
93  *	Attribute Name  - IPMP_EVENT_VERSION
94  *	Attribute Type  - SE_DATA_TYPE_UINT32
95  *	Attribute Value - <version>
96  *
97  *	Attribute Name  - IPMP_GROUPLIST_SIGNATURE
98  *	Attribute Type  - SE_DATA_TYPE_UINT64
99  *	Attribute Value - <grouplist-signature>
100  *
101  *	Attribute Name  - IPMP_GROUP_OPERATION
102  *	Attribute Type  - SE_DATA_TYPE_UINT32
103  *	Attribute Value - <group-change-op>
104  */
105 
106 #define	IPMP_GROUPLIST_SIGNATURE	"ipmp_grouplist_signature"
107 #define	IPMP_GROUP_OPERATION		"ipmp_group_operation"
108 
109 typedef enum {
110 	IPMP_GROUP_ADD,		/* a new IPMP group has been created */
111 	IPMP_GROUP_REMOVE	/* an existing IPMP group has been removed */
112 } ipmp_group_op_t;
113 
114 /*
115  * Event type EC_IPMP/ESC_IPMP_GROUP_MEMBER event schema
116  *
117  *	Event Class     - EC_IPMP
118  *	Event Sub-Class - ESC_IPMP_GROUP_MEMBER_CHANGE
119  *	Event Vendor	- com.sun
120  *	Event Publisher - in.mpathd
121  *
122  *	Attribute Name  - IPMP_GROUP_NAME
123  *	Attribute Type  - SE_DATA_TYPE_STRING
124  *	Attribute Value - <group-name>
125  *
126  *	Attribute Name  - IPMP_EVENT_VERSION
127  *	Attribute Type  - SE_DATA_TYPE_UINT32
128  *	Attribute Value - <version>
129  *
130  *	Attribute Name  - IPMP_GROUP_SIGNATURE
131  *	Attribute Type  - SE_DATA_TYPE_UINT64
132  *	Attribute Value - <group-signature>
133  *
134  *	Attribute Name  - IPMP_IF_OPERATION
135  *	Attribute Type  - SE_DATA_TYPE_UINT32
136  *	Attribute Value - <interface-op>
137  *
138  *	Attribute Name  - IPMP_IF_NAME
139  *	Attribute Type  - SE_DATA_TYPE_STRING
140  *	Attribute Value - <if-name>
141  *
142  *	Attribute Name  - IPMP_IF_TYPE
143  *	Attribute Type  - SE_DATA_TYPE_UINT32
144  *	Attribute Value - <if-type>
145  *
146  *	Attribute Name  - IPMP_IF_STATE
147  *	Attribute Type  - SE_DATA_TYPE_UINT32
148  *	Attribute Value - <if-state>
149  */
150 
151 #define	IPMP_IF_OPERATION	"ipmp_if_operation"
152 #define	IPMP_IF_NAME		"ipmp_if_name"
153 #define	IPMP_IF_TYPE		"ipmp_if_type"
154 #define	IPMP_IF_STATE		"ipmp_if_state"
155 
156 typedef enum {
157 	IPMP_IF_ADD,		/* a new interface has joined the group */
158 	IPMP_IF_REMOVE 		/* an existing interface has left the group */
159 } ipmp_if_op_t;
160 
161 typedef enum {
162 	IPMP_IF_STANDBY,	/* the interface is a standby */
163 	IPMP_IF_NORMAL 		/* the interface is not a standby */
164 } ipmp_if_type_t;
165 
166 typedef enum {
167 	IPMP_IF_OK,		/* the interface is functional */
168 	IPMP_IF_FAILED,		/* the interface is in a failed state */
169 	IPMP_IF_OFFLINE,	/* the interface is offline */
170 	IPMP_IF_UNKNOWN		/* the interface may or may not be ok */
171 } ipmp_if_state_t;		/* (not enough probes have been sent) */
172 
173 /*
174  * Event type EC_IPMP/ESC_IPMP_IF_CHANGE event schema
175  *
176  *	Event Class     - EC_IPMP
177  *	Event Sub-Class - ESC_IPMP_IF_CHANGE
178  *	Event Vendor	- com.sun
179  *	Event Publisher - in.mpathd
180  *
181  *	Attribute Name  - IPMP_GROUP_NAME
182  *	Attribute Type  - SE_DATA_TYPE_STRING
183  *	Attribute Value - <group-name>
184  *
185  *	Attribute Name  - IPMP_EVENT_VERSION
186  *	Attribute Type  - SE_DATA_TYPE_UINT32
187  *	Attribute Value - <version>
188  *
189  *	Attribute Name  - IPMP_GROUP_SIGNATURE
190  *	Attribute Type  - SE_DATA_TYPE_UINT64
191  *	Attribute Value - <group-signature>
192  *
193  *	Attribute Name  - IPMP_IF_NAME
194  *	Attribute Type  - SE_DATA_TYPE_STRING
195  *	Attribute Value - <if-name>
196  *
197  *	Attribute Name  - IPMP_IF_STATE
198  *	Attribute Type  - SE_DATA_TYPE_UINT32
199  *	Attribute Value - <if-state>
200  *
201  *	Attribute Name  - IPMP_IF_TYPE
202  *	Attribute Type  - SE_DATA_TYPE_UINT32
203  *	Attribute Value - <if-type>
204  */
205 
206 #define	IPMP_PROBE_ID			"ipmp_probe_id"
207 #define	IPMP_PROBE_STATE		"ipmp_probe_state"
208 #define	IPMP_PROBE_START_TIME		"ipmp_probe_start_time"
209 #define	IPMP_PROBE_SENT_TIME		"ipmp_probe_sent_time"
210 #define	IPMP_PROBE_ACKRECV_TIME		"ipmp_probe_ackrecv_time"
211 #define	IPMP_PROBE_ACKPROC_TIME		"ipmp_probe_ackproc_time"
212 #define	IPMP_PROBE_TARGET		"ipmp_probe_target"
213 #define	IPMP_PROBE_TARGET_RTTAVG	"ipmp_probe_target_rttavg"
214 #define	IPMP_PROBE_TARGET_RTTDEV	"ipmp_probe_target_rttdev"
215 
216 typedef enum {
217 	IPMP_PROBE_SENT,	/* the probe has been sent */
218 	IPMP_PROBE_ACKED,	/* the probe has been acked */
219 	IPMP_PROBE_LOST		/* the probe has been lost */
220 } ipmp_probe_state_t;
221 
222 /*
223  * Event type EC_IPMP/ESC_IPMP_PROBE_STATE event schema
224  *
225  *	Event Class     - EC_IPMP
226  *	Event Sub-Class - ESC_IPMP_PROBE_STATE
227  *	Event Vendor	- com.sun
228  *	Event Publisher - in.mpathd
229  *
230  *	Attribute Name  - IPMP_PROBE_ID
231  *	Attribute Type  - SE_DATA_TYPE_UINT32
232  *	Attribute Value - <probe-id>
233  *
234  *	Attribute Name  - IPMP_EVENT_VERSION
235  *	Attribute Type  - SE_DATA_TYPE_UINT32
236  *	Attribute Value - <version>
237  *
238  *	Attribute Name  - IPMP_IF_NAME
239  *	Attribute Type  - SE_DATA_TYPE_STRING
240  *	Attribute Value - <if-name>
241  *
242  *	Attribute Name  - IPMP_PROBE_STATE
243  *	Attribute Type  - SE_DATA_TYPE_UINT32
244  *	Attribute Value - <probe-state>
245  *
246  *	Attribute Name  - IPMP_PROBE_START_TIME
247  *	Attribute Type  - SE_DATA_TYPE_TIME
248  *	Attribute Value - <probe-start-time>
249  *
250  *	Attribute Name  - IPMP_PROBE_SENT_TIME
251  *	Attribute Type  - SE_DATA_TYPE_TIME
252  *	Attribute Value - <probe-sent-time>
253  *
254  *	Attribute Name  - IPMP_PROBE_ACKRECV_TIME
255  *	Attribute Type  - SE_DATA_TYPE_TIME
256  *	Attribute Value - <probe-ackrecv-time>
257  *
258  *	Attribute Name  - IPMP_PROBE_ACKPROC_TIME
259  *	Attribute Type  - SE_DATA_TYPE_TIME
260  *	Attribute Value - <probe-ackproc-time>
261  *
262  *	Attribute Name  - IPMP_PROBE_TARGET
263  *	Attribute Type  - SE_DATA_TYPE_BYTES
264  *	Attribute Value - <probe-target-ip>
265  *
266  *	Attribute Name  - IPMP_PROBE_TARGET_RTTAVG
267  *	Attribute Type  - SE_DATA_TYPE_UINT32
268  *	Attribute Value - <probe-target-rttavg>
269  *
270  *	Attribute Name  - IPMP_PROBE_TARGET_RTTDEV
271  *	Attribute Type  - SE_DATA_TYPE_UINT32
272  *	Attribute Value - <probe-target-rttdev>
273  */
274 
275 #ifdef __cplusplus
276 }
277 #endif
278 
279 #endif /* _SYS_SYSEVENT_IPMP_H */
280