java.lang.Object
org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
org.codelibs.jcifs.smb.internal.smb1.AndXServerMessageBlock
- All Implemented Interfaces:
CommonServerMessageBlock,CommonServerMessageBlockRequest,CommonServerMessageBlockResponse,RequestWithPath,Message,Request,Response
- Direct Known Subclasses:
SmbComLockingAndX,SmbComLogoffAndX,SmbComNTCreateAndX,SmbComNTCreateAndXResponse,SmbComOpenAndX,SmbComOpenAndXResponse,SmbComReadAndX,SmbComReadAndXResponse,SmbComSessionSetupAndX,SmbComSessionSetupAndXResponse,SmbComTreeConnectAndX,SmbComTreeConnectAndXResponse,SmbComWriteAndX,SmbComWriteAndXResponse
Base class for SMB1 AndX (chained) command messages.
This class extends ServerMessageBlock to support SMB1 command chaining, where multiple
related commands can be batched together in a single message for improved efficiency.
-
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
ConstructorsModifierConstructorDescriptionprotectedAndXServerMessageBlock(Configuration config) Constructs an AndX message block with configurationprotectedAndXServerMessageBlock(Configuration config, byte command) Constructs an AndX message block with configuration and commandprotectedAndXServerMessageBlock(Configuration config, byte command, String name, ServerMessageBlock andx) Constructs an AndX message block with full parametersprotectedAndXServerMessageBlock(Configuration config, byte command, ServerMessageBlock andx) Constructs an AndX message block with command and chained commandprotectedAndXServerMessageBlock(Configuration config, ServerMessageBlock andx) Constructs an AndX message block with configuration and chained command -
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.final ServerMessageBlockgetAndx()Gets the chained AndX commandprotected intgetBatchLimit(Configuration cfg, byte cmd) Gets the batch limit for chained commandsgetNext()Gets the next request in the chain.Gets the next response in the chain.protected intreadAndXWireFormat(byte[] buffer, int bufferIndex) Reads the AndX wire format from buffertoString()protected intwriteAndXWireFormat(byte[] dst, int dstIndex) Writes the AndX wire format to bufferMethods inherited from class org.codelibs.jcifs.smb.internal.smb1.ServerMessageBlock
addFlags2, allowChain, clearReceived, createCancel, equals, error, exception, getByteCount, getCommand, getConfig, getCreditCost, getDigest, getDomain, getErrorCode, getException, getExpiration, getFlags, getFlags2, getFullUNCPath, getGrantedCredits, getLength, getMid, getOverrideTimeout, getPath, getPid, getRawPayload, getResponse, getServer, getSignSeq, getTid, getUid, hashCode, ignoreDisconnect, isAsync, isCancel, isError, isExtendedSecurity, isForceUnicode, isReceived, isResolveInDfs, isResponse, isResponseAsync, isRetainPayload, isUseUnicode, isVerifyFailed, prepare, readBytesWireFormat, readHeaderWireFormat, readParameterWordsWireFormat, 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, writeBytesWireFormat, writeHeaderWireFormat, writeParameterWordsWireFormat, writeString, writeString
-
Constructor Details
-
AndXServerMessageBlock
protected AndXServerMessageBlock(Configuration config, byte command, String name, ServerMessageBlock andx) Constructs an AndX message block with full parameters- Parameters:
config- the configurationcommand- the SMB commandname- the name parameterandx- the chained command
-
AndXServerMessageBlock
Constructs an AndX message block with configuration and command- Parameters:
config- the configurationcommand- the SMB command
-
AndXServerMessageBlock
Constructs an AndX message block with command and chained command- Parameters:
config- the configurationcommand- the SMB commandandx- the chained command
-
AndXServerMessageBlock
Constructs an AndX message block with configuration- Parameters:
config- the configuration
-
AndXServerMessageBlock
Constructs an AndX message block with configuration and chained command- Parameters:
config- the configurationandx- the chained command
-
-
Method Details
-
getAndx
Gets the chained AndX command- Returns:
- the andx
-
getNext
Gets the next request in the chain.- Specified by:
getNextin interfaceCommonServerMessageBlockRequest- Specified by:
getNextin interfaceRequest- Overrides:
getNextin classServerMessageBlock- Returns:
- next chained message
- See Also:
-
getNextResponse
Gets the next response in the chain.- Specified by:
getNextResponsein interfaceCommonServerMessageBlockResponse- Specified by:
getNextResponsein interfaceResponse- Overrides:
getNextResponsein classServerMessageBlock- Returns:
- the next response
- See Also:
-
getBatchLimit
Gets the batch limit for chained commands- Parameters:
cfg- the configurationcmd- the command byte- Returns:
- the batch limit
-
encode
public int encode(byte[] dst, int dstIndex) Description copied from interface:CommonServerMessageBlockEncodes this message into a byte array.- Specified by:
encodein interfaceCommonServerMessageBlock- Overrides:
encodein classServerMessageBlock- Parameters:
dst- the destination byte arraydstIndex- the starting index in the destination array- Returns:
- message length
-
decode
Description copied from interface:CommonServerMessageBlockDecode message data from the given byte array- Specified by:
decodein interfaceCommonServerMessageBlock- Overrides:
decodein classServerMessageBlock- Parameters:
buffer- the byte array containing the message databufferIndex- the starting index in the buffer- Returns:
- message length
- Throws:
SMBProtocolDecodingException- if decoding fails
-
writeAndXWireFormat
protected int writeAndXWireFormat(byte[] dst, int dstIndex) Writes the AndX wire format to buffer- Parameters:
dst- the destination bufferdstIndex- the starting index- Returns:
- the number of bytes written
-
readAndXWireFormat
protected int readAndXWireFormat(byte[] buffer, int bufferIndex) throws SMBProtocolDecodingException Reads the AndX wire format from buffer- Parameters:
buffer- the buffer to read frombufferIndex- the starting index- Returns:
- the number of bytes read
- Throws:
SMBProtocolDecodingException- if decoding fails
-
toString
- Overrides:
toStringin classServerMessageBlock
-