java.lang.Object
org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
org.codelibs.jcifs.smb.internal.smb1.com.SmbComNegotiateResponse
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockRequest,CommonServerMessageBlockResponse,RequestWithPath,SmbNegotiationResponse,Message,Request,Response
SMB1 Negotiate Protocol Response message.
This response contains information about the server's capabilities,
security mode, and supported protocol version.
-
Field Summary
Fields inherited from class org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
batchLevel, byteCount, digest, errorCode, flags2, headerStart, length, mid, path, pid, SMB_COM_CHECK_DIRECTORY, SMB_COM_CLOSE, SMB_COM_CREATE_DIRECTORY, SMB_COM_DELETE, SMB_COM_DELETE_DIRECTORY, SMB_COM_ECHO, SMB_COM_FIND_CLOSE2, SMB_COM_LOCKING_ANDX, SMB_COM_LOGOFF_ANDX, SMB_COM_MOVE, SMB_COM_NEGOTIATE, SMB_COM_NT_CANCEL, SMB_COM_NT_CREATE_ANDX, SMB_COM_NT_TRANSACT, SMB_COM_NT_TRANSACT_SECONDARY, SMB_COM_OPEN_ANDX, SMB_COM_QUERY_INFORMATION, SMB_COM_READ_ANDX, SMB_COM_RENAME, SMB_COM_SEEK, SMB_COM_SESSION_SETUP_ANDX, SMB_COM_SET_INFORMATION, SMB_COM_TRANSACTION, SMB_COM_TRANSACTION_SECONDARY, SMB_COM_TRANSACTION2, SMB_COM_TREE_CONNECT_ANDX, SMB_COM_TREE_DISCONNECT, SMB_COM_WRITE, SMB_COM_WRITE_ANDX, tid, uid, wordCount -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SMB1 negotiate response. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanReuse(CIFSContext tc, boolean forceSigning) Checks whether a connection can be reused for the given configuration.intReturns the index of the selected SMB dialect from the negotiation.intGets the number of initial credits granted by the server for SMB2.intReturns the server capabilities negotiated during the SMB handshake.intGets the negotiated flags2 value.intGets the negotiated multiplex count.intGets the negotiated send buffer size.intGets the negotiated session key.intGets the negotiated receive buffer size.Gets the SMB dialect version selected by the server.intGets the negotiated send buffer size.Gets the server data containing negotiated server capabilities and properties.intGets the negotiated maximum transaction buffer size.booleanhaveCapabilitiy(int cap) Checks whether a specific capability has been negotiated.booleanChecks whether the server supports Distributed File System (DFS).booleanChecks whether the server has SMB message signing enabled.booleanChecks whether SMB message signing has been successfully negotiated.booleanChecks whether the server requires SMB message signing.booleanisValid(CIFSContext ctx, SmbNegotiationRequest req) Check if the negotiation response is validprotected intreadBytesWireFormat(byte[] buffer, int bufferIndex) Reads the data bytes portion of the SMB message from the wire format.protected intreadParameterWordsWireFormat(byte[] buffer, int bufferIndex) Reads the parameter words portion of the SMB message from the wire format.voidsetupRequest(CommonServerMessageBlock request) Sets up the given request with negotiated parameters.voidsetupResponse(Response resp) Sets up the given response with negotiated parameters.toString()protected intwriteBytesWireFormat(byte[] dst, int dstIndex) Writes the data bytes portion of the SMB message to the wire format.protected intwriteParameterWordsWireFormat(byte[] dst, int dstIndex) Writes the parameter words portion of the SMB message to the wire format.Methods inherited from class org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
addFlags2, allowChain, clearReceived, createCancel, decode, encode, equals, error, exception, getByteCount, getCommand, getConfig, getCreditCost, getDigest, getDomain, getErrorCode, getException, getExpiration, getFlags, getFlags2, getFullUNCPath, getGrantedCredits, getLength, getMid, getNext, getNextResponse, getOverrideTimeout, getPath, getPid, getRawPayload, getResponse, getServer, getSignSeq, getTid, getUid, hashCode, ignoreDisconnect, isAsync, isCancel, isError, isExtendedSecurity, isForceUnicode, isReceived, isResolveInDfs, isResponse, isResponseAsync, isRetainPayload, isUseUnicode, isVerifyFailed, prepare, readHeaderWireFormat, readString, readString, readString, readStringLength, received, remFlags2, reset, retainPayload, setCommand, setDigest, setErrorCode, setExpiration, setExtendedSecurity, setFlags, setFlags2, setFullUNCPath, setMid, setOverrideTimeout, setPath, setPid, setRawPayload, setRequestCredits, setResolveInDfs, setResponse, setSessionId, setSignSeq, setTid, setUid, setUseUnicode, size, split, stringWireLength, verifySignature, writeHeaderWireFormat, writeString, writeStringMethods 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.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
-
Constructor Details
-
SmbComNegotiateResponse
Creates a new SMB1 negotiate response.- Parameters:
ctx- the CIFS context
-
-
Method Details
-
getSelectedDialect
Gets the SMB dialect version selected by the server.- Specified by:
getSelectedDialectin interfaceSmbNegotiationResponse- Returns:
- selected dialect
- See Also:
-
getTransactionBufferSize
public int getTransactionBufferSize()Gets the negotiated maximum transaction buffer size.- Specified by:
getTransactionBufferSizein interfaceSmbNegotiationResponse- Returns:
- the transaction buffer size
- See Also:
-
getInitialCredits
public int getInitialCredits()Gets the number of initial credits granted by the server for SMB2.- Specified by:
getInitialCreditsin interfaceSmbNegotiationResponse- Returns:
- number of initial credits the server grants
- See Also:
-
canReuse
Checks whether a connection can be reused for the given configuration.- Specified by:
canReusein interfaceSmbNegotiationResponse- Parameters:
tc- the CIFS context to check compatibility withforceSigning- whether signing is being forced- Returns:
- whether a connection can be reused for this config
- See Also:
-
getDialectIndex
public int getDialectIndex()Returns the index of the selected SMB dialect from the negotiation.- Returns:
- the dialectIndex
-
getNegotiatedCapabilities
public int getNegotiatedCapabilities()Returns the server capabilities negotiated during the SMB handshake.- Returns:
- the negotiated capabilities
-
getNegotiatedSendBufferSize
public int getNegotiatedSendBufferSize()Gets the negotiated send buffer size.- Returns:
- negotiated send buffer size
-
getNegotiatedMpxCount
public int getNegotiatedMpxCount()Gets the negotiated multiplex count.- Returns:
- negotiated multiplex count
-
getNegotiatedSessionKey
public int getNegotiatedSessionKey()Gets the negotiated session key.- Returns:
- negotiated session key
-
getReceiveBufferSize
public int getReceiveBufferSize()Gets the negotiated receive buffer size.- Specified by:
getReceiveBufferSizein interfaceSmbNegotiationResponse- Returns:
- the receive buffer size
- See Also:
-
getSendBufferSize
public int getSendBufferSize()Gets the negotiated send buffer size.- Specified by:
getSendBufferSizein interfaceSmbNegotiationResponse- Returns:
- the send buffer size
- See Also:
-
getNegotiatedFlags2
public int getNegotiatedFlags2()Gets the negotiated flags2 value.- Returns:
- negotiated flags2
-
haveCapabilitiy
public boolean haveCapabilitiy(int cap) Checks whether a specific capability has been negotiated.- Specified by:
haveCapabilitiyin interfaceSmbNegotiationResponse- Parameters:
cap- the capability flag to check- Returns:
- whether capability is negotiated
- See Also:
-
isDFSSupported
public boolean isDFSSupported()Checks whether the server supports Distributed File System (DFS).- Specified by:
isDFSSupportedin interfaceSmbNegotiationResponse- Returns:
- whether the server supports DFS
- See Also:
-
isSigningNegotiated
public boolean isSigningNegotiated()Checks whether SMB message signing has been successfully negotiated.- Specified by:
isSigningNegotiatedin interfaceSmbNegotiationResponse- Returns:
- whether signing has been negotiated
- See Also:
-
isValid
Description copied from interface:SmbNegotiationResponseCheck if the negotiation response is valid- Specified by:
isValidin interfaceSmbNegotiationResponse- Parameters:
ctx- the CIFS contextreq- the negotiation request- Returns:
- whether the protocol negotiation was successful
-
setupRequest
Sets up the given request with negotiated parameters.- Specified by:
setupRequestin interfaceSmbNegotiationResponse- Parameters:
request- the request to configure- See Also:
-
setupResponse
Sets up the given response with negotiated parameters.- Specified by:
setupResponsein interfaceSmbNegotiationResponse- Parameters:
resp- the response to configure- See Also:
-
isSigningEnabled
public boolean isSigningEnabled()Checks whether the server has SMB message signing enabled.- Specified by:
isSigningEnabledin interfaceSmbNegotiationResponse- Returns:
- whether the server has signing enabled
- See Also:
-
isSigningRequired
public boolean isSigningRequired()Checks whether the server requires SMB message signing.- Specified by:
isSigningRequiredin interfaceSmbNegotiationResponse- Returns:
- whether the server requires signing
- See Also:
-
getServerData
Gets the server data containing negotiated server capabilities and properties.- Returns:
- the server
-
writeParameterWordsWireFormat
protected int writeParameterWordsWireFormat(byte[] dst, int dstIndex) Description copied from class:ServerMessageBlockWrites the parameter words portion of the SMB message to the wire format.- Specified by:
writeParameterWordsWireFormatin classServerMessageBlock- Parameters:
dst- the destination bufferdstIndex- the starting offset in the buffer- Returns:
- the number of bytes written
-
writeBytesWireFormat
protected int writeBytesWireFormat(byte[] dst, int dstIndex) Description copied from class:ServerMessageBlockWrites the data bytes portion of the SMB message to the wire format.- Specified by:
writeBytesWireFormatin classServerMessageBlock- Parameters:
dst- the destination bufferdstIndex- the starting offset in the buffer- Returns:
- the number of bytes written
-
readParameterWordsWireFormat
protected int readParameterWordsWireFormat(byte[] buffer, int bufferIndex) Description copied from class:ServerMessageBlockReads the parameter words portion of the SMB message from the wire format.- Specified by:
readParameterWordsWireFormatin classServerMessageBlock- Parameters:
buffer- the buffer containing the message databufferIndex- the starting offset in the buffer- Returns:
- the number of bytes read
-
readBytesWireFormat
protected int readBytesWireFormat(byte[] buffer, int bufferIndex) Description copied from class:ServerMessageBlockReads the data bytes portion of the SMB message from the wire format.- Specified by:
readBytesWireFormatin classServerMessageBlock- Parameters:
buffer- the buffer containing the message databufferIndex- the starting offset in the buffer- Returns:
- the number of bytes read
-
toString
- Overrides:
toStringin classServerMessageBlock
-