Enum VersionAndCommand
- All Implemented Interfaces:
Serializable
,Comparable<VersionAndCommand>
The 13th byte is the protocol version and command. The highest four bits contains the version. As of this specification, it must always be sent as \x2 and the receiver must only accept this value.
The lowest four bits represents the command : - \x0 : LOCAL : the connection was established on purpose by the proxy without being relayed. The connection endpoints are the sender and the receiver. Such connections exist when the proxy sends health-checks to the server. The receiver must accept this connection as valid and must use the real connection endpoints and discard the protocol block including the family which is ignored. - \x1 : PROXY : the connection was established on behalf of another node, and reflects the original connection endpoints. The receiver must then use the information provided in the protocol block to get original the address. - other values are unassigned and must not be emitted by senders. Receivers must drop connections presenting unexpected values here.
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionAndCommand
extractValue
(org.slf4j.Logger logger, org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer) static VersionAndCommand
Returns the enum constant of this type with the specified name.static VersionAndCommand[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LOCAL
-
PROXY
-
-
Field Details
-
value
private final byte value
-
-
Constructor Details
-
VersionAndCommand
private VersionAndCommand(byte value)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
extractValue
public static VersionAndCommand extractValue(org.slf4j.Logger logger, org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer) throws ProxyProtocolException - Throws:
ProxyProtocolException
-