xref: /titanic_50/usr/src/cmd/fm/modules/common/event-transport/etm_proto.h (revision 25cf1a301a396c38e8adf52c15f537b80d2483f7)
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 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * FMA ETM-to-ETM Protocol header
29  *
30  * const/type defns for protocol used between two event transport
31  * modules (ETMs)
32  */
33 
34 #ifndef _ETM_PROTO_H
35 #define	_ETM_PROTO_H
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include <sys/types.h>
44 
45 #define	ETM_DELIM	"\177ETM"	/* Start of header delimiter */
46 #define	ETM_DELIMLEN	4		/* Length of header deimiter */
47 
48 typedef struct etm_proto_header {
49 	char hdr_delim[ETM_DELIMLEN];	/* Start of header delimiter */
50 	uint8_t hdr_ver;		/* ETM protocol version */
51 	uint8_t hdr_type;		/* Header type */
52 	uint8_t hdr_pad1;		/* reserved/padding/alignment */
53 	uint8_t hdr_pad2;		/* reserved/padding/alignment */
54 	uint32_t hdr_msglen;		/* Length of following message */
55 } etm_proto_hdr_t;
56 
57 typedef enum etm_proto_header_type {
58 	ETM_HDR_TYPE_TOO_LOW = 0,	/* Range check place holder */
59 	ETM_HDR_MSG,			/* FMA event to follow */
60 	ETM_HDR_S_RESTART,		/* Server re-start indication */
61 	ETM_HDR_C_HELLO,		/* Client startup indication */
62 	ETM_HDR_S_HELLO,		/* Server response to C_HELLO */
63 	ETM_HDR_ACK,			/* Acknowledgement */
64 	ETM_HDR_NAK,			/* Negative acknowledgement */
65 	ETM_HDR_SHUTDOWN,		/* Notify remote ETM of shutdown */
66 	ETM_HDR_TYPE_TOO_HIGH		/* Range check place holder */
67 } etm_proto_hdr_type_t;
68 
69 #define	ETM_HDRLEN sizeof (etm_proto_hdr_t)
70 #define	ETM_PROTO_V1 1
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* _ETM_PROTO_H */
77