dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libipmi / common / ipmi_lan.h
blobb84e728b32474933945df13e020a9722f57a631c
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef IPMI_LAN_H
27 #define IPMI_LAN_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #pragma pack(1)
35 #define IPMI_CMD_GET_SESSION_CHALLENGE 0x39
36 #define IPMI_CMD_ACTIVATE_SESSION 0x3a
37 #define IPMI_CMD_SET_SESSION_PRIVLVL 0x3b
38 #define IPMI_CMD_CLOSE_SESSION 0x3c
40 #define IPMI_AUTHCODE_BUF_SIZE 20
42 * See section 22.13
44 #define IPMI_SESSION_AUTHTYPE_NONE 0x01
45 #define IPMI_SESSION_AUTHTYPE_MD2 0x02
46 #define IPMI_SESSION_AUTHTYPE_MD5 0x04
47 #define IPMI_SESSION_AUTHTYPE_PASSWORD 0x10
48 #define IPMI_SESSION_AUTHTYPE_OEM 0x20
50 #define IPMI_SESSION_PRIV_UNSPECIFIED 0x0
51 #define IPMI_SESSION_PRIV_CALLBACK 0x1
52 #define IPMI_SESSION_PRIV_USER 0x2
53 #define IPMI_SESSION_PRIV_OPERATOR 0x3
54 #define IPMI_SESSION_PRIV_ADMIN 0x4
55 #define IPMI_SESSION_PRIV_OEM 0x5
57 #define IPMI_BMC_SLAVE_ADDR 0x20
58 #define IPMI_BUF_SIZE 1024
59 #define IPMI_REMOTE_SWID 0x81
62 * The primary RMCP port
64 #define RMCP_UDP_PORT 623
67 * The ASF IANA Enterprise Number
69 #define ASF_RMCP_IANA 4542
72 * ASF Message Types for presence ping and pong
74 #define ASF_TYPE_PING 0x80
75 #define ASF_TYPE_PONG 0x40
78 * ASF message header
80 * See section 13.2.3
82 typedef struct asf_hdr {
83 uint32_t ah_iana;
84 uint8_t ah_msg_type;
85 uint8_t ah_msg_tag;
86 uint8_t __reserved1;
87 uint8_t ah_dlen;
88 } asf_hdr_t;
91 * RMCP message header
93 * See section 13.1.3
95 #define RMCP_VERSION_1 0x06
96 #define RMCP_CLASS_ASF 0x06
97 #define RMCP_CLASS_IPMI 0x07
98 #define RMCP_CLASS_OEM 0x08
100 typedef struct rmcp_hdr {
101 uint8_t rh_version;
102 uint8_t __reserved1;
103 uint8_t rh_seq;
104 DECL_BITFIELD3(
105 rh_msg_class:5,
106 __reserved2:2,
107 rh_msg_type:1);
108 } rmcp_hdr_t;
111 * IPMI Session Header
113 * The IPMI session header contains some optional payload fields that are only
114 * present in RMCP+ sessions or if the payload type is "OEM explicit". This
115 * structure is only intended to represent the session header for IPMI v1.5
116 * messages.
118 * See section 13.6
120 typedef struct v15_session_hdr {
121 uint8_t sh_authtype;
122 uint32_t sh_seq;
123 uint32_t sh_id;
124 } v15_session_hdr_t;
127 * IPMI Lan Message Header
129 * See section 13.8
131 typedef struct ipmi_msg_hdr {
132 uint8_t imh_addr1;
133 DECL_BITFIELD2(
134 imh_lun:2,
135 imh_netfn:6);
136 uint8_t imh_csum;
137 uint8_t imh_addr2;
138 uint8_t imh_seq;
139 uint8_t imh_cmd;
140 } ipmi_msg_hdr_t;
142 #pragma pack()
144 #ifdef __cplusplus
146 #endif
148 #endif /* IPMI_LAN_H */