Module jcifs

Interface CommonServerMessageBlock

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

public interface CommonServerMessageBlock extends Message
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 Details

    • decode

      int decode(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException
      Decode message data from the given byte array
      Parameters:
      buffer - the byte array containing the message data
      bufferIndex - 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 array
      dstIndex - the starting index in the destination array
      Returns:
      message length
    • setDigest

      void setDigest(SMBSigningDigest digest)
      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

      Gets the response associated with this message.
      Returns:
      the associated response
    • setResponse

      void setResponse(CommonServerMessageBlockResponse msg)
      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.