- All Superinterfaces:
Message
- All Known Subinterfaces:
CommonServerMessageBlockRequest,CommonServerMessageBlockResponse,NotifyResponse,Request<T>,RequestWithPath,SmbNegotiationResponse,TreeConnectResponse
- All Known Implementing Classes:
AndXServerMessageBlock,NetServerEnum2,NetServerEnum2Response,NetShareEnum,NetShareEnumResponse,NtTransNotifyChange,NtTransNotifyChangeResponse,NtTransQuerySecurityDesc,NtTransQuerySecurityDescResponse,ServerMessageBlock,ServerMessageBlock2,ServerMessageBlock2Request,ServerMessageBlock2Response,Smb2CancelRequest,Smb2ChangeNotifyRequest,Smb2ChangeNotifyResponse,Smb2CloseRequest,Smb2CloseResponse,Smb2CreateRequest,Smb2CreateResponse,Smb2EchoRequest,Smb2EchoResponse,Smb2FlushRequest,Smb2FlushResponse,Smb2IoctlRequest,Smb2IoctlResponse,Smb2LockRequest,Smb2LockResponse,Smb2LogoffRequest,Smb2LogoffResponse,Smb2NegotiateRequest,Smb2NegotiateResponse,Smb2OplockBreakNotification,Smb2QueryDirectoryRequest,Smb2QueryDirectoryResponse,Smb2QueryInfoRequest,Smb2QueryInfoResponse,Smb2ReadRequest,Smb2ReadResponse,Smb2SessionSetupRequest,Smb2SessionSetupResponse,Smb2SetInfoRequest,Smb2SetInfoResponse,Smb2TreeConnectRequest,Smb2TreeConnectResponse,Smb2TreeDisconnectRequest,Smb2TreeDisconnectResponse,Smb2WriteRequest,Smb2WriteResponse,SmbComBlankResponse,SmbComClose,SmbComCreateDirectory,SmbComDelete,SmbComDeleteDirectory,SmbComFindClose2,SmbComLockingAndX,SmbComLogoffAndX,SmbComNegotiate,SmbComNegotiateResponse,SmbComNtCancel,SmbComNTCreateAndX,SmbComNTCreateAndXResponse,SmbComNtTransaction,SmbComNtTransactionResponse,SmbComOpenAndX,SmbComOpenAndXResponse,SmbComQueryInformation,SmbComQueryInformationResponse,SmbComReadAndX,SmbComReadAndXResponse,SmbComRename,SmbComSeek,SmbComSeekResponse,SmbComSessionSetupAndX,SmbComSessionSetupAndXResponse,SmbComSetInformation,SmbComSetInformationResponse,SmbComTransaction,SmbComTransactionResponse,SmbComTreeConnectAndX,SmbComTreeConnectAndXResponse,SmbComTreeDisconnect,SmbComWrite,SmbComWriteAndX,SmbComWriteAndXResponse,SmbComWriteResponse,Trans2FindFirst2,Trans2FindFirst2Response,Trans2FindNext2,Trans2GetDfsReferral,Trans2GetDfsReferralResponse,Trans2QueryFSInformation,Trans2QueryFSInformationResponse,Trans2QueryPathInformation,Trans2QueryPathInformationResponse,Trans2SetFileInformation,Trans2SetFileInformationResponse,TransCallNamedPipe,TransCallNamedPipeResponse,TransPeekNamedPipe,TransPeekNamedPipeResponse,TransTransactNamedPipe,TransTransactNamedPipeResponse,TransWaitNamedPipe,TransWaitNamedPipeResponse
Common interface for all SMB message blocks in the jCIFS protocol implementation.
Provides core functionality for encoding/decoding SMB messages, handling message signing,
and managing message metadata such as IDs, commands, and authentication information.
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionintdecode(byte[] buffer, int bufferIndex) Decode message data from the given byte arrayintencode(byte[] dst, int dstIndex) Encodes this message into a byte array.intGets the SMB command.Gets the signing digest for this message.longgetMid()Gets the message ID.Gets the response associated with this message.voidreset()Resets this message to its initial state.voidsetCommand(int command) Sets the SMB command.voidsetDigest(SMBSigningDigest digest) Sets the signing digest for this message.voidsetExtendedSecurity(boolean extendedSecurity) Sets whether extended security is enabled.voidsetMid(long mid) Sets the message ID.voidSets the response for this message.voidsetSessionId(long sessionId) Sets the session ID.voidsetUid(int uid) Sets the user ID.Methods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Method Details
-
decode
Decode message data from the given byte array- Parameters:
buffer- the byte array containing the message databufferIndex- the starting index in the buffer- Returns:
- message length
- Throws:
SMBProtocolDecodingException- if decoding fails
-
encode
int encode(byte[] dst, int dstIndex) Encodes this message into a byte array.- Parameters:
dst- the destination byte arraydstIndex- the starting index in the destination array- Returns:
- message length
-
setDigest
Sets the signing digest for this message.- Parameters:
digest- the signing digest to set
-
getDigest
SMBSigningDigest getDigest()Gets the signing digest for this message.- Returns:
- the signing digest
-
getResponse
CommonServerMessageBlockResponse getResponse()Gets the response associated with this message.- Returns:
- the associated response
-
setResponse
Sets the response for this message.- Parameters:
msg- the response message to set
-
getMid
long getMid()Gets the message ID.- Returns:
- the message id
-
setMid
void setMid(long mid) Sets the message ID.- Parameters:
mid- the message ID to set
-
getCommand
int getCommand()Gets the SMB command.- Returns:
- the command
-
setCommand
void setCommand(int command) Sets the SMB command.- Parameters:
command- the command to set
-
setUid
void setUid(int uid) Sets the user ID.- Parameters:
uid- the user ID to set
-
setExtendedSecurity
void setExtendedSecurity(boolean extendedSecurity) Sets whether extended security is enabled.- Parameters:
extendedSecurity- true to enable extended security
-
setSessionId
void setSessionId(long sessionId) Sets the session ID.- Parameters:
sessionId- the session ID to set
-
reset
void reset()Resets this message to its initial state.
-