1 package org.metricshub.ipmi.core.coding.commands;
2
3 /*-
4 * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5 * IPMI Java Client
6 * ჻჻჻჻჻჻
7 * Copyright 2023 Verax Systems, MetricsHub
8 * ჻჻჻჻჻჻
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Lesser Public License for more details.
18 *
19 * You should have received a copy of the GNU General Lesser Public
20 * License along with this program. If not, see
21 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22 * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
23 */
24
25 /**
26 * The privilege level of a session (IPMI 2.0 section 6.8), declared from the lowest to the highest: Callback, User,
27 * Operator, Administrator. {@link #MaximumAvailable}, declared last, is not a level but a request for the highest
28 * level the account is allowed.
29 */
30 public enum PrivilegeLevel {
31 /**
32 * The lowest level: only the commands that initiate a callback. The client refuses it
33 * ({@link org.metricshub.ipmi.client.IpmiClient.Builder#privilege(PrivilegeLevel)}), as none of its operations
34 * works at this level.
35 */
36 Callback,
37 /**
38 * The level every session but a Callback one starts at (IPMI 2.0 section 22.18): the commands that read the BMC,
39 * such as the chassis status, the sensors, the FRUs and the SEL. On most BMCs, it is not enough for the sensors and
40 * FRUs of the controllers other than the BMC, which the BMC reaches with Send Message.
41 */
42 User,
43 /**
44 * The User commands and the commands that change the state of the system, such as Chassis Control and Chassis
45 * Identify, but not the configuration commands that change the behavior of the out-of-band interfaces. Most BMCs
46 * accept Send Message at this level, some at the Administrator level only.
47 */
48 Operator,
49 /**
50 * Every command, the configuration of the BMC included; Serial over LAN needs this level on most BMCs.
51 */
52 Administrator,
53 /**
54 * The highest level the account is allowed. {@code openSession()} of
55 * {@link org.metricshub.ipmi.core.api.sync.IpmiConnector} and
56 * {@link org.metricshub.ipmi.core.api.async.IpmiAsyncConnector} requests Administrator at Open Session and RAKP
57 * Message 1, then Operator, then User when the BMC refuses the role to the account, and sets the session to User
58 * with Set Session Privilege Level: the caller raises it when a command needs more, as
59 * {@link org.metricshub.ipmi.client.IpmiClient} and {@link org.metricshub.ipmi.core.api.sol.SerialOverLan} do.
60 * Encoded by a command itself, this value is role 0h: in Open Session and RAKP Message 1, the highest level that
61 * matches the proposed algorithms (IPMI 2.0 section 13.17); in Set Session Privilege Level, a request for the
62 * present level of the session, which stays unchanged.
63 */
64 MaximumAvailable
65 }