Module jcifs

Class ServerMessageBlock

java.lang.Object
org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
All Implemented Interfaces:
CommonServerMessageBlock, CommonServerMessageBlockRequest, CommonServerMessageBlockResponse, RequestWithPath, Message, Request, Response
Direct Known Subclasses:
AndXServerMessageBlock, SmbComBlankResponse, SmbComClose, SmbComCreateDirectory, SmbComDelete, SmbComDeleteDirectory, SmbComFindClose2, SmbComNegotiate, SmbComNegotiateResponse, SmbComNtCancel, SmbComQueryInformation, SmbComQueryInformationResponse, SmbComRename, SmbComSeek, SmbComSeekResponse, SmbComSetInformation, SmbComSetInformationResponse, SmbComTransaction, SmbComTransactionResponse, SmbComTreeDisconnect, SmbComWrite, SmbComWriteResponse

public abstract class ServerMessageBlock extends Object implements CommonServerMessageBlockRequest, CommonServerMessageBlockResponse, RequestWithPath
Base class for all SMB1/CIFS protocol message blocks. This abstract class provides the fundamental structure and common functionality for SMB1 request and response messages, including header fields, message encoding/decoding, and wire format handling.
  • Field Details

    • SMB_COM_CREATE_DIRECTORY

      public static final byte SMB_COM_CREATE_DIRECTORY
      SMB command to create a directory.
      See Also:
    • SMB_COM_DELETE_DIRECTORY

      public static final byte SMB_COM_DELETE_DIRECTORY
      SMB command to delete a directory.
      See Also:
    • SMB_COM_CLOSE

      public static final byte SMB_COM_CLOSE
      SMB command to close a file handle.
      See Also:
    • SMB_COM_DELETE

      public static final byte SMB_COM_DELETE
      SMB command to delete a file.
      See Also:
    • SMB_COM_RENAME

      public static final byte SMB_COM_RENAME
      SMB command to rename a file.
      See Also:
    • SMB_COM_QUERY_INFORMATION

      public static final byte SMB_COM_QUERY_INFORMATION
      SMB command to query file information.
      See Also:
    • SMB_COM_SET_INFORMATION

      public static final byte SMB_COM_SET_INFORMATION
      SMB command to set file information.
      See Also:
    • SMB_COM_WRITE

      public static final byte SMB_COM_WRITE
      SMB command to write data to a file.
      See Also:
    • SMB_COM_CHECK_DIRECTORY

      public static final byte SMB_COM_CHECK_DIRECTORY
      SMB command to check if a directory exists.
      See Also:
    • SMB_COM_SEEK

      public static final byte SMB_COM_SEEK
      SMB command to seek within a file.
      See Also:
    • SMB_COM_LOCKING_ANDX

      public static final byte SMB_COM_LOCKING_ANDX
      SMB command for file locking operations.
      See Also:
    • SMB_COM_TRANSACTION

      public static final byte SMB_COM_TRANSACTION
      SMB command for transaction operations.
      See Also:
    • SMB_COM_TRANSACTION_SECONDARY

      public static final byte SMB_COM_TRANSACTION_SECONDARY
      SMB command for secondary transaction operations.
      See Also:
    • SMB_COM_MOVE

      public static final byte SMB_COM_MOVE
      SMB command to move a file.
      See Also:
    • SMB_COM_ECHO

      public static final byte SMB_COM_ECHO
      SMB command for echo/ping operations.
      See Also:
    • SMB_COM_OPEN_ANDX

      public static final byte SMB_COM_OPEN_ANDX
      SMB command to open a file with extended attributes.
      See Also:
    • SMB_COM_READ_ANDX

      public static final byte SMB_COM_READ_ANDX
      SMB command to read from a file with extended attributes.
      See Also:
    • SMB_COM_WRITE_ANDX

      public static final byte SMB_COM_WRITE_ANDX
      SMB command to write to a file with extended attributes.
      See Also:
    • SMB_COM_TRANSACTION2

      public static final byte SMB_COM_TRANSACTION2
      SMB command for extended transaction operations.
      See Also:
    • SMB_COM_FIND_CLOSE2

      public static final byte SMB_COM_FIND_CLOSE2
      SMB command to close a find operation.
      See Also:
    • SMB_COM_TREE_DISCONNECT

      public static final byte SMB_COM_TREE_DISCONNECT
      SMB command to disconnect from a tree share.
      See Also:
    • SMB_COM_NEGOTIATE

      public static final byte SMB_COM_NEGOTIATE
      SMB command to negotiate protocol dialect.
      See Also:
    • SMB_COM_SESSION_SETUP_ANDX

      public static final byte SMB_COM_SESSION_SETUP_ANDX
      SMB command to setup a session with extended attributes.
      See Also:
    • SMB_COM_LOGOFF_ANDX

      public static final byte SMB_COM_LOGOFF_ANDX
      SMB command to logoff from a session with extended attributes.
      See Also:
    • SMB_COM_TREE_CONNECT_ANDX

      public static final byte SMB_COM_TREE_CONNECT_ANDX
      SMB command to connect to a tree share with extended attributes.
      See Also:
    • SMB_COM_NT_TRANSACT

      public static final byte SMB_COM_NT_TRANSACT
      SMB command for NT transaction operations.
      See Also:
    • SMB_COM_NT_CANCEL

      public static final byte SMB_COM_NT_CANCEL
      SMB command to cancel an NT operation.
      See Also:
    • SMB_COM_NT_TRANSACT_SECONDARY

      public static final byte SMB_COM_NT_TRANSACT_SECONDARY
      SMB command for secondary NT transaction operations.
      See Also:
    • SMB_COM_NT_CREATE_ANDX

      public static final byte SMB_COM_NT_CREATE_ANDX
      SMB command to create or open a file with NT extended attributes.
      See Also:
    • headerStart

      protected int headerStart
      Starting position of the SMB header in the buffer.
    • length

      protected int length
      Total length of the SMB message.
    • batchLevel

      protected int batchLevel
      Batch level for batched requests.
    • errorCode

      protected int errorCode
      Error code returned by the server.
    • flags2

      protected int flags2
      Additional flags for the SMB message.
    • pid

      protected int pid
      Process identifier.
    • uid

      protected int uid
      User identifier for the authenticated session.
    • mid

      protected int mid
      Multiplex identifier for correlating requests and responses.
    • wordCount

      protected int wordCount
      Count of parameter words in the SMB message.
    • byteCount

      protected int byteCount
      Count of data bytes in the SMB message.
    • tid

      protected int tid
      Tree identifier for the connected share.
    • path

      protected String path
      Path associated with this SMB message.
    • digest

      protected SMB1SigningDigest digest
      Message signing digest for SMB1 security.
  • Constructor Details

    • ServerMessageBlock

      protected ServerMessageBlock(Configuration config)
      Creates a new SMB message with default command.
      Parameters:
      config - the configuration to use
    • ServerMessageBlock

      protected ServerMessageBlock(Configuration config, byte command)
      Creates a new SMB message with the specified command.
      Parameters:
      config - the configuration to use
      command - the SMB command code
    • ServerMessageBlock

      protected ServerMessageBlock(Configuration config, byte command, String path)
      Creates a new SMB message with the specified command and path.
      Parameters:
      config - the configuration to use
      command - the SMB command code
      path - the path for this SMB operation
  • Method Details

    • size

      public int size()
      Gets the size of this message.
      Specified by:
      size in interface CommonServerMessageBlockRequest
      Returns:
      the size of this message
      See Also:
    • isAsync

      public boolean isAsync()
      Checks if this is an asynchronous response.
      Specified by:
      isAsync in interface CommonServerMessageBlockResponse
      Returns:
      is an async response
      See Also:
    • isResponseAsync

      public boolean isResponseAsync()
      Checks if the request will be handled asynchronously.
      Specified by:
      isResponseAsync in interface CommonServerMessageBlockRequest
      Returns:
      request was handled asynchronously
      See Also:
    • getOverrideTimeout

      public final Integer getOverrideTimeout()
      Gets the custom response timeout for this request.
      Specified by:
      getOverrideTimeout in interface CommonServerMessageBlockRequest
      Returns:
      custom response timeout for this request
      See Also:
    • setOverrideTimeout

      public final void setOverrideTimeout(Integer overrideTimeout)
      Sets the timeout override for this message block
      Parameters:
      overrideTimeout - the overrideTimeout to set
    • getNext

      public ServerMessageBlock getNext()
      Gets the next request in the chain.
      Specified by:
      getNext in interface CommonServerMessageBlockRequest
      Specified by:
      getNext in interface Request
      Returns:
      next chained message
      See Also:
    • allowChain

      public boolean allowChain(CommonServerMessageBlockRequest next)
      Checks if chaining is allowed with the next request.
      Specified by:
      allowChain in interface CommonServerMessageBlockRequest
      Parameters:
      next - the next request in the chain
      Returns:
      whether to allow chaining
      See Also:
    • split

      Splits this request for processing.
      Specified by:
      split in interface CommonServerMessageBlockRequest
      Returns:
      the following message
      See Also:
    • createCancel

      public CommonServerMessageBlockRequest createCancel()
      Creates a cancel request for this request.
      Specified by:
      createCancel in interface CommonServerMessageBlockRequest
      Returns:
      create cancel request
      See Also:
    • getNextResponse

      public CommonServerMessageBlockResponse getNextResponse()
      Gets the next response in the chain.
      Specified by:
      getNextResponse in interface CommonServerMessageBlockResponse
      Specified by:
      getNextResponse in interface Response
      Returns:
      the next response
      See Also:
    • prepare

      public void prepare(CommonServerMessageBlockRequest next)
      Prepares this response for the next request.
      Specified by:
      prepare in interface CommonServerMessageBlockResponse
      Parameters:
      next - the next request to prepare for
      See Also:
    • getCreditCost

      public int getCreditCost()
      Gets the number of credits this request requires.
      Specified by:
      getCreditCost in interface Request
      Returns:
      number of credits this request requires
      See Also:
    • getGrantedCredits

      public int getGrantedCredits()
      Gets the number of credits granted by the server.
      Specified by:
      getGrantedCredits in interface Response
      Returns:
      number of credits granted by the server
      See Also:
    • setRequestCredits

      public void setRequestCredits(int credits)
      Sets the number of request credits.
      Specified by:
      setRequestCredits in interface Request
      Parameters:
      credits - the number of credits to set
      See Also:
    • getCommand

      public final int getCommand()
      Description copied from interface: CommonServerMessageBlock
      Gets the SMB command.
      Specified by:
      getCommand in interface CommonServerMessageBlock
      Returns:
      the command
    • setCommand

      public final void setCommand(int command)
      Description copied from interface: CommonServerMessageBlock
      Sets the SMB command.
      Specified by:
      setCommand in interface CommonServerMessageBlock
      Parameters:
      command - the command to set
    • getByteCount

      public final int getByteCount()
      Gets the byte count of this message block
      Returns:
      the byteCount
    • getLength

      public final int getLength()
      Gets the total length of this message block
      Returns:
      the length
    • isForceUnicode

      public boolean isForceUnicode()
      Checks if Unicode encoding is forced for this message
      Returns:
      the forceUnicode
    • getFlags

      public final byte getFlags()
      Gets the SMB message flags
      Returns:
      the flags
    • setFlags

      public final void setFlags(byte flags)
      Sets the SMB message flags
      Parameters:
      flags - the flags to set
    • getFlags2

      public final int getFlags2()
      Gets the SMB message flags2 field
      Returns:
      the flags2
    • setFlags2

      public final void setFlags2(int fl)
      Sets the SMB message flags2 field
      Parameters:
      fl - the flags2 to set
    • addFlags2

      public final void addFlags2(int fl)
      Adds flags to the flags2 field using bitwise OR
      Parameters:
      fl - flags to add
    • remFlags2

      public final void remFlags2(int fl)
      Removes flags from the flags2 field using bitwise AND NOT
      Parameters:
      fl - flags to remove
    • setResolveInDfs

      public void setResolveInDfs(boolean resolve)
      Sets whether to resolve this request path in DFS.
      Specified by:
      setResolveInDfs in interface RequestWithPath
      Parameters:
      resolve - true to enable DFS resolution
      See Also:
    • isResolveInDfs

      public boolean isResolveInDfs()
      Checks if this request should be resolved in DFS.
      Specified by:
      isResolveInDfs in interface RequestWithPath
      Returns:
      whether to resolve the request path in DFS
      See Also:
    • getErrorCode

      public final int getErrorCode()
      Description copied from interface: Response
      Gets the error status code.
      Specified by:
      getErrorCode in interface Response
      Returns:
      the errorCode
    • setErrorCode

      public final void setErrorCode(int errorCode)
      Sets the error code for this message block
      Parameters:
      errorCode - the errorCode to set
    • getPath

      public final String getPath()
      Description copied from interface: RequestWithPath
      Gets the path to the resource.
      Specified by:
      getPath in interface RequestWithPath
      Returns:
      the path
    • getFullUNCPath

      public String getFullUNCPath()
      Gets the full UNC path.
      Specified by:
      getFullUNCPath in interface RequestWithPath
      Returns:
      the full UNC path
      See Also:
    • getDomain

      public String getDomain()
      Gets the domain name.
      Specified by:
      getDomain in interface RequestWithPath
      Returns:
      the domain name
      See Also:
    • getServer

      public String getServer()
      Gets the server name.
      Specified by:
      getServer in interface RequestWithPath
      Returns:
      the server name
      See Also:
    • setFullUNCPath

      public void setFullUNCPath(String domain, String server, String fullPath)
      Sets the full UNC path components.
      Specified by:
      setFullUNCPath in interface RequestWithPath
      Parameters:
      domain - the domain name
      server - the server name
      fullPath - the full UNC path
      See Also:
    • setPath

      public final void setPath(String path)
      Description copied from interface: RequestWithPath
      Sets the path to the resource.
      Specified by:
      setPath in interface RequestWithPath
      Parameters:
      path - the path to set
    • getDigest

      public final SMB1SigningDigest getDigest()
      Description copied from interface: CommonServerMessageBlock
      Gets the signing digest for this message.
      Specified by:
      getDigest in interface CommonServerMessageBlock
      Returns:
      the digest
    • setDigest

      public final void setDigest(SMBSigningDigest digest)
      Description copied from interface: CommonServerMessageBlock
      Sets the signing digest for this message.
      Specified by:
      setDigest in interface CommonServerMessageBlock
      Parameters:
      digest - the digest to set
    • isExtendedSecurity

      public boolean isExtendedSecurity()
      Checks if extended security is enabled for this message
      Returns:
      the extendedSecurity
    • setSessionId

      public final void setSessionId(long sessionId)
      Description copied from interface: CommonServerMessageBlock
      Sets the session ID.
      Specified by:
      setSessionId in interface CommonServerMessageBlock
      Parameters:
      sessionId - the session ID to set
    • setExtendedSecurity

      public void setExtendedSecurity(boolean extendedSecurity)
      Description copied from interface: CommonServerMessageBlock
      Sets whether extended security is enabled.
      Specified by:
      setExtendedSecurity in interface CommonServerMessageBlock
      Parameters:
      extendedSecurity - the extendedSecurity to set
    • isUseUnicode

      public final boolean isUseUnicode()
      Checks if Unicode encoding is enabled for this message
      Returns:
      the useUnicode
    • setUseUnicode

      public final void setUseUnicode(boolean useUnicode)
      Sets whether to use Unicode encoding for this message
      Parameters:
      useUnicode - the useUnicode to set
    • isReceived

      public final boolean isReceived()
      Description copied from interface: Response
      Checks if the response has been received.
      Specified by:
      isReceived in interface Response
      Returns:
      the received
    • clearReceived

      public final void clearReceived()
      Description copied from interface: Response
      Unset received status
      Specified by:
      clearReceived in interface Response
    • received

      public void received()
      Set received status
      Specified by:
      received in interface Response
      See Also:
    • exception

      public void exception(Exception e)
      Sets an exception for this response.
      Specified by:
      exception in interface Response
      Parameters:
      e - the exception to set
      See Also:
    • error

      public void error()
      Set error status
      Specified by:
      error in interface Response
      See Also:
    • getResponse

      public ServerMessageBlock getResponse()
      Description copied from interface: CommonServerMessageBlock
      Gets the response associated with this message.
      Specified by:
      getResponse in interface CommonServerMessageBlock
      Specified by:
      getResponse in interface Request
      Returns:
      the response
    • ignoreDisconnect

      public CommonServerMessageBlock ignoreDisconnect()
      Returns a message block that ignores disconnection
      Returns:
      null
    • setResponse

      public final void setResponse(CommonServerMessageBlockResponse response)
      Description copied from interface: CommonServerMessageBlock
      Sets the response for this message.
      Specified by:
      setResponse in interface CommonServerMessageBlock
      Parameters:
      response - the response to set
    • isCancel

      public boolean isCancel()
      Checks if this is a cancel request.
      Specified by:
      isCancel in interface Request
      Returns:
      whether this is a cancel request
      See Also:
    • getMid

      public final long getMid()
      Description copied from interface: CommonServerMessageBlock
      Gets the message ID.
      Specified by:
      getMid in interface CommonServerMessageBlock
      Specified by:
      getMid in interface Response
      Returns:
      the mid
    • setMid

      public final void setMid(long mid)
      Description copied from interface: CommonServerMessageBlock
      Sets the message ID.
      Specified by:
      setMid in interface CommonServerMessageBlock
      Specified by:
      setMid in interface Response
      Parameters:
      mid - the mid to set
    • getTid

      public final int getTid()
      Gets the tree connection identifier
      Returns:
      the tid
    • setTid

      public final void setTid(int tid)
      Description copied from interface: CommonServerMessageBlockRequest
      Sets the tree ID.
      Specified by:
      setTid in interface CommonServerMessageBlockRequest
      Parameters:
      tid - the tid to set
    • getPid

      public final int getPid()
      Gets the process identifier
      Returns:
      the pid
    • setPid

      public final void setPid(int pid)
      Sets the process identifier
      Parameters:
      pid - the pid to set
    • getUid

      public final int getUid()
      Gets the user identifier
      Returns:
      the uid
    • setUid

      public final void setUid(int uid)
      Description copied from interface: CommonServerMessageBlock
      Sets the user ID.
      Specified by:
      setUid in interface CommonServerMessageBlock
      Parameters:
      uid - the uid to set
    • getSignSeq

      public int getSignSeq()
      Gets the signature sequence number
      Returns:
      the signSeq
    • setSignSeq

      public final void setSignSeq(int signSeq)
      Sets the signature sequence number
      Parameters:
      signSeq - the signSeq to set
    • isVerifyFailed

      public boolean isVerifyFailed()
      Description copied from interface: Response
      Checks if signature verification failed.
      Specified by:
      isVerifyFailed in interface Response
      Returns:
      the verifyFailed
    • getException

      public Exception getException()
      Gets the exception associated with this response.
      Specified by:
      getException in interface Response
      Returns:
      an exception linked to an error
      See Also:
    • isError

      public boolean isError()
      Checks if the response indicates an error.
      Specified by:
      isError in interface Response
      Returns:
      whether the response is an error
      See Also:
    • getRawPayload

      public byte[] getRawPayload()
      Gets the raw payload of the message.
      Specified by:
      getRawPayload in interface Message
      Returns:
      the raw response message
      See Also:
    • setRawPayload

      public void setRawPayload(byte[] rawPayload)
      Sets the raw payload of the message.
      Specified by:
      setRawPayload in interface Message
      Parameters:
      rawPayload - the raw message payload to set
      See Also:
    • isRetainPayload

      public boolean isRetainPayload()
      Determines whether to retain the message payload.
      Specified by:
      isRetainPayload in interface Message
      Returns:
      whether to retain the message payload
      See Also:
    • retainPayload

      public void retainPayload()
      Indicate that this message should retain it's raw payload
      Specified by:
      retainPayload in interface Message
      See Also:
    • getExpiration

      public Long getExpiration()
      Gets the expiration time for this response.
      Specified by:
      getExpiration in interface Response
      Returns:
      the message timeout
      See Also:
    • setExpiration

      public void setExpiration(Long exp)
      Sets the expiration time for this response.
      Specified by:
      setExpiration in interface Response
      Parameters:
      exp - the message timeout to set
      See Also:
    • getConfig

      protected final Configuration getConfig()
      Gets the configuration object for this message block
      Returns:
      the config
    • reset

      public void reset()
      Description copied from interface: CommonServerMessageBlock
      Resets this message to its initial state.
      Specified by:
      reset in interface CommonServerMessageBlock
      Specified by:
      reset in interface Response
    • verifySignature

      public boolean verifySignature(byte[] buffer, int i, int size)
      Verifies the signature of this response.
      Specified by:
      verifySignature in interface Response
      Parameters:
      buffer - the buffer containing the signature data
      i - the starting index in the buffer
      size - the size of the signature data
      Returns:
      whether signature verification is successful
      See Also:
    • writeString

      protected int writeString(String str, byte[] dst, int dstIndex)
      Writes a string to the destination buffer using the current encoding.
      Parameters:
      str - the string to write
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • writeString

      protected int writeString(String str, byte[] dst, int dstIndex, boolean unicode)
      Writes a string to the destination buffer with specified encoding.
      Parameters:
      str - the string to write
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      unicode - true to use Unicode encoding, false for OEM encoding
      Returns:
      the number of bytes written
    • readString

      public String readString(byte[] src, int srcIndex)
      Reads a null-terminated string from the buffer
      Parameters:
      src - source buffer
      srcIndex - starting index in the buffer
      Returns:
      read string
    • readString

      public String readString(byte[] src, int srcIndex, int maxLen, boolean unicode)
      Reads a null-terminated string from the buffer with specified encoding
      Parameters:
      src - source buffer
      srcIndex - starting index in the buffer
      maxLen - maximum length to read
      unicode - whether to use Unicode encoding
      Returns:
      read string
    • readString

      public String readString(byte[] src, int srcIndex, int srcEnd, int maxLen, boolean unicode)
      Reads a null-terminated string from the buffer with bounds checking
      Parameters:
      src - source buffer
      srcIndex - starting index in the buffer
      srcEnd - ending index boundary
      maxLen - maximum length to read
      unicode - whether to use Unicode encoding
      Returns:
      read string
    • stringWireLength

      public int stringWireLength(String str, int offset)
      Calculates the wire format length of a string
      Parameters:
      str - string to measure
      offset - current buffer offset for alignment calculation
      Returns:
      string length
    • readStringLength

      protected int readStringLength(byte[] src, int srcIndex, int max)
      Calculates the length of a null-terminated string in the buffer.
      Parameters:
      src - the source buffer
      srcIndex - the starting offset in the buffer
      max - the maximum number of bytes to scan
      Returns:
      the length of the string in bytes
    • encode

      public int encode(byte[] dst, int dstIndex)
      Description copied from interface: CommonServerMessageBlock
      Encodes this message into a byte array.
      Specified by:
      encode in interface CommonServerMessageBlock
      Parameters:
      dst - the destination byte array
      dstIndex - the starting index in the destination array
      Returns:
      message length
    • decode

      public int decode(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException
      Description copied from interface: CommonServerMessageBlock
      Decode message data from the given byte array
      Specified by:
      decode in interface CommonServerMessageBlock
      Parameters:
      buffer - the byte array containing the message data
      bufferIndex - the starting index in the buffer
      Returns:
      message length
      Throws:
      SMBProtocolDecodingException - if decoding fails
    • writeHeaderWireFormat

      protected int writeHeaderWireFormat(byte[] dst, int dstIndex)
      Writes the SMB header to the wire format.
      Parameters:
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • readHeaderWireFormat

      protected int readHeaderWireFormat(byte[] buffer, int bufferIndex)
      Reads the SMB header from the wire format.
      Parameters:
      buffer - the buffer containing the message data
      bufferIndex - the starting offset in the buffer
      Returns:
      the number of bytes read
    • isResponse

      protected boolean isResponse()
      Checks if this message is a response.
      Returns:
      true if this is a response message, false if it's a request
    • writeParameterWordsWireFormat

      protected abstract int writeParameterWordsWireFormat(byte[] dst, int dstIndex)
      Writes the parameter words portion of the SMB message to the wire format.
      Parameters:
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • writeBytesWireFormat

      protected abstract int writeBytesWireFormat(byte[] dst, int dstIndex)
      Writes the data bytes portion of the SMB message to the wire format.
      Parameters:
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • readParameterWordsWireFormat

      protected abstract int readParameterWordsWireFormat(byte[] buffer, int bufferIndex)
      Reads the parameter words portion of the SMB message from the wire format.
      Parameters:
      buffer - the buffer containing the message data
      bufferIndex - the starting offset in the buffer
      Returns:
      the number of bytes read
    • readBytesWireFormat

      protected abstract int readBytesWireFormat(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException
      Reads the data bytes portion of the SMB message from the wire format.
      Parameters:
      buffer - the buffer containing the message data
      bufferIndex - the starting offset in the buffer
      Returns:
      the number of bytes read
      Throws:
      SMBProtocolDecodingException - if the data cannot be decoded
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object