xref: /illumos-gate/usr/src/cmd/fm/modules/common/event-transport/etm_proto.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
1*25cf1a30Sjl139090 /*
2*25cf1a30Sjl139090  * CDDL HEADER START
3*25cf1a30Sjl139090  *
4*25cf1a30Sjl139090  * The contents of this file are subject to the terms of the
5*25cf1a30Sjl139090  * Common Development and Distribution License (the "License").
6*25cf1a30Sjl139090  * You may not use this file except in compliance with the License.
7*25cf1a30Sjl139090  *
8*25cf1a30Sjl139090  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*25cf1a30Sjl139090  * or http://www.opensolaris.org/os/licensing.
10*25cf1a30Sjl139090  * See the License for the specific language governing permissions
11*25cf1a30Sjl139090  * and limitations under the License.
12*25cf1a30Sjl139090  *
13*25cf1a30Sjl139090  * When distributing Covered Code, include this CDDL HEADER in each
14*25cf1a30Sjl139090  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*25cf1a30Sjl139090  * If applicable, add the following below this CDDL HEADER, with the
16*25cf1a30Sjl139090  * fields enclosed by brackets "[]" replaced with your own identifying
17*25cf1a30Sjl139090  * information: Portions Copyright [yyyy] [name of copyright owner]
18*25cf1a30Sjl139090  *
19*25cf1a30Sjl139090  * CDDL HEADER END
20*25cf1a30Sjl139090  */
21*25cf1a30Sjl139090 
22*25cf1a30Sjl139090 /*
23*25cf1a30Sjl139090  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*25cf1a30Sjl139090  * Use is subject to license terms.
25*25cf1a30Sjl139090  */
26*25cf1a30Sjl139090 
27*25cf1a30Sjl139090 /*
28*25cf1a30Sjl139090  * FMA ETM-to-ETM Protocol header
29*25cf1a30Sjl139090  *
30*25cf1a30Sjl139090  * const/type defns for protocol used between two event transport
31*25cf1a30Sjl139090  * modules (ETMs)
32*25cf1a30Sjl139090  */
33*25cf1a30Sjl139090 
34*25cf1a30Sjl139090 #ifndef _ETM_PROTO_H
35*25cf1a30Sjl139090 #define	_ETM_PROTO_H
36*25cf1a30Sjl139090 
37*25cf1a30Sjl139090 #ifdef __cplusplus
38*25cf1a30Sjl139090 extern "C" {
39*25cf1a30Sjl139090 #endif
40*25cf1a30Sjl139090 
41*25cf1a30Sjl139090 #include <sys/types.h>
42*25cf1a30Sjl139090 
43*25cf1a30Sjl139090 #define	ETM_DELIM	"\177ETM"	/* Start of header delimiter */
44*25cf1a30Sjl139090 #define	ETM_DELIMLEN	4		/* Length of header deimiter */
45*25cf1a30Sjl139090 
46*25cf1a30Sjl139090 typedef struct etm_proto_header {
47*25cf1a30Sjl139090 	char hdr_delim[ETM_DELIMLEN];	/* Start of header delimiter */
48*25cf1a30Sjl139090 	uint8_t hdr_ver;		/* ETM protocol version */
49*25cf1a30Sjl139090 	uint8_t hdr_type;		/* Header type */
50*25cf1a30Sjl139090 	uint8_t hdr_pad1;		/* reserved/padding/alignment */
51*25cf1a30Sjl139090 	uint8_t hdr_pad2;		/* reserved/padding/alignment */
52*25cf1a30Sjl139090 	uint32_t hdr_msglen;		/* Length of following message */
53*25cf1a30Sjl139090 } etm_proto_hdr_t;
54*25cf1a30Sjl139090 
55*25cf1a30Sjl139090 typedef enum etm_proto_header_type {
56*25cf1a30Sjl139090 	ETM_HDR_TYPE_TOO_LOW = 0,	/* Range check place holder */
57*25cf1a30Sjl139090 	ETM_HDR_MSG,			/* FMA event to follow */
58*25cf1a30Sjl139090 	ETM_HDR_S_RESTART,		/* Server re-start indication */
59*25cf1a30Sjl139090 	ETM_HDR_C_HELLO,		/* Client startup indication */
60*25cf1a30Sjl139090 	ETM_HDR_S_HELLO,		/* Server response to C_HELLO */
61*25cf1a30Sjl139090 	ETM_HDR_ACK,			/* Acknowledgement */
62*25cf1a30Sjl139090 	ETM_HDR_NAK,			/* Negative acknowledgement */
63*25cf1a30Sjl139090 	ETM_HDR_SHUTDOWN,		/* Notify remote ETM of shutdown */
64*25cf1a30Sjl139090 	ETM_HDR_TYPE_TOO_HIGH		/* Range check place holder */
65*25cf1a30Sjl139090 } etm_proto_hdr_type_t;
66*25cf1a30Sjl139090 
67*25cf1a30Sjl139090 #define	ETM_HDRLEN sizeof (etm_proto_hdr_t)
68*25cf1a30Sjl139090 #define	ETM_PROTO_V1 1
69*25cf1a30Sjl139090 
70*25cf1a30Sjl139090 #ifdef __cplusplus
71*25cf1a30Sjl139090 }
72*25cf1a30Sjl139090 #endif
73*25cf1a30Sjl139090 
74*25cf1a30Sjl139090 #endif /* _ETM_PROTO_H */
75