Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data represents the data field in an SMB message Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/48b4bd5d-7206-4002-bde1-c34cf614b138
func NewData ¶
func NewData() *Data
NewData creates a new Data structure with an empty Bytes field and a ByteCount of 0
This function creates a new Data structure with an empty Bytes field and a ByteCount of 0.
func (*Data) Add ¶
Add appends bytes to the Data structure and updates the ByteCount
This function appends the given bytes to the existing bytes in the Data structure and updates the ByteCount to reflect the new length of the Bytes field.
func (*Data) GetBytes ¶
GetBytes returns the data for the message
This function returns the data for the message. It returns the Bytes field.
func (*Data) Marshal ¶
Marshal marshals the Data structure into a byte array
This function marshals the Data structure into a byte array. It creates a new byte array, appends the ByteCount and the Bytes field to it, and returns the resulting byte array.
func (*Data) SetData ¶
SetData sets the data for the message
This function sets the data for the message. It sets the Bytes field to the given data and updates the ByteCount to reflect the length of the given data.
func (*Data) Size ¶
Size returns the size of the Data structure
This function returns the size of the Data structure. It returns the ByteCount field.
func (*Data) Unmarshal ¶
Unmarshal unmarshals the Data structure from a byte array
This function unmarshals the Data structure from a byte array. It reads the ByteCount from the first two bytes of the input byte array, and then reads the corresponding number of bytes into the Bytes field. It returns the number of bytes read and an error if the input byte array is empty or too short to unmarshal the Data structure.