25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER START
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * The contents of this file are subject to the terms of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Common Development and Distribution License (the "License").
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You may not use this file except in compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * or http://www.opensolaris.org/os/licensing.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * See the License for the specific language governing permissions
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * When distributing Covered Code, include this CDDL HEADER in each
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * If applicable, add the following below this CDDL HEADER, with the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * fields enclosed by brackets "[]" replaced with your own identifying
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * information: Portions Copyright [yyyy] [name of copyright owner]
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER END
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Use is subject to license terms.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * FMA ETM-to-ETM Protocol header
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * const/type defns for protocol used between two event transport
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * modules (ETMs)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifndef _ETM_PROTO_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define _ETM_PROTO_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#pragma ident "%Z%%M% %I% %E% SMI"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jlextern "C" {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#include <sys/types.h>
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define ETM_DELIM "\177ETM" /* Start of header delimiter */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define ETM_DELIMLEN 4 /* Length of header deimiter */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef struct etm_proto_header {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char hdr_delim[ETM_DELIMLEN]; /* Start of header delimiter */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint8_t hdr_ver; /* ETM protocol version */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint8_t hdr_type; /* Header type */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint8_t hdr_pad1; /* reserved/padding/alignment */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint8_t hdr_pad2; /* reserved/padding/alignment */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl uint32_t hdr_msglen; /* Length of following message */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl} etm_proto_hdr_t;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jltypedef enum etm_proto_header_type {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_TYPE_TOO_LOW = 0, /* Range check place holder */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_MSG, /* FMA event to follow */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_S_RESTART, /* Server re-start indication */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_C_HELLO, /* Client startup indication */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_S_HELLO, /* Server response to C_HELLO */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_ACK, /* Acknowledgement */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_NAK, /* Negative acknowledgement */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_SHUTDOWN, /* Notify remote ETM of shutdown */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl ETM_HDR_TYPE_TOO_HIGH /* Range check place holder */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl} etm_proto_hdr_type_t;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define ETM_HDRLEN sizeof (etm_proto_hdr_t)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define ETM_PROTO_V1 1
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jl}
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif /* _ETM_PROTO_H */