xref: /illumos-gate/usr/src/uts/sun4u/opl/sys/oplkm_msg.h (revision 25cf1a30)
1*25cf1a30Sjl /*
2*25cf1a30Sjl  * CDDL HEADER START
3*25cf1a30Sjl  *
4*25cf1a30Sjl  * The contents of this file are subject to the terms of the
5*25cf1a30Sjl  * Common Development and Distribution License (the "License").
6*25cf1a30Sjl  * You may not use this file except in compliance with the License.
7*25cf1a30Sjl  *
8*25cf1a30Sjl  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*25cf1a30Sjl  * or http://www.opensolaris.org/os/licensing.
10*25cf1a30Sjl  * See the License for the specific language governing permissions
11*25cf1a30Sjl  * and limitations under the License.
12*25cf1a30Sjl  *
13*25cf1a30Sjl  * When distributing Covered Code, include this CDDL HEADER in each
14*25cf1a30Sjl  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*25cf1a30Sjl  * If applicable, add the following below this CDDL HEADER, with the
16*25cf1a30Sjl  * fields enclosed by brackets "[]" replaced with your own identifying
17*25cf1a30Sjl  * information: Portions Copyright [yyyy] [name of copyright owner]
18*25cf1a30Sjl  *
19*25cf1a30Sjl  * CDDL HEADER END
20*25cf1a30Sjl  */
21*25cf1a30Sjl /*
22*25cf1a30Sjl  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*25cf1a30Sjl  * Use is subject to license terms.
24*25cf1a30Sjl  */
26*25cf1a30Sjl #ifndef	_SYS_OPLKM_MSG_H
27*25cf1a30Sjl #define	_SYS_OPLKM_MSG_H
29*25cf1a30Sjl #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*25cf1a30Sjl #ifdef	__cplusplus
32*25cf1a30Sjl extern "C" {
33*25cf1a30Sjl #endif
35*25cf1a30Sjl /*
36*25cf1a30Sjl  * This header file describes the format of the mailbox messages
37*25cf1a30Sjl  * exchanged between the OPL key management driver on a OPL Domain
38*25cf1a30Sjl  * and the OPL Service Processor.
39*25cf1a30Sjl  */
42*25cf1a30Sjl /*
43*25cf1a30Sjl  * Request message header.
44*25cf1a30Sjl  */
45*25cf1a30Sjl typedef struct okm_req_hdr {
46*25cf1a30Sjl 	uint32_t krq_version;		/* Protocol version */
47*25cf1a30Sjl 	uint32_t krq_transid;		/* Transaction ID */
48*25cf1a30Sjl 	uint32_t krq_cmd;		/* Request */
49*25cf1a30Sjl 	uint32_t krq_reserved;		/* Reserved */
50*25cf1a30Sjl } okm_req_hdr_t;
52*25cf1a30Sjl /*
53*25cf1a30Sjl  * Reply message header.
54*25cf1a30Sjl  */
55*25cf1a30Sjl typedef struct okm_rep_hdr {
56*25cf1a30Sjl 	uint32_t krp_version;		/* protocol version */
57*25cf1a30Sjl 	uint32_t krp_transid;		/* Transaction ID */
58*25cf1a30Sjl 	uint32_t krp_status;		/* Status */
59*25cf1a30Sjl 	uint32_t krp_sadb_errno;	/* PF_KEY errno, if applicable */
60*25cf1a30Sjl 	uint32_t krp_sadb_version;	/* PF_KEY version, if applicable */
61*25cf1a30Sjl } okm_rep_hdr_t;
63*25cf1a30Sjl /*
64*25cf1a30Sjl  * Version of this current protocol.
65*25cf1a30Sjl  */
66*25cf1a30Sjl #define	OKM_PROTOCOL_VERSION	1
69*25cf1a30Sjl /*
70*25cf1a30Sjl  * Message types.
71*25cf1a30Sjl  */
72*25cf1a30Sjl #define	OKM_MSG_SADB		0x1	/* SADB message from SP */
74*25cf1a30Sjl /*
75*25cf1a30Sjl  * Values for sckm_msg_rep_hdr status field.
76*25cf1a30Sjl  */
77*25cf1a30Sjl #define	OKM_SUCCESS		0x0	/* Operation succeeded */
78*25cf1a30Sjl #define	OKM_ERR_VERSION		0x1	/* Unexpected version */
79*25cf1a30Sjl #define	OKM_ERR_SADB_PFKEY	0x2	/* PF_KEY returned an error */
80*25cf1a30Sjl #define	OKM_ERR_SADB_MSG	0x3	/* bad SADB msg detect by driver */
81*25cf1a30Sjl #define	OKM_ERR_DAEMON		0x4	/* Error communicating with daemon */
82*25cf1a30Sjl #define	OKM_ERR_BAD_CMD		0x5	/* unknown command */
83*25cf1a30Sjl #define	OKM_ERR_SADB_VERSION	0x6	/* bad SADB version */
84*25cf1a30Sjl #define	OKM_ERR_SADB_TIMEOUT	0x7	/* no response from key engine */
85*25cf1a30Sjl #define	OKM_ERR_SADB_BAD_TYPE	0x8	/* bad SADB msg type */
87*25cf1a30Sjl #ifdef	__cplusplus
88*25cf1a30Sjl }
89*25cf1a30Sjl #endif
91*25cf1a30Sjl #endif	/* _SYS_OPLKM_MSG_H */