Class SMB2CreateContext
java.lang.Object
com.hierynomus.mssmb2.messages.create.SMB2CreateContext
Generic, lease-agnostic SMB2_CREATE_CONTEXT TLV container ([MS-SMB2] 2.2.13.2).
This is the connective tissue every create context (lease, durable handle,
query-on-disk-id, ...) rides on. It treats name and data as
opaque byte arrays; higher layers (e.g. the RqLs lease context) encode
their typed payload into data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getData()byte[]getName()static List<SMB2CreateContext> Parses a chained list of create contexts starting at absolute buffer positionoffset, bounded bylengthbytes.static intwriteAll(SMBBuffer buffer, List<SMB2CreateContext> contexts) Serializes a chained list of create contexts at the buffer's current write position.
-
Constructor Details
-
SMB2CreateContext
public SMB2CreateContext(byte[] name, byte[] data)
-
-
Method Details
-
getName
public byte[] getName() -
getData
public byte[] getData() -
writeAll
Serializes a chained list of create contexts at the buffer's current write position. Handles the 16-byte header, 8-byte name/data alignment, inter-context 8-byte alignment andNext-offset backfill (Next = 0on the last context, with no trailing pad).- Returns:
- the total number of bytes written (0 for a null/empty list).
-
readAll
public static List<SMB2CreateContext> readAll(SMBBuffer buffer, int offset, int length) throws Buffer.BufferException Parses a chained list of create contexts starting at absolute buffer positionoffset, bounded bylengthbytes. TheNextchain is authoritative (Next == 0terminates); contexts are returned in encounter order. Seeks by the per-contextNameOffset/DataOffsetso any server ordering/padding is tolerated.- Throws:
Buffer.BufferException
-