java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Response
org.codelibs.jcifs.smb.internal.smb2.tree.Smb2TreeConnectResponse
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockResponse,TreeConnectResponse,Message,Response
public class Smb2TreeConnectResponse
extends ServerMessageBlock2Response
implements TreeConnectResponse
SMB2 Tree Connect response message.
This response contains information about the connected
tree, including share type and capabilities.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intShare capability indicating asymmetric support.static final intShare capability indicating cluster support.static final intShare capability indicating continuous availability support.static final intShare capability indicating DFS support.static final intShare capability indicating scale-out support.static final byteShare type constant for disk shares (file shares).static final byteShare type constant for named pipe shares (IPC).static final byteShare type constant for printer shares.static final intShare flag indicating that access-based directory enumeration is enabled.static final intShare flag indicating that namespace caching is allowed on this share.static final intShare flag indicating automatic caching of documents.static final intShare flag indicating the share is in a DFS namespace.static final intShare flag indicating the share is a DFS root.static final intShare flag indicating that hash generation V1 is enabled for this share.static final intShare flag indicating that hash generation V2 is enabled for this share.static final intShare flag indicating that encryption is required for this share.static final intShare flag indicating that level 2 oplocks are forced on this share.static final intShare flag indicating that shared delete is forced for this share.static final intShare flag indicating manual caching of documents.static final intShare flag indicating that exclusive opens are restricted on this share.static final intShare flag indicating automatic caching of programs and documents.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
ConstructorsConstructorDescriptionSmb2TreeConnectResponse(Configuration config) Creates a new SMB2 tree connect response. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the capabilities of the connected share.intReturns the maximal access rights that the user has on this share.Returns the service type of the connected share (e.g., A: for disk, LPT1: for printer, IPC for named pipe).intReturns the flags describing characteristics of the connected share.byteReturns the type of the connected share (disk, pipe, or print).final intgetTid()Returns the tree identifier (TID) assigned to this tree connection.booleanIndicates whether the connected share is part of a Distributed File System (DFS) namespace.booleanIndicates whether the tree connection has been successfully established and has a valid tree ID.voidPrepares this response for the next request.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, 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, isErrorResponseStatus, 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, reset, setCommand, setDigest, setExtendedSecurity, setMid, setResponse, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlockResponse
getNextResponse, isAsyncMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayloadMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Response
clearReceived, error, exception, getErrorCode, getException, getExpiration, getGrantedCredits, getMid, isError, isReceived, isVerifyFailed, received, reset, setExpiration, setMid, verifySignature
-
Field Details
-
SMB2_SHARE_TYPE_DISK
public static final byte SMB2_SHARE_TYPE_DISKShare type constant for disk shares (file shares).- See Also:
-
SMB2_SHARE_TYPE_PIPE
public static final byte SMB2_SHARE_TYPE_PIPEShare type constant for named pipe shares (IPC).- See Also:
-
SMB2_SHARE_TYPE_PRINT
public static final byte SMB2_SHARE_TYPE_PRINTShare type constant for printer shares.- See Also:
-
SMB2_SHAREFLAG_MANUAL_CACHING
public static final int SMB2_SHAREFLAG_MANUAL_CACHINGShare flag indicating manual caching of documents.- See Also:
-
SMB2_SHAREFLAG_AUTO_CACHING
public static final int SMB2_SHAREFLAG_AUTO_CACHINGShare flag indicating automatic caching of documents.- See Also:
-
SMB2_SHAREFLAG_VDO_CACHING
public static final int SMB2_SHAREFLAG_VDO_CACHINGShare flag indicating automatic caching of programs and documents.- See Also:
-
SMB2_SHAREFLAG_DFS
public static final int SMB2_SHAREFLAG_DFSShare flag indicating the share is in a DFS namespace.- See Also:
-
SMB2_SHAREFLAG_DFS_ROOT
public static final int SMB2_SHAREFLAG_DFS_ROOTShare flag indicating the share is a DFS root.- See Also:
-
SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS
public static final int SMB2_SHAREFLAG_RESTRICT_EXCLUSIVE_OPENSShare flag indicating that exclusive opens are restricted on this share.- See Also:
-
SMB2_SHAREFLAG_FORCE_SHARED_DELETE
public static final int SMB2_SHAREFLAG_FORCE_SHARED_DELETEShare flag indicating that shared delete is forced for this share.- See Also:
-
SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHING
public static final int SMB2_SHAREFLAG_ALLOW_NAMESPACE_CACHINGShare flag indicating that namespace caching is allowed on this share.- See Also:
-
SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM
public static final int SMB2_SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUMShare flag indicating that access-based directory enumeration is enabled.- See Also:
-
SMB2_SHAREFLAG_FORCE_LEVEL2_OPLOCK
public static final int SMB2_SHAREFLAG_FORCE_LEVEL2_OPLOCKShare flag indicating that level 2 oplocks are forced on this share.- See Also:
-
SMB2_SHAREFLAG_ENABLE_HASH_V1
public static final int SMB2_SHAREFLAG_ENABLE_HASH_V1Share flag indicating that hash generation V1 is enabled for this share.- See Also:
-
SMB2_SHAREFLAG_ENABLE_HASH_V2
public static final int SMB2_SHAREFLAG_ENABLE_HASH_V2Share flag indicating that hash generation V2 is enabled for this share.- See Also:
-
SMB2_SHAREFLAG_ENCRYPT_DATA
public static final int SMB2_SHAREFLAG_ENCRYPT_DATAShare flag indicating that encryption is required for this share.- See Also:
-
SMB2_SHARE_CAP_DFS
public static final int SMB2_SHARE_CAP_DFSShare capability indicating DFS support.- See Also:
-
SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY
public static final int SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITYShare capability indicating continuous availability support.- See Also:
-
SMB2_SHARE_CAP_SCALEOUT
public static final int SMB2_SHARE_CAP_SCALEOUTShare capability indicating scale-out support.- See Also:
-
SMB2_SHARE_CAP_CLUSTER
public static final int SMB2_SHARE_CAP_CLUSTERShare capability indicating cluster support.- See Also:
-
SMB2_SHARE_CAP_ASYMMETRIC
public static final int SMB2_SHARE_CAP_ASYMMETRICShare capability indicating asymmetric support.- See Also:
-
-
Constructor Details
-
Smb2TreeConnectResponse
Creates a new SMB2 tree connect response.- Parameters:
config- the CIFS configuration
-
-
Method Details
-
prepare
Prepares this response for the next request.- Specified by:
preparein interfaceCommonServerMessageBlockResponse- Overrides:
preparein classServerMessageBlock2Response- Parameters:
next- the next request to prepare for- See Also:
-
getCapabilities
public int getCapabilities()Returns the capabilities of the connected share.- Returns:
- the capabilities
-
getMaximalAccess
public int getMaximalAccess()Returns the maximal access rights that the user has on this share.- Returns:
- the maximalAccess
-
getTid
public final int getTid()Returns the tree identifier (TID) assigned to this tree connection.- Specified by:
getTidin interfaceTreeConnectResponse- Returns:
- tree id
- See Also:
-
isValidTid
public boolean isValidTid()Description copied from interface:TreeConnectResponseIndicates whether the tree connection has been successfully established and has a valid tree ID.- Specified by:
isValidTidin interfaceTreeConnectResponse- Returns:
- whether the tree id is a valid one
-
getService
Returns the service type of the connected share (e.g., A: for disk, LPT1: for printer, IPC for named pipe).- Specified by:
getServicein interfaceTreeConnectResponse- Returns:
- service
- See Also:
-
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:
-
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 an error occurs during decoding- See Also:
-