java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Response
org.codelibs.jcifs.smb.internal.smb2.ioctl.Smb2IoctlResponse
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockResponse,Message,Response
SMB2 IOCTL response message. This response contains the result of a device control
operation on the server.
- Author:
- mbechler
-
Field Summary
Fields inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
SMB2_CANCEL, SMB2_CHANGE_NOTIFY, SMB2_CLOSE, SMB2_CREATE, SMB2_ECHO, SMB2_FLAGS_ASYNC_COMMAND, SMB2_FLAGS_DFS_OPERATIONS, SMB2_FLAGS_PRIORITY_MASK, SMB2_FLAGS_RELATED_OPERATIONS, SMB2_FLAGS_REPLAY_OPERATION, SMB2_FLAGS_SERVER_TO_REDIR, SMB2_FLAGS_SIGNED, SMB2_FLUSH, SMB2_IOCTL, SMB2_LOCK, SMB2_LOGOFF, SMB2_NEGOTIATE, SMB2_OPLOCK_BREAK, SMB2_QUERY_DIRECTORY, SMB2_QUERY_INFO, SMB2_READ, SMB2_SESSION_SETUP, SMB2_SET_INFO, SMB2_TREE_CONNECT, SMB2_TREE_DISCONNECT, SMB2_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionSmb2IoctlResponse(Configuration config) Constructs an SMB2 IOCTL response with the given configuration.Smb2IoctlResponse(Configuration config, byte[] outputBuffer) Constructs an SMB2 IOCTL response with the given configuration and output buffer.Smb2IoctlResponse(Configuration config, byte[] outputBuffer, int ctlCode) Constructs an SMB2 IOCTL response with the given configuration, output buffer and control code. -
Method Summary
Modifier and TypeMethodDescriptionprotected DecodableCreates a decodable object for the input data based on the control code.protected DecodableCreates a decodable object for the output data based on the control code.intGets the IOCTL control code from the response.byte[]Gets the file identifier from the response.Gets the decoded input data from the response.intGets the IOCTL flags from the response.Gets the decoded output data from the response.<T extends Decodable>
TgetOutputData(Class<T> responseType) Gets the output data decoded as the specified response type.intGets the length of the output data.protected booleanChecks if this message has an error status.protected intreadBytesWireFormat(byte[] buffer, int bufferIndex) Reads the message body from the wire format.protected intwriteBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.Methods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Response
clearReceived, error, exception, getErrorCode, getException, getExpiration, getGrantedCredits, getNextResponse, haveResponse, isAsyncHandled, isError, isReceived, isSigned, isVerifyFailed, prepare, received, reset, setAsyncHandled, setExpiration, verifySignatureMethods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
addFlags, chain, clearFlags, decode, decode, encode, equals, getAsyncId, getCommand, getConfig, getCredit, getCreditCharge, getDigest, getErrorContextCount, getErrorData, getFlags, getHeaderStart, getLength, getMid, getNext, getNextCommandOffset, getRawPayload, getResponse, getSessionId, getStatus, getTreeId, hashCode, isAsync, isRetainPayload, pad8, readErrorResponse, readHeaderWireFormat, retainPayload, setAsyncId, setCommand, setCredit, setDigest, setExtendedSecurity, setMid, setNext, setRawPayload, setReadSize, setResponse, setSessionId, setTreeId, setUid, size8, size8, toString, writeHeaderWireFormatMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlock
decode, encode, getCommand, getDigest, getMid, getResponse, setCommand, setDigest, setExtendedSecurity, setMid, setResponse, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlockResponse
isAsyncMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Constructor Details
-
Smb2IoctlResponse
Constructs an SMB2 IOCTL response with the given configuration.- Parameters:
config- the configuration for this response
-
Smb2IoctlResponse
Constructs an SMB2 IOCTL response with the given configuration and output buffer.- Parameters:
config- the configuration for this responseoutputBuffer- the buffer to receive output data
-
Smb2IoctlResponse
Constructs an SMB2 IOCTL response with the given configuration, output buffer and control code.- Parameters:
config- the configuration for this responseoutputBuffer- the buffer to receive output datactlCode- the IOCTL control code
-
-
Method Details
-
getCtlCode
public int getCtlCode()Gets the IOCTL control code from the response.- Returns:
- the ctlCode
-
getIoctlFlags
public int getIoctlFlags()Gets the IOCTL flags from the response.- Returns:
- the ioctlFlags
-
getFileId
public byte[] getFileId()Gets the file identifier from the response.- Returns:
- the fileId
-
getOutputData
Gets the decoded output data from the response.- Returns:
- the outputData
-
getOutputLength
public int getOutputLength()Gets the length of the output data.- Returns:
- the outputLength
-
getInputData
Gets the decoded input data from the response.- Returns:
- the inputData
-
writeBytesWireFormat
protected int writeBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.- Specified by:
writeBytesWireFormatin classServerMessageBlock2- Parameters:
dst- the destination bufferdstIndex- the starting position in the buffer- Returns:
- number of bytes written
- See Also:
-
isErrorResponseStatus
protected boolean isErrorResponseStatus()Checks if this message has an error status.- Overrides:
isErrorResponseStatusin classServerMessageBlock2- Returns:
- true if the message has an error status
- See Also:
-
readBytesWireFormat
protected int readBytesWireFormat(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException Reads the message body from the wire format.- Specified by:
readBytesWireFormatin classServerMessageBlock2- Parameters:
buffer- the buffer to read frombufferIndex- the starting position in the buffer- Returns:
- number of bytes read
- Throws:
SMBProtocolDecodingException- if decoding fails- See Also:
-
createOutputDecodable
Creates a decodable object for the output data based on the control code.- Returns:
- the appropriate decodable object for the control code, or null if not recognized
-
createInputDecodable
Creates a decodable object for the input data based on the control code.- Returns:
- the appropriate decodable object for the control code, or null if not recognized
-
getOutputData
Gets the output data decoded as the specified response type.- Type Parameters:
T- the type of the decoded response data- Parameters:
responseType- the class of the expected response type- Returns:
- decoded data
- Throws:
SmbException- if decoding fails or the response type is incompatible
-