public class SMB2Packet extends SMBPacket<SMB2Header>
| Modifier and Type | Field and Description |
|---|---|
static int |
SINGLE_CREDIT_PAYLOAD_SIZE |
protected int |
structureSize |
| Modifier | Constructor and Description |
|---|---|
protected |
SMB2Packet() |
protected |
SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType) |
protected |
SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType,
long sessionId) |
protected |
SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType,
long sessionId,
long treeId) |
| Modifier and Type | Method and Description |
|---|---|
SMBBuffer |
getBuffer()
The buffer from which this packet is read if it was a received packet
|
int |
getCreditsAssigned() |
SMB2Error |
getError() |
int |
getMaxPayloadSize()
Returns the maximum payload size of this packet.
|
int |
getMessageEndPos()
THe end position of this packet in the
getBuffer(). |
int |
getMessageStartPos()
The start position of this packet in the
getBuffer(). |
long |
getSequenceNumber() |
int |
getStructureSize() |
boolean |
isIntermediateAsyncResponse()
Check whether this packet is an intermediate ASYNC response
|
protected boolean |
isSuccess(long statusCode)
Callback to verify whether the status is a success status.
|
void |
read(SMBBuffer buffer) |
protected void |
readError(SMBBuffer buffer) |
protected void |
readMessage(SMBBuffer buffer)
Read the message, this is only called in case the response is a success response according to
#isSuccess(NtStatus) |
void |
setCreditsAssigned(int creditsAssigned) |
java.lang.String |
toString() |
void |
write(SMBBuffer buffer) |
protected void |
writeTo(SMBBuffer buffer)
Write the message fields into the buffer, as specified in the [MS-SMB2].pdf specification.
|
public static final int SINGLE_CREDIT_PAYLOAD_SIZE
protected int structureSize
protected SMB2Packet()
protected SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType)
protected SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType,
long sessionId)
protected SMB2Packet(int structureSize,
SMB2Dialect dialect,
SMB2MessageCommandCode messageType,
long sessionId,
long treeId)
public long getSequenceNumber()
public int getStructureSize()
public SMBBuffer getBuffer()
public int getMessageStartPos()
getBuffer(). Normally this is 0, except
when this packet was compounded.public int getMessageEndPos()
getBuffer(). Normally this is the last written position,
except when this packet was compounded.public void write(SMBBuffer buffer)
protected void writeTo(SMBBuffer buffer)
buffer - public final void read(SMBBuffer buffer) throws Buffer.BufferException
Buffer.BufferExceptionprotected void readError(SMBBuffer buffer) throws Buffer.BufferException
Buffer.BufferExceptionprotected void readMessage(SMBBuffer buffer) throws Buffer.BufferException
#isSuccess(NtStatus)buffer - Buffer.BufferExceptionprotected boolean isSuccess(long statusCode)
status - The status to verifytrue is NtStatus.isSuccess()public boolean isIntermediateAsyncResponse()
public int getMaxPayloadSize()
SINGLE_CREDIT_PAYLOAD_SIZE.
Can be overridden in subclasses to support multi-credit messages.public int getCreditsAssigned()
public void setCreditsAssigned(int creditsAssigned)
public SMB2Error getError()
public java.lang.String toString()
toString in class java.lang.Object