1 package org.metricshub.ipmi.core.coding.commands.payload;
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 org.metricshub.ipmi.core.coding.commands.ResponseData;
26 import org.metricshub.ipmi.core.common.TypeConverter;
27
28 /**
29 * Wrapper for Activate Payload response
30 */
31 public abstract class ActivatePayloadResponseData implements ResponseData {
32
33 /**
34 * Maximum size of a payload data field from remote console to BMC.
35 * Excludes size of confidentiality header and trailer fields, if any.
36 */
37 private int inboundPayloadSize;
38
39 /**
40 * Maximum size of a payload data field from BMC to remote console.
41 * Excludes size of confidentiality header and trailer fields, if any.
42 */
43 private int outboundPayloadSize;
44
45 /**
46 * UDP port number that payload can be transferred over.
47 */
48 private int payloadUdpPortNumber;
49
50 /**
51 * Payload VLAN number. FFFFh if VLAN addressing is not used.
52 */
53 private int payloadVlanNumber;
54
55 /**
56 * Set auxiliary information data
57 *
58 * @param auxilaryInformationData auxiliary information in bytes
59 */
60 public abstract void setAuxilaryInformationData(byte[] auxilaryInformationData);
61
62 /**
63 * Get inbound payload size
64 *
65 * @return int value
66 */
67 public int getInboundPayloadSize() {
68 return inboundPayloadSize;
69 }
70
71 /**
72 * Set inbound payload size
73 *
74 * @param inboundPayloadSizeData byte array of inbound payload size data
75 */
76 public void setInboundPayloadSize(byte[] inboundPayloadSizeData) {
77 this.inboundPayloadSize = TypeConverter.littleEndianWordToInt(inboundPayloadSizeData);
78 }
79
80 /**
81 * Get outbound payload size
82 *
83 * @return int value
84 */
85 public int getOutboundPayloadSize() {
86 return outboundPayloadSize;
87 }
88
89 /**
90 * Set outbound payload size
91 *
92 * @param outboundPayloadSizeData byte array of outbound payload size data
93 */
94 public void setOutboundPayloadSize(byte[] outboundPayloadSizeData) {
95 this.outboundPayloadSize = TypeConverter.littleEndianWordToInt(outboundPayloadSizeData);
96 }
97
98 /**
99 * Get payload udp port number
100 *
101 * @return Udp port number as int value
102 */
103 public int getPayloadUdpPortNumber() {
104 return payloadUdpPortNumber;
105 }
106
107 /**
108 * Set payload udp port number
109 *
110 * @param payloadUdpPortNumberData byte array of payload udp port number data
111 */
112 public void setPayloadUdpPortNumber(byte[] payloadUdpPortNumberData) {
113 this.payloadUdpPortNumber = TypeConverter.littleEndianWordToInt(payloadUdpPortNumberData);
114 }
115
116 /**
117 * Get payload vlan number
118 *
119 * @return vlan number data as int
120 */
121 public int getPayloadVlanNumber() {
122 return payloadVlanNumber;
123 }
124
125 /**
126 * Set payload vlan number
127 *
128 * @param payloadVlanNumberData byte array of payload vlan number data
129 */
130 public void setPayloadVlanNumber(byte[] payloadVlanNumberData) {
131 this.payloadVlanNumber = TypeConverter.littleEndianWordToInt(payloadVlanNumberData);
132 }
133
134 }