View Javadoc
1   package org.metricshub.ipmi.core.coding.commands.session;
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  import java.util.Collection;
26  
27  import org.metricshub.ipmi.core.coding.commands.ResponseData;
28  import org.metricshub.ipmi.core.coding.protocol.AuthenticationType;
29  
30  /**
31   * A wrapper for Get Channel Authentication Capabilities command response
32   *
33   * @see GetChannelAuthenticationCapabilities
34   */
35  public class GetChannelAuthenticationCapabilitiesResponseData implements ResponseData {
36  	/**
37  	 * Channel number that the Authentication Capabilities is being returned for.
38  	 */
39  	private byte channelNumber;
40  
41  	/**
42  	 * Whether the channel supports IPMI v2.0 (RMCP+) connections, as reported in the extended capabilities.
43  	 */
44  	private boolean ipmiv20Support;
45  
46  	/**
47  	 * Authentication Types supported for requested privilege level.
48  	 */
49  	private Collection<AuthenticationType> authenticationTypes;
50  
51  	/**
52  	 * BMC key used for authentication. If false, then BMC uses user key.
53  	 */
54  	private boolean kgEnabled;
55  
56  	/**
57  	 * If Mer-message Authentication is enabled, packets to the BMC must be authenticated per Authentication Type used
58  	 * to activate the session, and User Level Authentication setting, following. Otherwise, Authentication Type 'None'
59  	 * accepted for packets to the BMC after the session has been activated.
60  	 */
61  	private boolean perMessageAuthenticationEnabled;
62  
63  	/**
64  	 * If User Level Authentication is enabled, User Level commands must be authenticated per Authentication Type used
65  	 * to activate the session. Otherwise, Authentication Type 'none' accepted for User Level commands to the BMC.
66  	 */
67  	private boolean userLevelAuthenticationEnabled;
68  
69  	/**
70  	 * One or more users are enabled that have non-null usernames
71  	 */
72  	private boolean nonNullUsernamesEnabled;
73  
74  	/**
75  	 * One or more users that have a null username, but non-null password, are presently enabled
76  	 */
77  	private boolean nullUsernamesEnabled;
78  
79  	/**
80  	 * A user that has a null username and null password is presently enabled
81  	 */
82  	private boolean anonymusLoginEnabled;
83  
84  	/**
85  	 * IANA Enterprise Number for OEM/Organization that specified the particular OEM Authentication Type for RMCP.
86  	 */
87  	private int oemId;
88  
89  	/**
90  	 * Additional OEM-specific information for the OEM Authentication Type for RMCP.
91  	 */
92  	private byte oemData;
93  
94  	public void setChannelNumber(byte channelNumber) {
95  		this.channelNumber = channelNumber;
96  	}
97  
98  	public byte getChannelNumber() {
99  		return channelNumber;
100 	}
101 
102 	public void setIpmiv20Support(boolean ipmiv20Support) {
103 		this.ipmiv20Support = ipmiv20Support;
104 	}
105 
106 	/**
107 	 * @return whether the channel supports IPMI v2.0 (RMCP+) connections, as reported in the extended capabilities
108 	 *         of the reply (false when the BMC does not report them)
109 	 */
110 	public boolean isIpmiv20Support() {
111 		return ipmiv20Support;
112 	}
113 
114 	public void setAuthenticationTypes(Collection<AuthenticationType> authenticationTypes) {
115 		this.authenticationTypes = authenticationTypes;
116 	}
117 
118 	public Collection<AuthenticationType> getAuthenticationTypes() {
119 		return authenticationTypes;
120 	}
121 
122 	public void setKgEnabled(boolean kgEnabled) {
123 		this.kgEnabled = kgEnabled;
124 	}
125 
126 	public boolean isKgEnabled() {
127 		return kgEnabled;
128 	}
129 
130 	public void setPerMessageAuthenticationEnabled(boolean perMessageAuthenticationEnabled) {
131 		this.perMessageAuthenticationEnabled = perMessageAuthenticationEnabled;
132 	}
133 
134 	public boolean isPerMessageAuthenticationEnabled() {
135 		return perMessageAuthenticationEnabled;
136 	}
137 
138 	public void setUserLevelAuthenticationEnabled(boolean userLevelAuthenticationEnabled) {
139 		this.userLevelAuthenticationEnabled = userLevelAuthenticationEnabled;
140 	}
141 
142 	public boolean isUserLevelAuthenticationEnabled() {
143 		return userLevelAuthenticationEnabled;
144 	}
145 
146 	public void setNonNullUsernamesEnabled(boolean nonNullUsernamesEnabled) {
147 		this.nonNullUsernamesEnabled = nonNullUsernamesEnabled;
148 	}
149 
150 	public boolean isNonNullUsernamesEnabled() {
151 		return nonNullUsernamesEnabled;
152 	}
153 
154 	public void setNullUsernamesEnabled(boolean nullUsernamesEnabled) {
155 		this.nullUsernamesEnabled = nullUsernamesEnabled;
156 	}
157 
158 	public boolean isNullUsernamesEnabled() {
159 		return nullUsernamesEnabled;
160 	}
161 
162 	public void setAnonymusLoginEnabled(boolean anonymusLoginEnabled) {
163 		this.anonymusLoginEnabled = anonymusLoginEnabled;
164 	}
165 
166 	public boolean isAnonymusLoginEnabled() {
167 		return anonymusLoginEnabled;
168 	}
169 
170 	public void setOemId(int oemId) {
171 		this.oemId = oemId;
172 	}
173 
174 	public int getOemId() {
175 		return oemId;
176 	}
177 
178 	public void setOemData(byte oemData) {
179 		this.oemData = oemData;
180 	}
181 
182 	public byte getOemData() {
183 		return oemData;
184 	}
185 }