Package jcifs.internal.smb2.nego
Class Smb2NegotiateResponse
- java.lang.Object
-
- jcifs.internal.smb2.ServerMessageBlock2
-
- jcifs.internal.smb2.ServerMessageBlock2Response
-
- jcifs.internal.smb2.nego.Smb2NegotiateResponse
-
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockResponse,SmbNegotiationResponse,Message,Response
public class Smb2NegotiateResponse extends ServerMessageBlock2Response implements SmbNegotiationResponse
- Author:
- mbechler
-
-
Field Summary
-
Fields inherited from class jcifs.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
Constructors Constructor Description Smb2NegotiateResponse(Configuration cfg)
-
Method Summary
-
Methods inherited from class jcifs.internal.smb2.ServerMessageBlock2Response
clearReceived, error, exception, getErrorCode, getException, getExpiration, getGrantedCredits, getNextResponse, haveResponse, isAsyncHandled, isError, isReceived, isSigned, isVerifyFailed, prepare, received, reset, setAsyncHandled, setExpiration, verifySignature
-
Methods inherited from class jcifs.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, writeHeaderWireFormat
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jcifs.internal.CommonServerMessageBlock
decode, encode, getCommand, getDigest, getMid, getResponse, reset, setCommand, setDigest, setExtendedSecurity, setMid, setResponse, setSessionId, setUid
-
Methods inherited from interface jcifs.internal.CommonServerMessageBlockResponse
isAsync
-
Methods inherited from interface jcifs.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Methods inherited from interface jcifs.util.transport.Response
clearReceived, error, exception, getErrorCode, getException, getExpiration, getGrantedCredits, getMid, isError, isReceived, isVerifyFailed, received, reset, setExpiration, setMid, verifySignature
-
-
-
-
Constructor Detail
-
Smb2NegotiateResponse
public Smb2NegotiateResponse(Configuration cfg)
- Parameters:
cfg-
-
-
Method Detail
-
getInitialCredits
public int getInitialCredits()
- Specified by:
getInitialCreditsin interfaceSmbNegotiationResponse- Returns:
- number of initial credits the server grants
- See Also:
SmbNegotiationResponse.getInitialCredits()
-
getDialectRevision
public int getDialectRevision()
- Returns:
- the dialectRevision
-
getServerGuid
public byte[] getServerGuid()
- Returns:
- the serverGuid
-
getSelectedDialect
public DialectVersion getSelectedDialect()
- Specified by:
getSelectedDialectin interfaceSmbNegotiationResponse- Returns:
- the selectedDialect
-
getSelectedCipher
public int getSelectedCipher()
- Returns:
- the selectedCipher
-
getSelectedPreauthHash
public int getSelectedPreauthHash()
- Returns:
- the selectedPreauthHash
-
getCapabilities
public final int getCapabilities()
- Returns:
- the server returned capabilities
-
getCommonCapabilities
public final int getCommonCapabilities()
- Returns:
- the common/negotiated capabilieis
-
getSecurityBlob
public byte[] getSecurityBlob()
- Returns:
- initial security blob
-
getMaxTransactSize
public int getMaxTransactSize()
- Returns:
- the maxTransactSize
-
getTransactionBufferSize
public int getTransactionBufferSize()
- Specified by:
getTransactionBufferSizein interfaceSmbNegotiationResponse- Returns:
- the transaction buffer size
- See Also:
SmbNegotiationResponse.getTransactionBufferSize()
-
getNegotiateContexts
public NegotiateContextResponse[] getNegotiateContexts()
- Returns:
- the negotiateContexts
-
getServerStartTime
public long getServerStartTime()
- Returns:
- the serverStartTime
-
getSecurityMode
public int getSecurityMode()
- Returns:
- the securityMode
-
haveCapabilitiy
public boolean haveCapabilitiy(int cap)
- Specified by:
haveCapabilitiyin interfaceSmbNegotiationResponse- Returns:
- whether capability is negotiated
- See Also:
SmbNegotiationResponse.haveCapabilitiy(int)
-
isDFSSupported
public boolean isDFSSupported()
- Specified by:
isDFSSupportedin interfaceSmbNegotiationResponse- Returns:
- whether the server supports DFS
- See Also:
SmbNegotiationResponse.isDFSSupported()
-
isEncryptionSupported
public boolean isEncryptionSupported()
- Returns:
- whether SMB encryption is supported by the server
-
canReuse
public boolean canReuse(CIFSContext tc, boolean forceSigning)
- Specified by:
canReusein interfaceSmbNegotiationResponse- Returns:
- whether a connection can be reused for this config
- See Also:
SmbNegotiationResponse.canReuse(jcifs.CIFSContext, boolean)
-
isValid
public boolean isValid(CIFSContext tc, SmbNegotiationRequest req)
- Specified by:
isValidin interfaceSmbNegotiationResponse- Returns:
- whether the protocol negotiation was successful
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Specified by:
getReceiveBufferSizein interfaceSmbNegotiationResponse- Returns:
- the receive buffer size
- See Also:
SmbNegotiationResponse.getReceiveBufferSize()
-
getSendBufferSize
public int getSendBufferSize()
- Specified by:
getSendBufferSizein interfaceSmbNegotiationResponse- Returns:
- the send buffer size
- See Also:
SmbNegotiationResponse.getSendBufferSize()
-
isSigningEnabled
public boolean isSigningEnabled()
- Specified by:
isSigningEnabledin interfaceSmbNegotiationResponse- Returns:
- whether the server has singing enabled
- See Also:
SmbNegotiationResponse.isSigningEnabled()
-
isSigningRequired
public boolean isSigningRequired()
- Specified by:
isSigningRequiredin interfaceSmbNegotiationResponse- Returns:
- whether the server requires signing
- See Also:
SmbNegotiationResponse.isSigningRequired()
-
isSigningNegotiated
public boolean isSigningNegotiated()
- Specified by:
isSigningNegotiatedin interfaceSmbNegotiationResponse- Returns:
- whether signing has been negotiated
- See Also:
SmbNegotiationResponse.isSigningNegotiated()
-
setupRequest
public void setupRequest(CommonServerMessageBlock request)
- Specified by:
setupRequestin interfaceSmbNegotiationResponse- See Also:
SmbNegotiationResponse.setupRequest(jcifs.internal.CommonServerMessageBlock)
-
setupResponse
public void setupResponse(Response resp)
- Specified by:
setupResponsein interfaceSmbNegotiationResponse- See Also:
SmbNegotiationResponse.setupResponse(jcifs.util.transport.Response)
-
readBytesWireFormat
protected int readBytesWireFormat(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException- Specified by:
readBytesWireFormatin classServerMessageBlock2- Throws:
SMBProtocolDecodingException
-
createContext
protected static NegotiateContextResponse createContext(int type)
- Parameters:
type-- Returns:
-
writeBytesWireFormat
protected int writeBytesWireFormat(byte[] dst, int dstIndex)- Specified by:
writeBytesWireFormatin classServerMessageBlock2- See Also:
ServerMessageBlock2.writeBytesWireFormat(byte[], int)
-
toString
public String toString()
- Overrides:
toStringin classServerMessageBlock2
-
-