java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request<Smb2NegotiateResponse>
org.codelibs.jcifs.smb.internal.smb2.nego.Smb2NegotiateRequest
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockRequest,Request<Smb2NegotiateResponse>,SmbNegotiationRequest,Message,Request
public class Smb2NegotiateRequest
extends ServerMessageBlock2Request<Smb2NegotiateResponse>
implements SmbNegotiationRequest
SMB2 Negotiate Protocol request message.
This command is used to negotiate the SMB protocol dialect
and security parameters between client and 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
ConstructorsConstructorDescriptionSmb2NegotiateRequest(Configuration config, int securityMode) Constructs an SMB2 negotiate request with the specified configuration and security mode. -
Method Summary
Modifier and TypeMethodDescriptionprotected Smb2NegotiateResponseCreate the response object for this requestintGets the client capabilities flags.byte[]Gets the client GUID used for identification.int[]Gets the array of SMB dialect versions supported by the client.Gets the negotiate contexts for SMB 3.1.1 negotiation.byte[]Gets the pre-authentication integrity salt for SMB 3.1.1.intGets the security mode flags for this negotiation request.booleanChecks whether SMB message signing is enforced by the client.protected intreadBytesWireFormat(byte[] buffer, int bufferIndex) Reads the message body from the wire format.intsize()Gets the size of this message.protected intwriteBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.Methods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request
allowChain, createCancel, encode, getCreditCost, getNext, getOverrideTimeout, getResponse, ignoreDisconnect, initResponse, isCancel, isResponseAsync, setNext, setOverrideTimeout, setRequestCredits, setResponse, setTid, splitMethods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
addFlags, chain, clearFlags, decode, decode, equals, getAsyncId, getCommand, getConfig, getCredit, getCreditCharge, getDigest, getErrorContextCount, getErrorData, getFlags, getHeaderStart, getLength, getMid, getNextCommandOffset, getRawPayload, getSessionId, getStatus, getTreeId, hashCode, haveResponse, isAsync, isErrorResponseStatus, isRetainPayload, pad8, readErrorResponse, readHeaderWireFormat, reset, retainPayload, setAsyncId, setCommand, setCredit, setDigest, setExtendedSecurity, setMid, setNext, setRawPayload, setReadSize, 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, getCommand, getDigest, getMid, reset, setCommand, setDigest, setExtendedSecurity, setMid, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Constructor Details
-
Smb2NegotiateRequest
Constructs an SMB2 negotiate request with the specified configuration and security mode.- Parameters:
config- the configuration for this requestsecurityMode- the security mode flags for negotiation
-
-
Method Details
-
getSecurityMode
public int getSecurityMode()Gets the security mode flags for this negotiation request.- Returns:
- the securityMode
-
isSigningEnforced
public boolean isSigningEnforced()Description copied from interface:SmbNegotiationRequestChecks whether SMB message signing is enforced by the client.- Specified by:
isSigningEnforcedin interfaceSmbNegotiationRequest- Returns:
- whether SMB signing is enforced
-
getCapabilities
public int getCapabilities()Gets the client capabilities flags.- Returns:
- the capabilities
-
getDialects
public int[] getDialects()Gets the array of SMB dialect versions supported by the client.- Returns:
- the dialects
-
getClientGuid
public byte[] getClientGuid()Gets the client GUID used for identification.- Returns:
- the clientGuid
-
getNegotiateContexts
Gets the negotiate contexts for SMB 3.1.1 negotiation.- Returns:
- the negotiateContexts
-
getPreauthSalt
public byte[] getPreauthSalt()Gets the pre-authentication integrity salt for SMB 3.1.1.- Returns:
- the preauthSalt
-
createResponse
protected Smb2NegotiateResponse createResponse(CIFSContext tc, ServerMessageBlock2Request<Smb2NegotiateResponse> req) Create the response object for this request- Specified by:
createResponsein classServerMessageBlock2Request<Smb2NegotiateResponse>- Parameters:
tc- the CIFS contextreq- the request object- Returns:
- the response object
- See Also:
-
size
public int size()Gets the size of this message.- Specified by:
sizein interfaceCommonServerMessageBlockRequest- Returns:
- the size of this message
- 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) 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
- See Also:
-