xref: /illumos-gate/usr/src/cmd/fm/modules/common/event-transport/etm_proto.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
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 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #include <sys/types.h>
42 
43 #define	ETM_DELIM	"\177ETM"	/* Start of header delimiter */
44 #define	ETM_DELIMLEN	4		/* Length of header deimiter */
45 
46 typedef struct etm_proto_header {
47 	char hdr_delim[ETM_DELIMLEN];	/* Start of header delimiter */
48 	uint8_t hdr_ver;		/* ETM protocol version */
49 	uint8_t hdr_type;		/* Header type */
50 	uint8_t hdr_pad1;		/* reserved/padding/alignment */
51 	uint8_t hdr_pad2;		/* reserved/padding/alignment */
52 	uint32_t hdr_msglen;		/* Length of following message */
53 } etm_proto_hdr_t;
54 
55 typedef enum etm_proto_header_type {
56 	ETM_HDR_TYPE_TOO_LOW = 0,	/* Range check place holder */
57 	ETM_HDR_MSG,			/* FMA event to follow */
58 	ETM_HDR_S_RESTART,		/* Server re-start indication */
59 	ETM_HDR_C_HELLO,		/* Client startup indication */
60 	ETM_HDR_S_HELLO,		/* Server response to C_HELLO */
61 	ETM_HDR_ACK,			/* Acknowledgement */
62 	ETM_HDR_NAK,			/* Negative acknowledgement */
63 	ETM_HDR_SHUTDOWN,		/* Notify remote ETM of shutdown */
64 	ETM_HDR_TYPE_TOO_HIGH		/* Range check place holder */
65 } etm_proto_hdr_type_t;
66 
67 #define	ETM_HDRLEN sizeof (etm_proto_hdr_t)
68 #define	ETM_PROTO_V1 1
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _ETM_PROTO_H */
75