commands

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRequestCommand

func CreateRequestCommand(commandCode codes.CommandCode) (command_interface.CommandInterface, error)

CreateRequestCommand creates a request command for the given command code.

func CreateResponseCommand

func CreateResponseCommand(commandCode codes.CommandCode) (command_interface.CommandInterface, error)

CreateResponseCommand creates a response command for the given command code.

Types

type CheckDirectoryRequest

type CheckDirectoryRequest struct {
	command_interface.Command

	// A null-terminated character string giving the pathname to be tested.
	DirectoryName types.SMB_STRING
}

CheckDirectoryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/dc566429-904b-4bf5-8158-d68f2370ae68

func NewCheckDirectoryRequest

func NewCheckDirectoryRequest() *CheckDirectoryRequest

NewCheckDirectoryRequest creates a new CheckDirectoryRequest structure

Returns: - A pointer to the new CheckDirectoryRequest structure

func (*CheckDirectoryRequest) Marshal

func (c *CheckDirectoryRequest) Marshal() ([]byte, error)

Marshal marshals the CheckDirectoryRequest structure into a byte array

Returns: - A byte array representing the CheckDirectoryRequest structure - An error if the marshaling fails

func (*CheckDirectoryRequest) Unmarshal

func (c *CheckDirectoryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CheckDirectoryResponse

type CheckDirectoryResponse struct {
	command_interface.Command
}

CheckDirectoryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/b99f80c3-fbfc-4f5b-95d5-67b62244de89

func NewCheckDirectoryResponse

func NewCheckDirectoryResponse() *CheckDirectoryResponse

NewCheckDirectoryResponse creates a new CheckDirectoryResponse structure

Returns: - A pointer to the new CheckDirectoryResponse structure

func (*CheckDirectoryResponse) Marshal

func (c *CheckDirectoryResponse) Marshal() ([]byte, error)

Marshal marshals the CheckDirectoryResponse structure into a byte array

Returns: - A byte array representing the CheckDirectoryResponse structure - An error if the marshaling fails

func (*CheckDirectoryResponse) Unmarshal

func (c *CheckDirectoryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ClosePrintFileRequest

type ClosePrintFileRequest struct {
	command_interface.Command

	// This field MUST be a valid FID created using the SMB_COM_OPEN_PRINT_FILE command.
	// Following successful execution of this command, this FID MUST be invalidated
	FID types.USHORT
}

ClosePrintFileRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/7712477c-4dad-481b-a82d-fa1caff56dc5

func NewClosePrintFileRequest

func NewClosePrintFileRequest() *ClosePrintFileRequest

NewClosePrintFileRequest creates a new ClosePrintFileRequest structure

Returns: - A pointer to the new ClosePrintFileRequest structure

func (*ClosePrintFileRequest) Marshal

func (c *ClosePrintFileRequest) Marshal() ([]byte, error)

Marshal marshals the ClosePrintFileRequest structure into a byte array

Returns: - A byte array representing the ClosePrintFileRequest structure - An error if the marshaling fails

func (*ClosePrintFileRequest) Unmarshal

func (c *ClosePrintFileRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ClosePrintFileResponse

type ClosePrintFileResponse struct {
	command_interface.Command
}

ClosePrintFileResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/220850bc-b5cb-45c8-b358-7fe8c697aab5

func NewClosePrintFileResponse

func NewClosePrintFileResponse() *ClosePrintFileResponse

NewClosePrintFileResponse creates a new ClosePrintFileResponse structure

Returns: - A pointer to the new ClosePrintFileResponse structure

func (*ClosePrintFileResponse) Marshal

func (c *ClosePrintFileResponse) Marshal() ([]byte, error)

Marshal marshals the ClosePrintFileResponse structure into a byte array

Returns: - A byte array representing the ClosePrintFileResponse structure - An error if the marshaling fails

func (*ClosePrintFileResponse) Unmarshal

func (c *ClosePrintFileResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CloseRequest

type CloseRequest struct {
	command_interface.Command

	// The FID of the object to be closed.
	FID types.USHORT

	// A time value encoded as the number of seconds since January 1, 1970 00:00:00.0. The client can request that the last
	// modification time for the file be updated to this time value. A value of 0x00000000 or 0xFFFFFFFF results in the server
	// not updating the last modification time.
	LastTimeModified types.FILETIME
}

CloseRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/eb85efbc-9fd5-4320-8cd6-91b53ac49203

func NewCloseRequest

func NewCloseRequest() *CloseRequest

NewCloseRequest creates a new CloseRequest structure

Returns: - A pointer to the new CloseRequest structure

func (*CloseRequest) Marshal

func (c *CloseRequest) Marshal() ([]byte, error)

Marshal marshals the CloseRequest structure into a byte array

Returns: - A byte array representing the CloseRequest structure - An error if the marshaling fails

func (*CloseRequest) Unmarshal

func (c *CloseRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CloseResponse

type CloseResponse struct {
	command_interface.Command
}

CloseResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/41884c88-9449-47f2-a98b-a48d8da3b447

func NewCloseResponse

func NewCloseResponse() *CloseResponse

NewCloseResponse creates a new CloseResponse structure

Returns: - A pointer to the new CloseResponse structure

func (*CloseResponse) Marshal

func (c *CloseResponse) Marshal() ([]byte, error)

Marshal marshals the CloseResponse structure into a byte array

Returns: - A byte array representing the CloseResponse structure - An error if the marshaling fails

func (*CloseResponse) Unmarshal

func (c *CloseResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateDirectoryRequest

type CreateDirectoryRequest struct {
	command_interface.Command

	// A null-terminated string giving the full pathname, relative to the supplied TID, of the directory to be created.
	DirectoryName types.SMB_STRING
}

CreateDirectoryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/06cc0c53-355a-4042-ae24-794aadb412f3

func NewCreateDirectoryRequest

func NewCreateDirectoryRequest() *CreateDirectoryRequest

NewCreateDirectoryRequest creates a new CreateDirectoryRequest structure

Returns: - A pointer to the new CreateDirectoryRequest structure

func (*CreateDirectoryRequest) Marshal

func (c *CreateDirectoryRequest) Marshal() ([]byte, error)

Marshal marshals the CreateDirectoryRequest structure into a byte array

Returns: - A byte array representing the CreateDirectoryRequest structure - An error if the marshaling fails

func (*CreateDirectoryRequest) Unmarshal

func (c *CreateDirectoryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateDirectoryResponse

type CreateDirectoryResponse struct {
	command_interface.Command
}

CreateDirectoryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/90dee346-9411-4e97-9022-4d2caf02562e

func NewCreateDirectoryResponse

func NewCreateDirectoryResponse() *CreateDirectoryResponse

NewCreateDirectoryResponse creates a new CreateDirectoryResponse structure

Returns: - A pointer to the new CreateDirectoryResponse structure

func (*CreateDirectoryResponse) Marshal

func (c *CreateDirectoryResponse) Marshal() ([]byte, error)

Marshal marshals the CreateDirectoryResponse structure into a byte array

Returns: - A byte array representing the CreateDirectoryResponse structure - An error if the marshaling fails

func (*CreateDirectoryResponse) Unmarshal

func (c *CreateDirectoryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateNewRequest

type CreateNewRequest struct {
	command_interface.Command

	// A 16-bit field of 1-bit flags that represent the file attributes to assign to the file if it is created successfully.
	FileAttributes types.SMB_FILE_ATTRIBUTES

	// The time that the file was created on the client, represented as the number of seconds since Jan 1, 1970, 00:00:00.0.
	CreationTime types.FILETIME

	// A null-terminated string that contains the fully qualified name of the file, relative to the supplied TID, to create on the server.
	FileName types.SMB_STRING
}

CreateNewRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/2e4852f0-8672-4d62-9848-42f931b91533

func NewCreateNewRequest

func NewCreateNewRequest() *CreateNewRequest

NewCreateNewRequest creates a new CreateNewRequest structure

Returns: - A pointer to the new CreateNewRequest structure

func (*CreateNewRequest) Marshal

func (c *CreateNewRequest) Marshal() ([]byte, error)

Marshal marshals the CreateNewRequest structure into a byte array

Returns: - A byte array representing the CreateNewRequest structure - An error if the marshaling fails

func (*CreateNewRequest) Unmarshal

func (c *CreateNewRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateNewResponse

type CreateNewResponse struct {
	command_interface.Command

	// The FID representing the file on the server. This value MUST be supplied in subsequent requests that manipulate the file.
	FID types.USHORT
}

CreateNewResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/060b7ffa-0b94-4cdd-833a-9ef3053c5931

func NewCreateNewResponse

func NewCreateNewResponse() *CreateNewResponse

NewCreateNewResponse creates a new CreateNewResponse structure

Returns: - A pointer to the new CreateNewResponse structure

func (*CreateNewResponse) Marshal

func (c *CreateNewResponse) Marshal() ([]byte, error)

Marshal marshals the CreateNewResponse structure into a byte array

Returns: - A byte array representing the CreateNewResponse structure - An error if the marshaling fails

func (*CreateNewResponse) Unmarshal

func (c *CreateNewResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateRequest

type CreateRequest struct {
	command_interface.Command

	// A 16-bit field of 1-bit flags that represent the file attributes to assign to the file if it is created successfully.
	FileAttributes types.SMB_FILE_ATTRIBUTES

	// The time that the file was created on the client, represented as the number of seconds since Jan 1, 1970, 00:00:00.0.
	CreationTime types.FILETIME

	// A null-terminated string that represents the fully qualified name of the file relative to the supplied TID to create or truncate on the server.
	FileName types.SMB_STRING
}

CreateRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/24462104-6b35-4fe4-aeaa-7c30cd727bc9

func NewCreateRequest

func NewCreateRequest() *CreateRequest

NewCreateRequest creates a new CreateRequest structure

Returns: - A pointer to the new CreateRequest structure

func (*CreateRequest) Marshal

func (c *CreateRequest) Marshal() ([]byte, error)

Marshal marshals the CreateRequest structure into a byte array

Returns: - A byte array representing the CreateRequest structure - An error if the marshaling fails

func (*CreateRequest) Unmarshal

func (c *CreateRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateResponse

type CreateResponse struct {
	command_interface.Command

	// The FID representing the file on the server. This value MUST be supplied in the FID field of the SMB Header (section 2.2.3.1) in subsequent requests that manipulate the file.
	FID types.USHORT
}

CreateResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c11c97ae-e5ea-48c0-aeec-2d3012b440e2

func NewCreateResponse

func NewCreateResponse() *CreateResponse

NewCreateResponse creates a new CreateResponse structure

Returns: - A pointer to the new CreateResponse structure

func (*CreateResponse) Marshal

func (c *CreateResponse) Marshal() ([]byte, error)

Marshal marshals the CreateResponse structure into a byte array

Returns: - A byte array representing the CreateResponse structure - An error if the marshaling fails

func (*CreateResponse) Unmarshal

func (c *CreateResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateTemporaryRequest

type CreateTemporaryRequest struct {
	command_interface.Command

	// This field SHOULD be ignored by the server.
	FileAttributes types.SMB_FILE_ATTRIBUTES

	// The time that the file was created, represented as the number of seconds since Jan 1, 1970, 00:00:00.0.
	CreationTime types.FILETIME

	// A null-terminated string that represents the fully qualified name of the directory relative to the supplied TID in which to create the temporary file.
	DirectoryName types.SMB_STRING
}

CreateTemporaryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3dae394e-5c48-46fc-82ea-4031995f903c

func NewCreateTemporaryRequest

func NewCreateTemporaryRequest() *CreateTemporaryRequest

NewCreateTemporaryRequest creates a new CreateTemporaryRequest structure

Returns: - A pointer to the new CreateTemporaryRequest structure

func (*CreateTemporaryRequest) Marshal

func (c *CreateTemporaryRequest) Marshal() ([]byte, error)

Marshal marshals the CreateTemporaryRequest structure into a byte array

Returns: - A byte array representing the CreateTemporaryRequest structure - An error if the marshaling fails

func (*CreateTemporaryRequest) Unmarshal

func (c *CreateTemporaryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type CreateTemporaryResponse

type CreateTemporaryResponse struct {
	command_interface.Command

	// The FID representing the file on the server. This value MUST be supplied in the FID field of the SMB Header (section 2.2.3.1) in subsequent requests that manipulate the file.
	FID types.USHORT

	// A null-terminated string that contains the temporary file name generated by the server.
	// The string SHOULD be a null-terminated array of ASCII characters.
	TemporaryFileName types.SMB_STRING
}

CreateTemporaryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/763af5c5-74bf-43c6-b410-e48c79b08f57

func NewCreateTemporaryResponse

func NewCreateTemporaryResponse() *CreateTemporaryResponse

NewCreateTemporaryResponse creates a new CreateTemporaryResponse structure

Returns: - A pointer to the new CreateTemporaryResponse structure

func (*CreateTemporaryResponse) Marshal

func (c *CreateTemporaryResponse) Marshal() ([]byte, error)

Marshal marshals the CreateTemporaryResponse structure into a byte array

Returns: - A byte array representing the CreateTemporaryResponse structure - An error if the marshaling fails

func (*CreateTemporaryResponse) Unmarshal

func (c *CreateTemporaryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type DeleteDirectoryRequest

type DeleteDirectoryRequest struct {
	command_interface.Command

	// A null-terminated string that contains the full pathname, relative to the supplied TID, of the directory to be deleted.
	DirectoryName types.SMB_STRING
}

DeleteDirectoryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f944f5bb-0668-4cdf-b6ff-bec3f6ea8667

func NewDeleteDirectoryRequest

func NewDeleteDirectoryRequest() *DeleteDirectoryRequest

NewDeleteDirectoryRequest creates a new DeleteDirectoryRequest structure

Returns: - A pointer to the new DeleteDirectoryRequest structure

func (*DeleteDirectoryRequest) Marshal

func (c *DeleteDirectoryRequest) Marshal() ([]byte, error)

Marshal marshals the DeleteDirectoryRequest structure into a byte array

Returns: - A byte array representing the DeleteDirectoryRequest structure - An error if the marshaling fails

func (*DeleteDirectoryRequest) Unmarshal

func (c *DeleteDirectoryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type DeleteDirectoryResponse

type DeleteDirectoryResponse struct {
	command_interface.Command
}

DeleteDirectoryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/6e183cd3-3f3b-48a8-be70-9dd75183da8b

func NewDeleteDirectoryResponse

func NewDeleteDirectoryResponse() *DeleteDirectoryResponse

NewDeleteDirectoryResponse creates a new DeleteDirectoryResponse structure

Returns: - A pointer to the new DeleteDirectoryResponse structure

func (*DeleteDirectoryResponse) Marshal

func (c *DeleteDirectoryResponse) Marshal() ([]byte, error)

Marshal marshals the DeleteDirectoryResponse structure into a byte array

Returns: - A byte array representing the DeleteDirectoryResponse structure - An error if the marshaling fails

func (*DeleteDirectoryResponse) Unmarshal

func (c *DeleteDirectoryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type DeleteRequest

type DeleteRequest struct {
	command_interface.Command

	// The file attributes of the file(s) to be deleted. If the value of this field is 0x0000, then only normal files
	// MUST be matched for deletion. If the System or Hidden attributes MUST be specified, then entries with those attributes
	// are matched in addition to the normal files.  Read-only files MUST NOT be deleted.  The read-only attribute of the
	// file MUST be cleared before the file can be deleted.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// The pathname of the file(s) to be deleted, relative to the supplied TID. Wildcards MAY be used in the filename component of the path.
	FileName types.SMB_STRING
}

DeleteRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/2e57889e-ca5b-4076-a865-08103b947e59

func NewDeleteRequest

func NewDeleteRequest() *DeleteRequest

NewDeleteRequest creates a new DeleteRequest structure

Returns: - A pointer to the new DeleteRequest structure

func (*DeleteRequest) Marshal

func (c *DeleteRequest) Marshal() ([]byte, error)

Marshal marshals the DeleteRequest structure into a byte array

Returns: - A byte array representing the DeleteRequest structure - An error if the marshaling fails

func (*DeleteRequest) Unmarshal

func (c *DeleteRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type DeleteResponse

type DeleteResponse struct {
	command_interface.Command
}

DeleteResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/69122f46-92f3-4c1a-87e1-bc137fda0861

func NewDeleteResponse

func NewDeleteResponse() *DeleteResponse

NewDeleteResponse creates a new DeleteResponse structure

Returns: - A pointer to the new DeleteResponse structure

func (*DeleteResponse) Marshal

func (c *DeleteResponse) Marshal() ([]byte, error)

Marshal marshals the DeleteResponse structure into a byte array

Returns: - A byte array representing the DeleteResponse structure - An error if the marshaling fails

func (*DeleteResponse) Unmarshal

func (c *DeleteResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type EchoRequest

type EchoRequest struct {
	command_interface.Command

	// The number of times that the server SHOULD echo the contents of the SMB_Data.Data field.
	EchoCount types.USHORT

	// Data to echo.
	Data []types.UCHAR
}

EchoRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/5dd916b2-9c38-4f0c-ba55-a2c86dd5de10

func NewEchoRequest

func NewEchoRequest() *EchoRequest

NewEchoRequest creates a new EchoRequest structure

Returns: - A pointer to the new EchoRequest structure

func (*EchoRequest) Marshal

func (c *EchoRequest) Marshal() ([]byte, error)

Marshal marshals the EchoRequest structure into a byte array

Returns: - A byte array representing the EchoRequest structure - An error if the marshaling fails

func (*EchoRequest) Unmarshal

func (c *EchoRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type EchoResponse

type EchoResponse struct {
	command_interface.Command

	// The sequence number of this echo response message.
	SequenceNumber types.USHORT

	// The data echoed by the server.
	Data []types.UCHAR
}

EchoResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/36242467-7c62-4041-b60f-939683cacdf2

func NewEchoResponse

func NewEchoResponse() *EchoResponse

NewEchoResponse creates a new EchoResponse structure

Returns: - A pointer to the new EchoResponse structure

func (*EchoResponse) Marshal

func (c *EchoResponse) Marshal() ([]byte, error)

Marshal marshals the EchoResponse structure into a byte array

Returns: - A byte array representing the EchoResponse structure - An error if the marshaling fails

func (*EchoResponse) Unmarshal

func (c *EchoResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindClose2Request

type FindClose2Request struct {
	command_interface.Command

	// A search handle, also known as a Search ID (SID). This MUST be the SID value returned in the initial TRANS2_FIND_FIRST2 subcommand request.
	SearchHandle types.USHORT
}

FindClose2Request Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/a0ac55c1-d2ed-4c38-b2f6-6d4af4490d87

func NewFindClose2Request

func NewFindClose2Request() *FindClose2Request

NewFindClose2Request creates a new FindClose2Request structure

Returns: - A pointer to the new FindClose2Request structure

func (*FindClose2Request) Marshal

func (c *FindClose2Request) Marshal() ([]byte, error)

Marshal marshals the FindClose2Request structure into a byte array

Returns: - A byte array representing the FindClose2Request structure - An error if the marshaling fails

func (*FindClose2Request) Unmarshal

func (c *FindClose2Request) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindClose2Response

type FindClose2Response struct {
	command_interface.Command
}

FindClose2Response Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f7363dea-5a98-4000-be0c-a860d125aebe

func NewFindClose2Response

func NewFindClose2Response() *FindClose2Response

NewFindClose2Response creates a new FindClose2Response structure

Returns: - A pointer to the new FindClose2Response structure

func (*FindClose2Response) Marshal

func (c *FindClose2Response) Marshal() ([]byte, error)

Marshal marshals the FindClose2Response structure into a byte array

Returns: - A byte array representing the FindClose2Response structure - An error if the marshaling fails

func (*FindClose2Response) Unmarshal

func (c *FindClose2Response) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindCloseRequest

type FindCloseRequest struct {
	command_interface.Command

	// This field has no meaning in this context. It SHOULD be set to 0x0000 by the client and MUST be ignored by the server.
	MaxCount types.USHORT

	// This field has no meaning in this context. It SHOULD be set to 0x0000 by the client and MUST be ignored by the server.
	SearchAttributes types.USHORT

	// A null-terminated SMB_STRING. This MUST be the empty string.
	FileName types.SMB_STRING

	// This MUST be the last ResumeKey returned by the server in the search being closed. See SMB_COM_FIND for a description of the SMB_Resume_Key data structure.
	ResumeKey types.SMB_STRING
}

FindCloseRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f62c901b-c2e0-412e-a7df-c4f3889a2412

func NewFindCloseRequest

func NewFindCloseRequest() *FindCloseRequest

NewFindCloseRequest creates a new FindCloseRequest structure

Returns: - A pointer to the new FindCloseRequest structure

func (*FindCloseRequest) Marshal

func (c *FindCloseRequest) Marshal() ([]byte, error)

Marshal marshals the FindCloseRequest structure into a byte array

Returns: - A byte array representing the FindCloseRequest structure - An error if the marshaling fails

func (*FindCloseRequest) Unmarshal

func (c *FindCloseRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindCloseResponse

type FindCloseResponse struct {
	command_interface.Command

	// Parameters
	Count types.USHORT

	// Data
	DirectoryInformationData types.SMB_STRING
}

FindCloseResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/4c9f95de-365b-4a41-b4fb-fe0233b280eb

func NewFindCloseResponse

func NewFindCloseResponse() *FindCloseResponse

NewFindCloseResponse creates a new FindCloseResponse structure

Returns: - A pointer to the new FindCloseResponse structure

func (*FindCloseResponse) Marshal

func (c *FindCloseResponse) Marshal() ([]byte, error)

Marshal marshals the FindCloseResponse structure into a byte array

Returns: - A byte array representing the FindCloseResponse structure - An error if the marshaling fails

func (*FindCloseResponse) Unmarshal

func (c *FindCloseResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindRequest

type FindRequest struct {
	command_interface.Command

	// The maximum number of directory entries to return. This value represents the maximum number of entries across
	// the entirety of the search, not just the initial response.
	MaxCount types.USHORT

	// An attribute mask used to specify the standard attributes that a file MUST have to match the search. If the
	// value of this field is 0x0000, then only normal files MUST be returned. If the Volume Label attribute is set, the
	// server MUST return only the volume label (the Volume Label attribute is exclusive). If the Directory, System,
	// or Hidden attributes are specified, then those entries MUST be returned in addition to the normal files.
	// Exclusive search attributes (see section 2.2.1.2.4) can also be set.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// A null-terminated character string. This is the full directory path (relative to the TID) of the file(s) being sought.
	// Only the final component of the path MAY contain wildcards. This string MAY be the empty string.
	FileName types.SMB_STRING

	// BufferFormat2 (1 byte): This field MUST be 0x05, which indicates that a variable block is to follow.
	// ResumeKeyLength (2 bytes): This field MUST be either 0x0000 or 21 (0x0015). If the value of this field is 0x0000,
	// then this is an initial search request. The server MUST allocate resources to maintain search state so that subsequent
	// requests can be processed. If the value of this field is 21 (0x0015) then this request MUST be the continuation of a
	// previous search, and the next field MUST contain a ResumeKey previously returned by the server.
	// ResumeKey (variable): If the value of the ResumeKeyLength field is 21 (0x0015), this field MUST contain a ResumeKey
	// returned by the server in response to a previous SMB_COM_SEARCH request. The ResumeKey contains data used by both the
	// client and the server to maintain the state of the search. The structure of the ResumeKey follows.
	ResumeKey types.SMB_STRING
}

FindRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f2890270-ee43-427f-9e48-07420a836457

func NewFindRequest

func NewFindRequest() *FindRequest

NewFindRequest creates a new FindRequest structure

Returns: - A pointer to the new FindRequest structure

func (*FindRequest) Marshal

func (c *FindRequest) Marshal() ([]byte, error)

Marshal marshals the FindRequest structure into a byte array

Returns: - A byte array representing the FindRequest structure - An error if the marshaling fails

func (*FindRequest) Unmarshal

func (c *FindRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindResponse

type FindResponse struct {
	command_interface.Command

	// The number of directory entries returned in this response message. This value MUST be less than or equal to the value
	// of MaxCount in the initial request.
	Count types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x05, which indicates that a variable-size block is to follow.
	// DataLength (2 bytes): The size, in bytes, of the DirectoryInformationData array, which follows. This field MUST be equal
	// to 43 times the value of SMB_Parameters.Words.Count.
	// DirectoryInformationData (variable): An array of zero or more SMB_Directory_Information records. The structure and contents
	// of these records is specified below. Note that the SMB_Directory_Information record structure is a fixed 43 bytes in length.
	DirectoryInformationData []types.SMB_DIRECTORY_INFORMATION
}

FindResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/b8674ab7-70a2-4b8b-bc30-3137b0ed4284

func NewFindResponse

func NewFindResponse() *FindResponse

NewFindResponse creates a new FindResponse structure

Returns: - A pointer to the new FindResponse structure

func (*FindResponse) Marshal

func (c *FindResponse) Marshal() ([]byte, error)

Marshal marshals the FindResponse structure into a byte array

Returns: - A byte array representing the FindResponse structure - An error if the marshaling fails

func (*FindResponse) Unmarshal

func (c *FindResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindUniqueRequest

type FindUniqueRequest struct {
	command_interface.Command

	// MaxCount (2 bytes): The maximum number of directory entries to return.
	MaxCount types.USHORT

	// SearchAttributes (2 bytes): An attribute mask used to specify the standard attributes that a file MUST have in order
	// to match the search. If the value of this field is 0, then only normal files MUST be returned. If the Volume Label attribute
	// is set, then the server MUST only return the volume label. If the Directory, System, or Hidden attributes are specified, then
	// those entries MUST be returned in addition to the normal files. Exclusive search attributes (see section 2.2.1.2.4) can also be set.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// FileName (variable): A null-terminated SMB_STRING. This is the full directory path (relative to the TID) of the
	// file(s) being sought. Only the final component of the path MAY contain wildcards. This string MAY be the empty string.
	FileName types.SMB_STRING

	// BufferFormat2 (1 byte): This field MUST be 0x05, which indicates that a variable block is to follow.
	// ResumeKeyLength (2 bytes): This field MUST be 0x0000. No Resume Key is permitted in the SMB_COM_FIND_UNIQUE request.
	// If the server receives an SMB_COM_FIND_UNIQUE request with a nonzero ResumeKeyLength, it MUST ignore this field.
	ResumeKey types.SMB_RESUME_KEY
}

FindUniqueRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1120965e-f217-42a0-86f0-f8285ecbc32a

func NewFindUniqueRequest

func NewFindUniqueRequest() *FindUniqueRequest

NewFindUniqueRequest creates a new FindUniqueRequest structure

Returns: - A pointer to the new FindUniqueRequest structure

func (*FindUniqueRequest) Marshal

func (c *FindUniqueRequest) Marshal() ([]byte, error)

Marshal marshals the FindUniqueRequest structure into a byte array

Returns: - A byte array representing the FindUniqueRequest structure - An error if the marshaling fails

func (*FindUniqueRequest) Unmarshal

func (c *FindUniqueRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FindUniqueResponse

type FindUniqueResponse struct {
	command_interface.Command

	// Count (2 bytes): The number of directory entries returned in this response message. This value MUST be less
	// than or equal to the value of MaxCount in the initial request.
	Count types.USHORT

	// Data
	DirectoryInformationData []types.SMB_DIRECTORY_INFORMATION
}

FindUniqueResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/eb2614e0-ce33-4a7f-847b-bcddb97c00a6

func NewFindUniqueResponse

func NewFindUniqueResponse() *FindUniqueResponse

NewFindUniqueResponse creates a new FindUniqueResponse structure

Returns: - A pointer to the new FindUniqueResponse structure

func (*FindUniqueResponse) Marshal

func (c *FindUniqueResponse) Marshal() ([]byte, error)

Marshal marshals the FindUniqueResponse structure into a byte array

Returns: - A byte array representing the FindUniqueResponse structure - An error if the marshaling fails

func (*FindUniqueResponse) Unmarshal

func (c *FindUniqueResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FlushRequest

type FlushRequest struct {
	command_interface.Command

	// FID (2 bytes): The FID of the file to be flushed. If this field is set to 0xFFFF (65535), all files opened by
	// the same PID within the SMB connection are to be flushed.
	FID types.USHORT
}

FlushRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/e5e1e00c-5ec2-4a5c-b825-f8cf2f4cda79

func NewFlushRequest

func NewFlushRequest() *FlushRequest

NewFlushRequest creates a new FlushRequest structure

Returns: - A pointer to the new FlushRequest structure

func (*FlushRequest) Marshal

func (c *FlushRequest) Marshal() ([]byte, error)

Marshal marshals the FlushRequest structure into a byte array

Returns: - A byte array representing the FlushRequest structure - An error if the marshaling fails

func (*FlushRequest) Unmarshal

func (c *FlushRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type FlushResponse

type FlushResponse struct {
	command_interface.Command
}

FlushResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/29985252-cd1a-44a7-9660-40f78b632dcc

func NewFlushResponse

func NewFlushResponse() *FlushResponse

NewFlushResponse creates a new FlushResponse structure

Returns: - A pointer to the new FlushResponse structure

func (*FlushResponse) Marshal

func (c *FlushResponse) Marshal() ([]byte, error)

Marshal marshals the FlushResponse structure into a byte array

Returns: - A byte array representing the FlushResponse structure - An error if the marshaling fails

func (*FlushResponse) Unmarshal

func (c *FlushResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type IoctlRequest

type IoctlRequest struct {
	command_interface.Command

	// FID (2 bytes): The FID of the device or file to which the IOCTL is to be sent.
	FID types.USHORT

	// Category (2 bytes): The implementation-dependent device category for the
	// request.
	Category types.USHORT

	// Function (2 bytes): The implementation-dependent device function for the
	// request.
	Function types.USHORT

	// TotalParameterCount (2 bytes): The total number of IOCTL parameter bytes that
	// the client sends to the server in this request. Parameter bytes for an IOCTL are
	// carried within the SMB_Data.Parameters field of the SMB_COM_IOCTL request. This
	// value MUST be the same as ParameterCount.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of IOCTL data bytes that the client
	// sends to the server in this request. Data bytes for an IOCTL are carried within
	// the SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the
	// same as DataCount.
	TotalDataCount types.USHORT

	// MaxParameterCount (2 bytes): The maximum number of SMB_Data.Parameters bytes
	// that the client accepts in the IOCTL response. The server MUST NOT return more
	// than this number of bytes in the SMB_Data.Parameters field of the response.
	MaxParameterCount types.USHORT

	// MaxDataCount (2 bytes): The maximum number of SMB_Data.Data bytes that the
	// client accepts in the IOCTL response. The server MUST NOT return more than this
	// number of bytes in the SMB_Data.Data field.
	MaxDataCount types.USHORT

	// Timeout (4 bytes): The value of this field MUST be the maximum number of
	// milliseconds that the server SHOULD wait for completion of the transaction
	// before generating a time-out and returning a response to the client. The client
	// SHOULD set this to 0x00000000 to indicate that no time-out is expected. A value
	// of 0x00000000 indicates that the server returns an error if the resource is not
	// immediately available. If the operation does not complete within the specified
	// time, the server aborts the request and sends a failure response.
	Timeout types.ULONG

	Reserved types.USHORT

	// ParameterCount (2 bytes): The number of IOCTL parameter bytes that the client
	// sends to the server in this request. Parameter bytes for an IOCTL are carried
	// within the SMB_Data.Parameters field of the SMB_COM_IOCTL request. This value
	// MUST be the same as TotalParameterCount.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): The client SHOULD set the value of this field to
	// 0x0000. The server MUST ignore the value of this field.
	ParameterOffset types.USHORT

	// DataCount (2 bytes): The total number of IOCTL data bytes that the client sends
	// to the server in this request. Data bytes for an IOCTL are carried within the
	// SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the same as
	// TotalDataCount.
	DataCount types.USHORT

	// DataOffset (2 bytes): The client SHOULD set the value of this field to 0x0000.
	// The server MUST ignore the value of this field.
	DataOffset types.USHORT

	// Pad1 (variable): An array of padding bytes used to align the next field to a
	// 2-byte or 4-byte boundary.
	Pad1 []types.UCHAR

	// Parameters (variable): IOCTL parameter bytes. The contents are implementation-dependent.
	Parameters []types.UCHAR

	// Pad2 (variable): An array of padding bytes, used to align the next field to a
	// 2-byte or 4-byte boundary.
	Pad2 []types.UCHAR

	// Data (variable): IOCTL data bytes. The contents are implementation-dependent.
	Data []types.UCHAR
}

IoctlRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c8f1b5b1-9ec1-49d2-a0e1-78ee88f39e71

func NewIoctlRequest

func NewIoctlRequest() *IoctlRequest

NewIoctlRequest creates a new IoctlRequest structure

Returns: - A pointer to the new IoctlRequest structure

func (*IoctlRequest) Marshal

func (c *IoctlRequest) Marshal() ([]byte, error)

Marshal marshals the IoctlRequest structure into a byte array

Returns: - A byte array representing the IoctlRequest structure - An error if the marshaling fails

func (*IoctlRequest) Unmarshal

func (c *IoctlRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type IoctlResponse

type IoctlResponse struct {
	command_interface.Command

	// TotalParameterCount (2 bytes): The total number of IOCTL parameter bytes that
	// the server sends to the client in this response. Parameter bytes for an IOCTL
	// are carried within the SMB_Data.Parameters field of the SMB_COM_IOCTL request.
	// This value MUST be the same as ParameterCount, and this value MUST be less than
	// or equal to the MaxParameterCount field value in the client's request.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of IOCTL data bytes that the server
	// sends to the client in this response. Data bytes for an IOCTL are carried within
	// the SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the
	// same as DataCount, and this value MUST be less than or equal to the MaxDataCount
	// field value in the client's request.
	TotalDataCount types.USHORT

	// ParameterCount (2 bytes): The total number of IOCTL parameter bytes that the
	// server sends to the client in this response. Parameter bytes for an IOCTL are
	// carried within the SMB_Data.Parameters field of the SMB_COM_IOCTL request. This
	// value MUST be the same as TotalParameterCount and this value MUST be less than
	// or equal to the MaxParameterCount field value in the client's request.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): This field MUST contain the number of bytes from the
	// start of the SMB Header (section 2.2.3.1) to the start of the
	// SMB_Data.Parameters field. Client implementations MUST use this value to locate
	// the IOCTL parameter block within the response.
	ParameterOffset types.USHORT

	ParameterDisplacement types.USHORT

	// DataCount (2 bytes): The total number of IOCTL data bytes that the server sends
	// to the client in this response. Data bytes for an IOCTL are carried within the
	// SMB_Data.Data field of the SMB_COM_IOCTL request. This value MUST be the same as
	// TotalDataCount, and this value MUST be less than or equal to the MaxDataCount
	// field value of the client's request.
	DataCount types.USHORT

	// DataOffset (2 bytes): This field MUST be the number of bytes from the start of
	// the SMB Header of the response to the start of the SMB_Data.Data field. Client
	// implementations MUST use this value to locate the IOCTL data block within the
	// response.
	DataOffset types.USHORT

	// DataDisplacement (2 bytes): The server SHOULD set the value of this field to
	// 0x0000. The client MUST ignore the value of this field.
	DataDisplacement types.USHORT

	// Pad1 (variable): An array of padding bytes used to align the next field to a 16-
	// or 32-bit boundary.
	Pad1 []types.UCHAR

	// Parameters (variable): IOCTL parameter bytes. The contents are implementation-dependent.
	Parameters []types.UCHAR

	// Pad2 (variable): An array of padding bytes used to align the next field to a 16-
	// or 32-bit boundary.
	Pad2 []types.UCHAR

	// Data (variable): IOCTL data bytes. The contents are implementation-dependent.
	Data []types.UCHAR
}

IoctlResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/27cb85fe-071a-41aa-9068-317720909892

func NewIoctlResponse

func NewIoctlResponse() *IoctlResponse

NewIoctlResponse creates a new IoctlResponse structure

Returns: - A pointer to the new IoctlResponse structure

func (*IoctlResponse) Marshal

func (c *IoctlResponse) Marshal() ([]byte, error)

Marshal marshals the IoctlResponse structure into a byte array

Returns: - A byte array representing the IoctlResponse structure - An error if the marshaling fails

func (*IoctlResponse) Unmarshal

func (c *IoctlResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockAndReadRequest

type LockAndReadRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the file from which the data MUST be read.
	FID types.USHORT

	// CountOfBytesToRead (2 bytes): This field is a 16-bit unsigned integer indicating the number of bytes to be read from the file
	// The client MUST ensure that the amount of data requested will fit in the negotiated maximum buffer size.
	CountOfBytesToRead types.USHORT

	// ReadOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer indicating the offset in number of bytes from which to
	// begin reading from the file. The client MUST ensure that the amount of data requested fits in the negotiated maximum buffer size.
	// Because this field is limited to 32 bits, this command is inappropriate for files that have 64-bit offsets.
	ReadOffsetInBytes types.ULONG

	// EstimateOfRemainingBytesToBeRead (2 bytes): This field is a 16-bit unsigned integer indicating the remaining number of bytes that
	// the client has designated to be read from the file. This is an advisory field and can be zero.
	EstimateOfRemainingBytesToBeRead types.USHORT
}

LockAndReadRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/4652d923-dc4e-4611-b17e-9215d8c66f2e

func NewLockAndReadRequest

func NewLockAndReadRequest() *LockAndReadRequest

NewLockAndReadRequest creates a new LockAndReadRequest structure

Returns: - A pointer to the new LockAndReadRequest structure

func (*LockAndReadRequest) Marshal

func (c *LockAndReadRequest) Marshal() ([]byte, error)

Marshal marshals the LockAndReadRequest structure into a byte array

Returns: - A byte array representing the LockAndReadRequest structure - An error if the marshaling fails

func (*LockAndReadRequest) Unmarshal

func (c *LockAndReadRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockAndReadResponse

type LockAndReadResponse struct {
	command_interface.Command

	// CountOfBytesReturned (2 bytes): The actual number of bytes returned to the client. This MUST be equal to CountOfBytesToRead
	// unless the end of file was reached before reading CountOfBytesToRead bytes or the ReadOffsetInBytes pointed at or beyond the end of file.
	CountOfBytesReturned types.USHORT

	// Reserved (8 bytes): Reserved. All bytes MUST be 0x00.
	Reserved [4]types.USHORT

	// BufferType (1 byte): This field MUST be 0x01.
	// CountOfBytesRead (2 bytes): The number of bytes read that are contained in the following array of bytes.
	// Bytes (variable): The array of bytes read from the file. The array is not null-terminated.
	BytesRead types.SMB_STRING
}

LockAndReadResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/ac41df92-de51-4d2d-935a-7eae93ae9bcc

func NewLockAndReadResponse

func NewLockAndReadResponse() *LockAndReadResponse

NewLockAndReadResponse creates a new LockAndReadResponse structure

Returns: - A pointer to the new LockAndReadResponse structure

func (*LockAndReadResponse) Marshal

func (c *LockAndReadResponse) Marshal() ([]byte, error)

Marshal marshals the LockAndReadResponse structure into a byte array

Returns: - A byte array representing the LockAndReadResponse structure - An error if the marshaling fails

func (*LockAndReadResponse) Unmarshal

func (c *LockAndReadResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockByteRangeRequest

type LockByteRangeRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the file from which the data MUST be read.
	FID types.USHORT

	// CountOfBytesToLock (4 bytes): This field is a 32-bit unsigned integer indicating the number of contiguous bytes to be locked.
	CountOfBytesToLock types.ULONG

	// LockOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer indicating the offset, in number of bytes, from which
	// to begin the lock. Because this field is limited to 32 bits,  this command is inappropriate for files that have 64-bit offsets.
	LockOffsetInBytes types.ULONG
}

LockByteRangeRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/08282636-0876-4ded-82b1-973edd255f87

func NewLockByteRangeRequest

func NewLockByteRangeRequest() *LockByteRangeRequest

NewLockByteRangeRequest creates a new LockByteRangeRequest structure

Returns: - A pointer to the new LockByteRangeRequest structure

func (*LockByteRangeRequest) Marshal

func (c *LockByteRangeRequest) Marshal() ([]byte, error)

Marshal marshals the LockByteRangeRequest structure into a byte array

Returns: - A byte array representing the LockByteRangeRequest structure - An error if the marshaling fails

func (*LockByteRangeRequest) Unmarshal

func (c *LockByteRangeRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockByteRangeResponse

type LockByteRangeResponse struct {
	command_interface.Command
}

LockByteRangeResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f18f4988-18da-4b07-86e6-a92ceceb4d82

func NewLockByteRangeResponse

func NewLockByteRangeResponse() *LockByteRangeResponse

NewLockByteRangeResponse creates a new LockByteRangeResponse structure

Returns: - A pointer to the new LockByteRangeResponse structure

func (*LockByteRangeResponse) Marshal

func (c *LockByteRangeResponse) Marshal() ([]byte, error)

Marshal marshals the LockByteRangeResponse structure into a byte array

Returns: - A byte array representing the LockByteRangeResponse structure - An error if the marshaling fails

func (*LockByteRangeResponse) Unmarshal

func (c *LockByteRangeResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockingAndxRequest

type LockingAndxRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the file from which the data SHOULD be read.
	FID types.USHORT

	// If TypeOfLock has the SHARED_LOCK bit set, the lock is specified as a shared read-only lock. If shared read-only locks cannot
	// be supported by a server, the server SHOULD map the lock to an exclusive lock for both read and write. Locks for both read and
	// write messages in which TypeOfLock bit READ_WRITE_LOCK is set SHOULD be prohibited by the server, and the server SHOULD return
	// an implementation-specific error to the client. If TypeOfLock has the CHANGE_LOCKTYPE bit set, the client is requesting that
	// the server atomically change the lock type from a shared lock to an exclusive lock, or vice versa. If the server cannot do this
	// in an atomic fashion, the server MUST reject this request and return an implementation-specific error to the client. Closing a
	// file with locks still in force causes the locks to be released in a nondeterministic order.
	// If the Locks vector contains one and only one entry (NumberOfRequestedLocks == 1) and TypeOfLock has the CANCEL_LOCK bit set, the
	// client is requesting that the server cancel a previously requested but unacknowledged lock. This allows the client to cancel lock
	// requests that can wait forever to complete (see Timeout below).
	TypeOfLock types.UCHAR

	// NewOpLockLevel (1 byte): This field is valid only in SMB_COM_LOCKING_ANDX (0x24) (section 2.2.4.32) SMB requests sent from the
	// server to the client in response to a change in an existing OpLock's state. This field is an 8-bit unsigned integer indicating the
	// OpLock level now in effect for the FID in the request. If NewOpLockLevel is 0x00, the client possesses no OpLocks on the file at all.
	// If NewOpLockLevel is 0x01, then the client possesses a Level II OpLock.
	NewOpLockLevel types.UCHAR

	// Timeout (4 bytes): This field is a 32-bit unsigned integer value. Timeout is the maximum amount of time to wait, in milliseconds,
	// for the byte range(s) specified in Locks to become locked. A Timeout value of 0x00000000 indicates that the server fails immediately
	// if any lock range specified is already locked and cannot be locked by this request. A Timeout value of -1 (0xFFFFFFFF) indicates that
	// the server waits as long as it takes (wait forever) for each byte range specified to become unlocked so that it can be locked by this
	// request. Any other value of Timeout specifies the maximum number of milliseconds to wait for all lock ranges specified in Locks to
	// become available and to be locked by this request.
	Timeout types.ULONG

	// NumberOfRequestedUnlocks (2 bytes): This field is a 16-bit unsigned integer value containing the number of entries in the Unlocks array.
	NumberOfRequestedUnlocks types.USHORT

	// NumberOfRequestedLocks (2 bytes): This field is a 16-bit unsigned integer value containing the number of entries in the Locks array.
	NumberOfRequestedLocks types.USHORT

	// Unlocks (variable): An array of byte ranges to be unlocked.
	// If 32-bit offsets are being used, this field uses LOCKING_ANDX_RANGE32 (see below) and is (10 * NumberOfRequestedUnlocks) bytes in length.
	// If 64-bit offsets are being used, this field uses LOCKING_ANDX_RANGE64 (see below) and is (20 * NumberOfRequestedUnlocks) bytes in length.
	Unlocks []types.LOCKING_ANDX_RANGE64

	// Locks (variable): An array of byte ranges to be locked.
	// If 32-bit offsets are being used, this field uses LOCKING_ANDX_RANGE32 (see below) and is (10 * NumberOfRequestedLocks) bytes in length.
	// If 64-bit offsets are being used, this field uses LOCKING_ANDX_RANGE64 (see below) and is (20 * NumberOfRequestedLocks) bytes in length.
	Locks []types.LOCKING_ANDX_RANGE64
}

LockingAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/b5c6eae7-976b-4444-b52e-c76c68c861ad

func NewLockingAndxRequest

func NewLockingAndxRequest() *LockingAndxRequest

NewLockingAndxRequest creates a new LockingAndxRequest structure

Returns: - A pointer to the new LockingAndxRequest structure

func (*LockingAndxRequest) IsAndX

func (c *LockingAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*LockingAndxRequest) Marshal

func (c *LockingAndxRequest) Marshal() ([]byte, error)

Marshal marshals the LockingAndxRequest structure into a byte array

Returns: - A byte array representing the LockingAndxRequest structure - An error if the marshaling fails

func (*LockingAndxRequest) Unmarshal

func (c *LockingAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LockingAndxResponse

type LockingAndxResponse struct {
	command_interface.Command
}

LockingAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/165cd91f-1207-419e-bb62-eb305ea9a67a

func NewLockingAndxResponse

func NewLockingAndxResponse() *LockingAndxResponse

NewLockingAndxResponse creates a new LockingAndxResponse structure

Returns: - A pointer to the new LockingAndxResponse structure

func (*LockingAndxResponse) IsAndX

func (c *LockingAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*LockingAndxResponse) Marshal

func (c *LockingAndxResponse) Marshal() ([]byte, error)

Marshal marshals the LockingAndxResponse structure into a byte array

Returns: - A byte array representing the LockingAndxResponse structure - An error if the marshaling fails

func (*LockingAndxResponse) Unmarshal

func (c *LockingAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LogoffAndxRequest

type LogoffAndxRequest struct {
	command_interface.Command
}

LogoffAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/efbd2ebb-470f-4d8a-bcab-1eadb432305e

func NewLogoffAndxRequest

func NewLogoffAndxRequest() *LogoffAndxRequest

NewLogoffAndxRequest creates a new LogoffAndxRequest structure

Returns: - A pointer to the new LogoffAndxRequest structure

func (*LogoffAndxRequest) IsAndX

func (c *LogoffAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*LogoffAndxRequest) Marshal

func (c *LogoffAndxRequest) Marshal() ([]byte, error)

Marshal marshals the LogoffAndxRequest structure into a byte array

Returns: - A byte array representing the LogoffAndxRequest structure - An error if the marshaling fails

func (*LogoffAndxRequest) Unmarshal

func (c *LogoffAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type LogoffAndxResponse

type LogoffAndxResponse struct {
	command_interface.Command
}

LogoffAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/0e943513-08f5-4e5f-a506-7acb1d8f1c9c

func NewLogoffAndxResponse

func NewLogoffAndxResponse() *LogoffAndxResponse

NewLogoffAndxResponse creates a new LogoffAndxResponse structure

Returns: - A pointer to the new LogoffAndxResponse structure

func (*LogoffAndxResponse) IsAndX

func (c *LogoffAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*LogoffAndxResponse) Marshal

func (c *LogoffAndxResponse) Marshal() ([]byte, error)

Marshal marshals the LogoffAndxResponse structure into a byte array

Returns: - A byte array representing the LogoffAndxResponse structure - An error if the marshaling fails

func (*LogoffAndxResponse) Unmarshal

func (c *LogoffAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NegotiateRequest

type NegotiateRequest struct {
	command_interface.Command

	// Parameters
	WordCount types.UCHAR

	// Dialects (variable): This is a variable length list of dialect identifiers in order of preference from least to most
	// preferred. The client MUST list only dialects that it supports. The structure of the list entries is as follows:
	// BufferFormat (1 byte): This field MUST be 0x02. This is a buffer format indicator that identifies the next field as a null-terminated array of characters.
	// DialectString (variable): A null-terminated string identifying an SMB dialect. A list of common dialects is presented in section 1.7.
	Dialects dialects.Dialects
}

NegotiateRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/25c8c3c9-58fc-4bb8-aa8f-0272dede84c5

func NewNegotiateRequest

func NewNegotiateRequest() *NegotiateRequest

NewNegotiateRequest creates a new NegotiateRequest structure

Returns: - A pointer to the new NegotiateRequest structure

func (*NegotiateRequest) Marshal

func (c *NegotiateRequest) Marshal() ([]byte, error)

Marshal marshals the NegotiateRequest structure into a byte array

Returns: - A byte array representing the NegotiateRequest structure - An error if the marshaling fails

func (*NegotiateRequest) Unmarshal

func (c *NegotiateRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NegotiateResponse

type NegotiateResponse struct {
	command_interface.Command

	// The index of the dialect selected by the server from the list presented in the request. Dialect entries are numbered
	// starting with 0x0000, so a DialectIndex value of 0x0000 indicates the first entry in the list. If the server does not
	// support any of the listed dialects, it MUST return a DialectIndex of 0xFFFF.
	DialectIndex types.USHORT

	// An 8-bit field indicating the security modes supported or required by the server, as follows:
	SecurityMode securitymode.SecurityMode

	// The maximum number of outstanding SMB operations that the server supports. This value includes existing OpLocks,
	// the NT_TRANSACT_NOTIFY_CHANGE subcommand, and any other commands that are pending on the server. If the negotiated
	// MaxMpxCount is 0x0001, then OpLock support MUST be disabled for this session. The MaxMpxCount MUST be greater than 0x0000.
	// This parameter has no specific relationship to the SMB_COM_READ_MPX and SMB_COM_WRITE_MPX commands.
	MaxMpxCount types.USHORT

	// The maximum number of virtual circuits that can be established between the client and the server as part of the same SMB session.
	MaxNumberVcs types.USHORT

	// The maximum size, in bytes, of the largest SMB message that the server can receive. This is the size of the largest SMB message
	// that the client can send to the server. SMB message size includes the size of the SMB header, parameter, and data blocks. This size
	// does not include any transport-layer framing or other transport-layer data. The server SHOULD provide a MaxBufferSize of 4356 bytes,
	// and MUST be a multiple of 4 bytes. If CAP_RAW_MODE is negotiated, the SMB_COM_WRITE_RAW command can bypass the MaxBufferSize limit.
	// Otherwise, SMB messages sent to the server MUST have a total size less than or equal to the MaxBufferSize value. This includes AndX
	// chained messages.
	MaxBufferSize types.ULONG

	// This value specifies the maximum message size when the client sends an SMB_COM_WRITE_RAW Request (section 2.2.4.25.1), and the maximum
	// message size that the server MUST NOT exceed when sending an SMB_COM_READ_RAW Response (section 2.2.4.22.2). This value is significant only
	// if CAP_RAW_MODE is negotiated.
	MaxRawSize types.ULONG

	// The server SHOULD set the value to a token generated for the connection, as specified in SessionKey Generation (section 2.2.1.6.6).
	SessionKey types.ULONG

	// A 32-bit field providing a set of server capability indicators. This bit field is used to indicate to the client which features are supported
	// by the server. Any value not listed in the following table is unused. The server MUST set the unused bits to 0 in a response, and the client MUST
	// ignore these bits.
	Capabilities capabilities.Capabilities

	// The number of 100-nanosecond intervals that have elapsed since January 1, 1601, in Coordinated Universal Time (UTC) format.
	SystemTime types.FILETIME

	// A signed 16-bit signed integer that represents the server's time zone, in minutes, from UTC. The time zone of the server MUST be expressed
	// in minutes, plus or minus, from UTC.
	ServerTimeZone types.SHORT

	// This field MUST be 0x00 or 0x08. The length of the random challenge used in challenge/response authentication. If the server does not support
	// challenge/response authentication, this field MUST be 0x00. This field is often referred to in older documentation as EncryptionKeyLength.
	ChallengeLength types.UCHAR

	// An array of unsigned bytes that MUST be ChallengeLength bytes long and MUST represent the server challenge.
	// This array MUST NOT be null-terminated. This field is often referred to in older documentation as EncryptionKey.
	Challenge []types.UCHAR

	// The null-terminated name of the NT domain or workgroup to which the server belongs.
	DomainName []types.UCHAR

	// The null-terminated name of the server.
	ServerName []types.UCHAR
}

NegotiateResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/a4229e1a-8a4e-489a-a2eb-11b7f360e60c

func NewNegotiateResponse

func NewNegotiateResponse() *NegotiateResponse

NewNegotiateResponse creates a new NegotiateResponse structure

Returns: - A pointer to the new NegotiateResponse structure

func (*NegotiateResponse) GetSelectedDialect

func (c *NegotiateResponse) GetSelectedDialect(dialects dialects.Dialects) (string, error)

GetSelectedDialect returns the selected dialect from the NegotiateResponse structure

Parameters: - dialects: The dialects to search in

Returns: - The selected dialect - An error if the selected dialect is not found

func (*NegotiateResponse) Marshal

func (c *NegotiateResponse) Marshal() ([]byte, error)

Marshal marshals the NegotiateResponse structure into a byte array

Returns: - A byte array representing the NegotiateResponse structure - An error if the marshaling fails

func (*NegotiateResponse) Unmarshal

func (c *NegotiateResponse) Unmarshal(marshalledData []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtCancelRequest

type NtCancelRequest struct {
	command_interface.Command
}

NtCancelRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/e4f9bcfa-982e-43dd-8db7-92db9aac13cc

func NewNtCancelRequest

func NewNtCancelRequest() *NtCancelRequest

NewNtCancelRequest creates a new NtCancelRequest structure

Returns: - A pointer to the new NtCancelRequest structure

func (*NtCancelRequest) Marshal

func (c *NtCancelRequest) Marshal() ([]byte, error)

Marshal marshals the NtCancelRequest structure into a byte array

Returns: - A byte array representing the NtCancelRequest structure - An error if the marshaling fails

func (*NtCancelRequest) Unmarshal

func (c *NtCancelRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtCreateAndxRequest

type NtCreateAndxRequest struct {
	command_interface.Command

	// Reserved (1 byte): An unused value that SHOULD be set to 0x00 when sent and MUST be ignored on receipt.
	Reserved types.UCHAR

	// NameLength (2 bytes): This field MUST be the length of the FileName field (see following) in bytes.
	NameLength types.USHORT

	// Flags (4 bytes): A 32-bit field containing a set of flags that modify the client request. Unused bit
	// fields SHOULD be set to 0 when sent and MUST be ignored on receipt.
	Flags types.ULONG

	// RootDirectoryFID (4 bytes): If nonzero, this value is the File ID of an opened root directory, and the FileName
	// field MUST be handled as relative to the directory specified by this RootDirectoryFID. If this value is 0x00000000,
	// the FileName field MUST be handled as relative to the root of the share (the TID). The RootDirectoryFID MUST have
	// been acquired in a previous message exchange.
	RootDirectoryFID types.ULONG

	// DesiredAccess (4 bytes): A 32-bit field of flags that indicate standard, specific, and generic access rights.
	// These rights are used in access-control entries (ACEs) and are the primary means of specifying the requested or
	// granted access to an object. If this value is 0x00000000, it represents a request to query the attributes without
	// accessing the file.
	DesiredAccess types.ULONG

	// AllocationSize (8 bytes): The client MUST set this value to the initial allocation size of the file in bytes.
	// The server MUST ignore this field if this request is to open an existing file. This field MUST be used only if the
	// file is created or overwritten. The value MUST be set to 0x0000000000000000 in all other cases. This does not apply
	// to directory-related requests. This is the number of bytes to be allocated, represented as a 64-bit integer value.
	AllocationSize types.LARGE_INTEGER

	// ExtFileAttributes (4 bytes): This field contains the extended file attributes of the file being requested,
	// encoded as an SMB_EXT_FILE_ATTR (section 2.2.1.2.3) data type.
	ExtFileAttributes types.SMB_EXT_FILE_ATTR

	// ShareAccess (4 bytes): A 32-bit field that specifies how the file SHOULD be shared with other processes. The names
	// in the table below are provided for reference use only. If ShareAccess values of FILE_SHARE_READ, FILE_SHARE_WRITE, or
	// FILE_SHARE_DELETE are set for a printer file or a named pipe, the server SHOULD ignore these values. The value MUST be
	// FILE_SHARE_NONE or some combination of the other values:
	ShareAccess types.ULONG

	// CreateDisposition (4 bytes): A 32-bit value that represents the action to take if the file already exists or if the
	// file is a new file and does not already exist.
	CreateDisposition types.ULONG

	// CreateOptions (4 bytes): A 32-bit field containing flag options to use if creating the file or directory.
	// This field MUST be set to 0x00000000 or a combination of the following possible values. Unused bit fields SHOULD be
	// set to 0 when sent and MUST be ignored on receipt. The following is a list of the valid values and their associated behaviors.
	// Server implementations SHOULD reserve all bits not specified in the following definitions.
	CreateOptions types.ULONG

	// ImpersonationLevel (4 bytes): This field specifies the impersonation level requested by the application that is issuing
	// the create request, and MUST contain one of the following values.
	ImpersonationLevel types.ULONG

	// SecurityFlags (1 byte): An 8-bit field containing a set of options that specify the security tracking mode. These options
	// specify whether the server is to be given a snapshot of the client's security context (called static tracking) or is to be
	// continually updated to track changes to the client's security context (called dynamic tracking). When bit 0 of the SecurityFlags
	// field is clear, static tracking is requested. When bit 0 of the SecurityFlags field is set, dynamic tracking is requested.
	// Unused bit fields SHOULD be set to 0 when sent and MUST be ignored on receipt. This field MUST be set to 0x00 or a combination
	// of the following possible values. Value names are provided for convenience only. Supported values are:
	SecurityFlags types.UCHAR

	// FileName (variable): A string that represents the fully qualified name of the file relative to the supplied TID to create or
	// truncate on the server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB Header of the request, the FileName string
	// MUST be a null-terminated array of 16-bit Unicode characters. Otherwise, the FileName string MUST be a null-terminated array of
	// extended ASCII (OEM) characters. If the FileName string consists of Unicode characters, this field MUST be aligned to start on
	// a 2-byte boundary from the start of the SMB Header. When opening a named pipe, the FileName field MUST contain only the relative
	// name of the pipe, that is, the "\PIPE\" prefix MUST NOT be present. This is in contrast with other commands, such as
	// SMB_COM_OPEN_ANDX and TRANS2_OPEN2, which require that the "\PIPE" prefix be present in the pathname.
	FileName types.SMB_STRING
}

NtCreateAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f2a0f032-7545-41c9-9ceb-aab39852c11a

func NewNtCreateAndxRequest

func NewNtCreateAndxRequest() *NtCreateAndxRequest

NewNtCreateAndxRequest creates a new NtCreateAndxRequest structure

Returns: - A pointer to the new NtCreateAndxRequest structure

func (*NtCreateAndxRequest) IsAndX

func (c *NtCreateAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*NtCreateAndxRequest) Marshal

func (c *NtCreateAndxRequest) Marshal() ([]byte, error)

Marshal marshals the NtCreateAndxRequest structure into a byte array

Returns: - A byte array representing the NtCreateAndxRequest structure - An error if the marshaling fails

func (*NtCreateAndxRequest) Unmarshal

func (c *NtCreateAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtCreateAndxResponse

type NtCreateAndxResponse struct {
	command_interface.Command

	// OpLockLevel (1 byte): The OpLock level granted to the client process.
	OpLockLevel types.UCHAR

	// FID (2 bytes): A FID representing the file or directory that was created or opened.
	FID types.USHORT

	// CreateDisposition (4 bytes): A 32-bit value that represents the action to take if the file already exists or if
	// the file is a new file and does not already exist.
	CreateDisposition types.ULONG

	// CreateTime (8 bytes): A 64-bit integer value representing the time that the file was created. The time value is
	// a signed 64-bit integer representing either an absolute time or a time interval. Times are specified in units of 100ns.
	// A positive value expresses an absolute time, where the base time (the 64- bit integer with value 0x0000000000000000) is
	// the beginning of the year 1601 AD in the Gregorian calendar. A negative value expresses a time interval relative to some
	// base time, usually the current time.
	CreateTime types.FILETIME

	// LastAccessTime (8 bytes): The time that the file was last accessed encoded in the same format as CreateTime.
	LastAccessTime types.FILETIME

	// LastWriteTime (8 bytes): The time that the file was last written, encoded in the same format as CreateTime.
	LastWriteTime types.FILETIME

	// LastChangeTime (8 bytes): The time that the file was last changed, encoded in the same format as CreateTime.
	LastChangeTime types.FILETIME

	// ExtFileAttributes (4 bytes): This field contains the extended file attributes that the server assigned to the file or
	// directory as a result of the command, encoded as an SMB_EXT_FILE_ATTR (section 2.2.1.2.3) data type.
	ExtFileAttributes types.SMB_EXT_FILE_ATTR

	// AllocationSize (8 bytes): The number of bytes allocated to the file by the server.
	AllocationSize types.LARGE_INTEGER

	// EndOfFile (8 bytes): The end of file offset value.
	EndOfFile types.LARGE_INTEGER

	// ResourceType (2 bytes): The file type. This field MUST be interpreted as follows.
	ResourceType types.USHORT

	// NMPipeStatus (2 bytes): A 16-bit field that shows the status of the named pipe if the resource type opened is a named pipe.
	// This field is formatted as an SMB_NMPIPE_STATUS (section 2.2.1.3).
	NMPipeStatus types.SMB_NMPIPE_STATUS

	// Directory (1 byte): If the returned FID represents a directory, the server MUST set this value to a nonzero value (0x01 is commonly used).
	// If the FID is not a directory, the server MUST set this value to 0x00 (FALSE).
	Directory types.UCHAR
}

NtCreateAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/32085986-b516-486c-abbb-0abbdf9f1909

func NewNtCreateAndxResponse

func NewNtCreateAndxResponse() *NtCreateAndxResponse

NewNtCreateAndxResponse creates a new NtCreateAndxResponse structure

Returns: - A pointer to the new NtCreateAndxResponse structure

func (*NtCreateAndxResponse) IsAndX

func (c *NtCreateAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*NtCreateAndxResponse) Marshal

func (c *NtCreateAndxResponse) Marshal() ([]byte, error)

Marshal marshals the NtCreateAndxResponse structure into a byte array

Returns: - A byte array representing the NtCreateAndxResponse structure - An error if the marshaling fails

func (*NtCreateAndxResponse) Unmarshal

func (c *NtCreateAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtRenameRequest

type NtRenameRequest struct {
	command_interface.Command

	// SearchAttributes (2 bytes): This field indicates the attributes that the target file(s) MUST have. If the attribute is 0x0000,
	// then only normal files are renamed or linked. If the system file or hidden attributes are specified, then the rename is inclusive of both special types.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// InformationLevel (2 bytes): This field MUST be one of the three values shown in the following table.
	InformationLevel types.USHORT

	// Reserved (4 bytes): This field SHOULD be set to 0x00000000 by the client and MUST be ignored by the server.
	Reserved types.ULONG

	// OldFileName (variable): A null-terminated string containing the full path name of the file to be manipulated.
	// Wildcards are not supported.
	OldFileName types.SMB_STRING

	// NewFileName (variable): A null-terminated string containing the new full path name to be assigned to the file
	// provided in OldFileName or the full path into which the file is to be moved.
	NewFileName types.SMB_STRING
}

NtRenameRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/d777310e-deb1-490c-9157-26456c0b0116

func NewNtRenameRequest

func NewNtRenameRequest() *NtRenameRequest

NewNtRenameRequest creates a new NtRenameRequest structure

Returns: - A pointer to the new NtRenameRequest structure

func (*NtRenameRequest) Marshal

func (c *NtRenameRequest) Marshal() ([]byte, error)

Marshal marshals the NtRenameRequest structure into a byte array

Returns: - A byte array representing the NtRenameRequest structure - An error if the marshaling fails

func (*NtRenameRequest) Unmarshal

func (c *NtRenameRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtRenameResponse

type NtRenameResponse struct {
	command_interface.Command
}

NtRenameResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/6a71ba7f-66c0-4460-ad52-fe31d5a874ef

func NewNtRenameResponse

func NewNtRenameResponse() *NtRenameResponse

NewNtRenameResponse creates a new NtRenameResponse structure

Returns: - A pointer to the new NtRenameResponse structure

func (*NtRenameResponse) Marshal

func (c *NtRenameResponse) Marshal() ([]byte, error)

Marshal marshals the NtRenameResponse structure into a byte array

Returns: - A byte array representing the NtRenameResponse structure - An error if the marshaling fails

func (*NtRenameResponse) Unmarshal

func (c *NtRenameResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtTransactRequest

type NtTransactRequest struct {
	command_interface.Command

	// MaxSetupCount (1 byte): Maximum number of setup bytes that the client will
	// accept in the transaction reply. This field MUST be set as specified in the
	// subsections of Transaction Subcommands (section 2.2.5). The server MUST NOT
	// return more than this number of setup bytes.
	MaxSetupCount types.UCHAR

	// Reserved1 (2 bytes): Two padding bytes. This field MUST be 0x0000. This field is
	// used to align the next field to a 32-bit boundary.
	Reserved1 types.USHORT

	// TotalParameterCount (4 bytes): The total number of SMB_COM_NT_TRANSACT parameter
	// bytes to be sent in this transaction request. This value MAY be reduced in any
	// or all subsequent SMB_COM_NT_TRANSACT_SECONDARY requests that are part of the
	// same transaction. This value represents transaction parameter bytes, not SMB
	// parameter words. Transaction parameter bytes are carried in the SMB_Data block
	// of the SMB_COM_NT_TRANSACT request or in subsequent
	// SMB_COM_NT_TRANSACT_SECONDARY requests.
	TotalParameterCount types.ULONG

	// TotalDataCount (4 bytes): The total number of SMB_COM_NT_TRANSACT data bytes to
	// be sent in this transaction request. This value MAY be reduced in any or all
	// subsequent SMB_COM_NT_TRANSACT_SECONDARY requests that are part of the same
	// transaction. This value represents transaction data bytes, not SMB data bytes.
	TotalDataCount types.ULONG

	// MaxParameterCount (4 bytes): The maximum number of parameter bytes that the
	// client will accept in the transaction reply. This field MUST be set as specified
	// in the subsections of Transaction Subcommands. The server MUST NOT return more
	// than this number of parameter bytes.
	MaxParameterCount types.ULONG

	// MaxDataCount (4 bytes): The maximum number of data bytes that the client will
	// accept in the transaction reply. This field MUST be set as specified in the
	// subsections of Transaction Subcommands. The server MUST NOT return more than
	// this number of data bytes.
	MaxDataCount types.ULONG

	// ParameterCount (4 bytes): The number of transaction parameter bytes being sent
	// in this SMB message. If the transaction fits within a single SMB_COM_NT_TRANSACT
	// request, this value MUST be equal to TotalParameterCount. Otherwise, the sum of
	// the ParameterCount values in the primary and secondary transaction request
	// messages MUST be equal to the smallest TotalParameterCount value reported to the
	// server. If the value of this field is less than the value of
	// TotalParameterCount, then at least one SMB_COM_NT_TRANSACT_SECONDARY message
	// MUST be used to transfer the remaining parameter bytes.
	ParameterCount types.ULONG

	// ParameterOffset (4 bytes): The offset, in bytes, from the start of the
	// SMB_Header to the transaction parameter bytes. This MUST be the number of bytes
	// from the start of the SMB message to the start of the SMB_Data.Bytes.Parameters
	// field. Server implementations MUST use this value to locate the transaction
	// parameter block within the SMB message. If ParameterCount is zero, the
	// client/server MAY set this field to zero.
	ParameterOffset types.ULONG

	// DataCount (4 bytes): The number of transaction data bytes being sent in this SMB
	// message. If the transaction fits within a single SMB_COM_NT_TRANSACT request,
	// then this value MUST be equal to TotalDataCount. Otherwise, the sum of the
	// DataCount values in the primary and secondary transaction request messages MUST
	// be equal to the smallest TotalDataCount value reported to the server. If the
	// value of this field is less than the value of TotalDataCount, then at least one
	// SMB_COM_NT_TRANSACT_SECONDARY message MUST be used to transfer the remaining
	// data bytes.
	DataCount types.ULONG

	// DataOffset (4 bytes): The offset, in bytes, from the start of the SMB Header
	// (section 2.2.3.1) to the transaction data bytes. This MUST be the number of
	// bytes from the start of the SMB message to the start of the SMB_Data.Bytes.Data
	// field. Server implementations MUST use this value to locate the transaction data
	// block within the SMB message. If DataCount is zero, the client/server MAY set
	// this field to zero.
	DataOffset types.ULONG

	// SetupCount (1 byte): The number of setup words that are included in the
	// transaction request.
	SetupCount types.UCHAR

	// Function (2 bytes): The transaction subcommand code, which is used to identify
	// the operation to be performed by the server.
	Function types.USHORT

	// Pad1 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad1 []types.UCHAR

	// NT_Trans_Parameters (variable): Transaction parameter bytes. See the individual
	// SMB_COM_NT_TRANSACT subcommand descriptions for information on parameters sent for
	// each subcommand.
	NT_Trans_Parameters []types.UCHAR

	// Pad2 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server, and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// NT_Trans_Data (variable): Transaction data bytes. See the individual
	// SMB_COM_NT_TRANSACT subcommand descriptions for information on data sent
	// for each subcommand.
	NT_Trans_Data []types.UCHAR
}

NtTransactRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1e62725c-bb9e-4704-99a4-8db520a6f2da

func NewNtTransactRequest

func NewNtTransactRequest() *NtTransactRequest

NewNtTransactRequest creates a new NtTransactRequest structure

Returns: - A pointer to the new NtTransactRequest structure

func (*NtTransactRequest) Marshal

func (c *NtTransactRequest) Marshal() ([]byte, error)

Marshal marshals the NtTransactRequest structure into a byte array

Returns: - A byte array representing the NtTransactRequest structure - An error if the marshaling fails

func (*NtTransactRequest) Unmarshal

func (c *NtTransactRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtTransactResponse

type NtTransactResponse struct {
	command_interface.Command
}

NtTransactResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/dd00c842-2398-412f-b21d-bf5074a9a1c4

func NewNtTransactResponse

func NewNtTransactResponse() *NtTransactResponse

NewNtTransactResponse creates a new NtTransactResponse structure

Returns: - A pointer to the new NtTransactResponse structure

func (*NtTransactResponse) Marshal

func (c *NtTransactResponse) Marshal() ([]byte, error)

Marshal marshals the NtTransactResponse structure into a byte array

Returns: - A byte array representing the NtTransactResponse structure - An error if the marshaling fails

func (*NtTransactResponse) Unmarshal

func (c *NtTransactResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtTransactSecondaryRequest

type NtTransactSecondaryRequest struct {
	command_interface.Command

	// TotalParameterCount (4 bytes): The total number of transaction parameter bytes
	// to be sent to the server over the course of this transaction. This value MAY be
	// less than or equal to the TotalParameterCount in preceding request messages that
	// are part of the same transaction. This value represents transaction parameter
	// bytes, not SMB parameter words.
	TotalParameterCount types.ULONG

	// TotalDataCount (4 bytes): The total number of transaction data bytes to be sent
	// to the server over the course of this transaction. This value MAY be less than
	// or equal to the TotalDataCount in preceding request messages that are part of
	// the same transaction. This value represents transaction data bytes, not SMB data
	// bytes.
	TotalDataCount types.ULONG

	// ParameterCount (4 bytes): The number of transaction parameter bytes being sent
	// in the SMB message. This value MUST be less than TotalParameterCount. The sum of
	// the ParameterCount values across all of the request messages in a transaction
	// MUST be equal to the TotalParameterCount reported in the last request message of
	// the transaction.
	ParameterCount types.ULONG

	// ParameterOffset (4 bytes): The offset, in bytes, from the start of the
	// SMB_Header to the transaction parameter bytes contained in this SMB message.
	// This MUST be the number of bytes from the start of the SMB message to the start
	// of the SMB_Data.Bytes.Parameters field. Server implementations MUST use this
	// value to locate the transaction parameter block within the SMB message. If
	// ParameterCount is zero, the client/server MAY set this field to zero.
	ParameterOffset types.ULONG

	ParameterDisplacement types.ULONG

	// DataCount (4 bytes): The number of transaction data bytes being sent in this SMB
	// message. This value MUST be less than the value of TotalDataCount. The sum of
	// the DataCount values across all of the request messages in a transaction MUST be
	// equal to the smallest TotalDataCount value reported to the server.
	DataCount types.ULONG

	// DataOffset (4 bytes): The offset, in bytes, from the start of the SMB_Header to
	// the transaction data bytes contained in this SMB message. This MUST be the
	// number of bytes from the start of the SMB message to the start of the
	// SMB_Data.Bytes.Data field. Server implementations MUST use this value to locate
	// the transaction data block within the SMB message. If DataCount is zero, the
	// client/server MAY set this field to zero.
	DataOffset types.ULONG

	// DataDisplacement (4 bytes): The offset, relative to all of the transaction data
	// bytes sent to the server in this transaction, at which this block of parameter
	// bytes MUST be placed. This value can be used by the server to correctly
	// reassemble the transaction data block even if the SMB request messages are
	// received out of order.
	DataDisplacement types.ULONG

	// Reserved2 (1 byte): Reserved. MUST be 0x00. The server MUST ignore the contents
	// of this field.
	Reserved2 types.UCHAR

	// Pad1 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad1 []types.UCHAR

	// NT_Trans_Parameters (variable): Transaction parameter bytes. See the individual
	// SMB_COM_NT_TRANSACT subcommand descriptions for information on parameters sent for
	// each subcommand.
	NT_Trans_Parameters []types.UCHAR

	// Pad2 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server, and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// NT_Trans_Data (variable): Transaction data bytes. See the individual
	// SMB_COM_NT_TRANSACT subcommand descriptions for information on data sent
	// for each subcommand.
	NT_Trans_Data []types.UCHAR
}

NtTransactSecondaryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/4173c449-a6e1-4fa9-b980-708a229fdb3a

func NewNtTransactSecondaryRequest

func NewNtTransactSecondaryRequest() *NtTransactSecondaryRequest

NewNtTransactSecondaryRequest creates a new NtTransactSecondaryRequest structure

Returns: - A pointer to the new NtTransactSecondaryRequest structure

func (*NtTransactSecondaryRequest) Marshal

func (c *NtTransactSecondaryRequest) Marshal() ([]byte, error)

Marshal marshals the NtTransactSecondaryRequest structure into a byte array

Returns: - A byte array representing the NtTransactSecondaryRequest structure - An error if the marshaling fails

func (*NtTransactSecondaryRequest) Unmarshal

func (c *NtTransactSecondaryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type NtTransactSecondaryResponse

type NtTransactSecondaryResponse struct {
	command_interface.Command
}

NtTransactSecondaryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/bf9025c9-2c30-49ec-9573-1838ca255c90

func NewNtTransactSecondaryResponse

func NewNtTransactSecondaryResponse() *NtTransactSecondaryResponse

NewNtTransactSecondaryResponse creates a new NtTransactSecondaryResponse structure

Returns: - A pointer to the new NtTransactSecondaryResponse structure

func (*NtTransactSecondaryResponse) Marshal

func (c *NtTransactSecondaryResponse) Marshal() ([]byte, error)

Marshal marshals the NtTransactSecondaryResponse structure into a byte array

Returns: - A byte array representing the NtTransactSecondaryResponse structure - An error if the marshaling fails

func (*NtTransactSecondaryResponse) Unmarshal

func (c *NtTransactSecondaryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenAndxRequest

type OpenAndxRequest struct {
	command_interface.Command

	// Flags (2 bytes): A 16-bit field of flags for requesting attribute data and
	// locking.
	Flags types.USHORT

	// AccessMode (2 bytes): A 16-bit field for encoding the requested access mode. See
	// section 3.2.4.5.1 for a discussion on sharing modes.
	AccessMode types.USHORT

	// SearchAttrs (2 bytes): The set of attributes that the file MUST have in order to
	// be found. If none of the attribute bytes is set, the file attributes MUST refer
	// to a regular file.
	SearchAttrs types.SMB_FILE_ATTRIBUTES

	// FileAttrs (2 bytes): The set of attributes that the file is to have if the file
	// needs to be created. If none of the attribute bytes is set, the file attributes
	// MUST refer to a regular file.
	FileAttrs types.SMB_FILE_ATTRIBUTES

	// CreationTime (4 bytes): A 32-bit integer time value to be assigned to the file
	// as the time of creation if the file is created.
	CreationTime types.FILETIME

	// OpenMode (2 bytes): A 16-bit field that controls the way a file SHOULD be
	// treated when it is opened for use by certain extended SMB requests.
	OpenMode types.USHORT

	// AllocationSize (4 bytes): The number of bytes to reserve on file creation or
	// truncation. This field MAY be ignored by the server.
	AllocationSize types.ULONG

	// Timeout (4 bytes): This field is a 32-bit unsigned integer value containing the
	// number of milliseconds to wait on a blocked open request before returning
	// without successfully opening the file.
	Timeout types.ULONG

	// Reserved (2 bytes): Reserved and MUST be set to 0x0000.
	Reserved [2]types.USHORT

	// FileName (variable): A buffer containing the name of the file to be opened.
	FileName types.SMB_STRING
}

OpenAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3a760987-f60d-4012-930b-fe90328775cc

func NewOpenAndxRequest

func NewOpenAndxRequest() *OpenAndxRequest

NewOpenAndxRequest creates a new OpenAndxRequest structure

Returns: - A pointer to the new OpenAndxRequest structure

func (*OpenAndxRequest) IsAndX

func (c *OpenAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*OpenAndxRequest) Marshal

func (c *OpenAndxRequest) Marshal() ([]byte, error)

Marshal marshals the OpenAndxRequest structure into a byte array

Returns: - A byte array representing the OpenAndxRequest structure - An error if the marshaling fails

func (*OpenAndxRequest) Unmarshal

func (c *OpenAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenAndxResponse

type OpenAndxResponse struct {
	command_interface.Command

	// FID (2 bytes): A valid FID representing the open instance of the file.
	FID types.USHORT

	// FileAttrs (2 bytes): The actual file system attributes of the file. If none of
	// the attribute bytes is set, the file attributes refer to a regular file.
	FileAttrs types.SMB_FILE_ATTRIBUTES

	// LastWriteTime (4 bytes): A 32-bit integer time value of the last modification to
	// the file.
	LastWriteTime types.FILETIME

	// FileDataSize (4 bytes): The number of bytes in the file. This field is advisory
	// and MAY be used.
	FileDataSize types.ULONG

	// AccessRights (2 bytes): A 16-bit field that shows granted access rights to the
	// file.
	AccessRights types.USHORT

	// ResourceType (2 bytes): A 16-bit field that shows the resource type opened.
	ResourceType types.USHORT

	// NMPipeStatus (2 bytes): A 16-bit field that contains the status of the named
	// pipe if the resource type opened is a named pipe.
	NMPipeStatus types.SMB_NMPIPE_STATUS

	// OpenResults (2 bytes): A 16-bit field that shows the results of the open operation.
	OpenResults types.USHORT

	// Reserved (6 bytes): Reserved and MUST be set to 0x00000000000000.
	Reserved [3]types.USHORT
}

OpenAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/dbce00e7-68a1-41c6-982d-9483c902ad9b

func NewOpenAndxResponse

func NewOpenAndxResponse() *OpenAndxResponse

NewOpenAndxResponse creates a new OpenAndxResponse structure

Returns: - A pointer to the new OpenAndxResponse structure

func (*OpenAndxResponse) IsAndX

func (c *OpenAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*OpenAndxResponse) Marshal

func (c *OpenAndxResponse) Marshal() ([]byte, error)

Marshal marshals the OpenAndxResponse structure into a byte array

Returns: - A byte array representing the OpenAndxResponse structure - An error if the marshaling fails

func (*OpenAndxResponse) Unmarshal

func (c *OpenAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenPrintFileRequest

type OpenPrintFileRequest struct {
	command_interface.Command

	// SetupLength (2 bytes): Length, in bytes, of the printer-specific control data
	// that is to be included as the first part of the spool file. The server MUST pass
	// this initial portion of the spool file to the printer unmodified.
	SetupLength types.USHORT

	// Mode (2 bytes): A 16-bit field that contains a flag that specifies the print
	// file mode.
	Mode types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x04, representing an ASCII string.
	// Identifier (variable): A null-terminated string containing a suggested name for
	// the spool file. The server can ignore, modify, or use this information to
	// identify the print job.
	Identifier types.SMB_STRING
}

OpenPrintFileRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/a0199848-ec12-4408-9812-88a5f1c30ceb

func NewOpenPrintFileRequest

func NewOpenPrintFileRequest() *OpenPrintFileRequest

NewOpenPrintFileRequest creates a new OpenPrintFileRequest structure

Returns: - A pointer to the new OpenPrintFileRequest structure

func (*OpenPrintFileRequest) Marshal

func (c *OpenPrintFileRequest) Marshal() ([]byte, error)

Marshal marshals the OpenPrintFileRequest structure into a byte array

Returns: - A byte array representing the OpenPrintFileRequest structure - An error if the marshaling fails

func (*OpenPrintFileRequest) Unmarshal

func (c *OpenPrintFileRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenPrintFileResponse

type OpenPrintFileResponse struct {
	command_interface.Command

	// FID (2 bytes): The returned file handle that MUST be used by subsequent write
	// and close operations on the spool file. When the spool file is closed, the file
	// is queued and printed.
	FID types.USHORT
}

OpenPrintFileResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/fb4c1ba4-4269-47ff-8e43-02f3577190db

func NewOpenPrintFileResponse

func NewOpenPrintFileResponse() *OpenPrintFileResponse

NewOpenPrintFileResponse creates a new OpenPrintFileResponse structure

Returns: - A pointer to the new OpenPrintFileResponse structure

func (*OpenPrintFileResponse) Marshal

func (c *OpenPrintFileResponse) Marshal() ([]byte, error)

Marshal marshals the OpenPrintFileResponse structure into a byte array

Returns: - A byte array representing the OpenPrintFileResponse structure - An error if the marshaling fails

func (*OpenPrintFileResponse) Unmarshal

func (c *OpenPrintFileResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenRequest

type OpenRequest struct {
	command_interface.Command

	// AccessMode (2 bytes): A 16-bit field for encoding the requested access mode. See
	// section 3.2.4.5.1 for a discussion on sharing modes.
	AccessMode types.USHORT

	// SearchAttributes (2 bytes): Specifies the type of file. This field is used as a
	// search mask. Both the FileName and the SearchAttributes of a file MUST match in
	// order for the file to be opened.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// FileName (variable): A null-terminated string containing the file name of the
	// file to be opened.
	FileName types.SMB_STRING
}

OpenRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/ab9bb872-1967-4088-b444-6a35d0af305e

func NewOpenRequest

func NewOpenRequest() *OpenRequest

NewOpenRequest creates a new OpenRequest structure

Returns: - A pointer to the new OpenRequest structure

func (*OpenRequest) Marshal

func (c *OpenRequest) Marshal() ([]byte, error)

Marshal marshals the OpenRequest structure into a byte array

Returns: - A byte array representing the OpenRequest structure - An error if the marshaling fails

func (*OpenRequest) Unmarshal

func (c *OpenRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type OpenResponse

type OpenResponse struct {
	command_interface.Command

	// FID (2 bytes): The FID returned for the open file.
	FID types.USHORT

	// FileAttrs (2 bytes): The set of attributes currently assigned to the file. This
	// field is formatted in the same way as the SearchAttributes field in the request.
	FileAttrs types.SMB_FILE_ATTRIBUTES

	// LastModified (4 bytes): The time of the last modification to the opened file.
	LastModified types.FILETIME

	// FileSize (4 bytes): The current size of the opened file, in bytes.
	FileSize types.ULONG

	// AccessMode (2 bytes): A 16-bit field for encoding the granted access mode. This
	// field is formatted in the same way as the Request equivalent.
	AccessMode types.USHORT
}

OpenResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/20829e08-c77a-42f3-b427-2ef87d3cf212

func NewOpenResponse

func NewOpenResponse() *OpenResponse

NewOpenResponse creates a new OpenResponse structure

Returns: - A pointer to the new OpenResponse structure

func (*OpenResponse) Marshal

func (c *OpenResponse) Marshal() ([]byte, error)

Marshal marshals the OpenResponse structure into a byte array

Returns: - A byte array representing the OpenResponse structure - An error if the marshaling fails

func (*OpenResponse) Unmarshal

func (c *OpenResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ProcessExitRequest

type ProcessExitRequest struct {
	command_interface.Command
}

ProcessExitRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/bb004a18-34b6-47f3-a1d1-f1dfe441a222

func NewProcessExitRequest

func NewProcessExitRequest() *ProcessExitRequest

NewProcessExitRequest creates a new ProcessExitRequest structure

Returns: - A pointer to the new ProcessExitRequest structure

func (*ProcessExitRequest) Marshal

func (c *ProcessExitRequest) Marshal() ([]byte, error)

Marshal marshals the ProcessExitRequest structure into a byte array

Returns: - A byte array representing the ProcessExitRequest structure - An error if the marshaling fails

func (*ProcessExitRequest) Unmarshal

func (c *ProcessExitRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ProcessExitResponse

type ProcessExitResponse struct {
	command_interface.Command
}

ProcessExitResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/343fc704-52db-48a5-b999-439e134c1c9d

func NewProcessExitResponse

func NewProcessExitResponse() *ProcessExitResponse

NewProcessExitResponse creates a new ProcessExitResponse structure

Returns: - A pointer to the new ProcessExitResponse structure

func (*ProcessExitResponse) Marshal

func (c *ProcessExitResponse) Marshal() ([]byte, error)

Marshal marshals the ProcessExitResponse structure into a byte array

Returns: - A byte array representing the ProcessExitResponse structure - An error if the marshaling fails

func (*ProcessExitResponse) Unmarshal

func (c *ProcessExitResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformation2Request

type QueryInformation2Request struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid FID that the client has obtained
	// through a previous SMB command that successfully opened the file.
	FID types.USHORT
}

QueryInformation2Request Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/7b86f799-9dbb-4078-93c5-f9041c7f9f47

func NewQueryInformation2Request

func NewQueryInformation2Request() *QueryInformation2Request

NewQueryInformation2Request creates a new QueryInformation2Request structure

Returns: - A pointer to the new QueryInformation2Request structure

func (*QueryInformation2Request) Marshal

func (c *QueryInformation2Request) Marshal() ([]byte, error)

Marshal marshals the QueryInformation2Request structure into a byte array

Returns: - A byte array representing the QueryInformation2Request structure - An error if the marshaling fails

func (*QueryInformation2Request) Unmarshal

func (c *QueryInformation2Request) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformation2Response

type QueryInformation2Response struct {
	command_interface.Command

	// CreateDate (2 bytes): This field is the date when the file was created.
	CreateDate types.SMB_DATE

	// CreateTime (2 bytes): This field is the time on CreateDate when the file was created.
	CreationTime types.SMB_TIME

	// LastAccessDate (2 bytes): This field is the date when the file was last accessed.
	LastAccessDate types.SMB_DATE

	// LastAccessTime (2 bytes): This field is the time on LastAccessDate when the file was last accessed.
	LastAccessTime types.SMB_TIME

	// LastWriteDate (2 bytes): This field is the date when data was last written to the file.
	LastWriteDate types.SMB_DATE

	// LastWriteTime (2 bytes): This field is the time on LastWriteDate when data was last written to the file.
	LastWriteTime types.SMB_TIME

	// FileDataSize (4 bytes): This field contains the number of bytes in the file, in bytes. Because this size
	// is limited to 32 bits, this command is inappropriate for files whose size is too large.
	FileDataSize types.ULONG

	// FileAllocationSize (4 bytes): This field contains the allocation size of the file, in bytes. Because
	// this size is limited to 32 bits, this command is inappropriate for files whose size is too large.
	FileAllocationSize types.ULONG

	// FileAttributes (2 bytes): This field is a 16-bit unsigned bit field encoding the attributes of the file.
	FileAttributes types.SMB_FILE_ATTRIBUTES
}

QueryInformation2Response Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/eed3d7c3-759e-470a-8731-10583931426f

func NewQueryInformation2Response

func NewQueryInformation2Response() *QueryInformation2Response

NewQueryInformation2Response creates a new QueryInformation2Response structure

Returns: - A pointer to the new QueryInformation2Response structure

func (*QueryInformation2Response) Marshal

func (c *QueryInformation2Response) Marshal() ([]byte, error)

Marshal marshals the QueryInformation2Response structure into a byte array

Returns: - A byte array representing the QueryInformation2Response structure - An error if the marshaling fails

func (*QueryInformation2Response) Unmarshal

func (c *QueryInformation2Response) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformationDiskRequest

type QueryInformationDiskRequest struct {
	command_interface.Command
}

QueryInformationDiskRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/711abf8c-b5a3-43e7-8213-ef37b9f9cb00

func NewQueryInformationDiskRequest

func NewQueryInformationDiskRequest() *QueryInformationDiskRequest

NewQueryInformationDiskRequest creates a new QueryInformationDiskRequest structure

Returns: - A pointer to the new QueryInformationDiskRequest structure

func (*QueryInformationDiskRequest) Marshal

func (c *QueryInformationDiskRequest) Marshal() ([]byte, error)

Marshal marshals the QueryInformationDiskRequest structure into a byte array

Returns: - A byte array representing the QueryInformationDiskRequest structure - An error if the marshaling fails

func (*QueryInformationDiskRequest) Unmarshal

func (c *QueryInformationDiskRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformationDiskResponse

type QueryInformationDiskResponse struct {
	command_interface.Command

	// TotalUnits (2 bytes): This field is a 16-bit unsigned value that represents the
	// total count of logical allocation units available on the volume.
	TotalUnits types.USHORT

	// BlocksPerUnit (2 bytes): This field is a 16-bit unsigned value that represents
	// the number of blocks per allocation unit for the volume.
	BlocksPerUnit types.USHORT

	// BlockSize (2 bytes): This field is a 16-bit unsigned value that represents the
	// size in bytes of each allocation unit for the volume.
	BlockSize types.USHORT

	// FreeUnits (2 bytes): This field is a 16-bit unsigned value that represents the
	// total number of free allocation units available on the volume.
	FreeUnits types.USHORT

	// Reserved (2 bytes): This field is a 16-bit unsigned field and is reserved. The
	// client SHOULD ignore this field.
	Reserved types.USHORT
}

QueryInformationDiskResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3d5291fd-33f5-4899-b3ad-949b0d4d7f93

func NewQueryInformationDiskResponse

func NewQueryInformationDiskResponse() *QueryInformationDiskResponse

NewQueryInformationDiskResponse creates a new QueryInformationDiskResponse structure

Returns: - A pointer to the new QueryInformationDiskResponse structure

func (*QueryInformationDiskResponse) Marshal

func (c *QueryInformationDiskResponse) Marshal() ([]byte, error)

Marshal marshals the QueryInformationDiskResponse structure into a byte array

Returns: - A byte array representing the QueryInformationDiskResponse structure - An error if the marshaling fails

func (*QueryInformationDiskResponse) Unmarshal

func (c *QueryInformationDiskResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformationRequest

type QueryInformationRequest struct {
	command_interface.Command

	// FileName (variable): A null-terminated string that represents the fully
	// qualified name of the file relative to the supplied TID. This is the file for
	// which attributes are queried and returned.
	FileName types.SMB_STRING
}

QueryInformationRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/fc708fd3-b133-415c-9659-b0acf5f596c7

func NewQueryInformationRequest

func NewQueryInformationRequest() *QueryInformationRequest

NewQueryInformationRequest creates a new QueryInformationRequest structure

Returns: - A pointer to the new QueryInformationRequest structure

func (*QueryInformationRequest) Marshal

func (c *QueryInformationRequest) Marshal() ([]byte, error)

Marshal marshals the QueryInformationRequest structure into a byte array

Returns: - A byte array representing the QueryInformationRequest structure - An error if the marshaling fails

func (*QueryInformationRequest) Unmarshal

func (c *QueryInformationRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type QueryInformationResponse

type QueryInformationResponse struct {
	command_interface.Command

	// FileAttributes (2 bytes): This field is a 16-bit unsigned bit field encoded as
	// SMB_FILE_ATTRIBUTES (see section 2.2.1.2.4).
	FileAttributes types.SMB_FILE_ATTRIBUTES

	// LastWriteTime (4 bytes): The time of the last write to the file.
	LastWriteTime types.FILETIME

	// FileSize (4 bytes): This field contains the size of the file, in bytes. Because
	// this size is limited to 32 bits, this command is inappropriate for files whose
	// size is too large.
	FileSize types.ULONG

	// Reserved (10 bytes): This field is reserved, and all entries MUST be set to 0x00.
	Reserved [5]types.USHORT
}

QueryInformationResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/847573c9-cbe6-4dcb-a0db-9b5af815759b

func NewQueryInformationResponse

func NewQueryInformationResponse() *QueryInformationResponse

NewQueryInformationResponse creates a new QueryInformationResponse structure

Returns: - A pointer to the new QueryInformationResponse structure

func (*QueryInformationResponse) Marshal

func (c *QueryInformationResponse) Marshal() ([]byte, error)

Marshal marshals the QueryInformationResponse structure into a byte array

Returns: - A byte array representing the QueryInformationResponse structure - An error if the marshaling fails

func (*QueryInformationResponse) Unmarshal

func (c *QueryInformationResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadAndxRequest

type ReadAndxRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid FID indicating the file from which the
	// data MUST be read.
	FID types.USHORT

	// Offset (4 bytes): If WordCount is 0x0A, this field represents a 32-bit offset,
	// measured in bytes, of where the read MUST start relative to the beginning of the
	// file. If WordCount is 0x0C, this field represents the lower 32 bits of a 64-bit
	// offset.
	Offset types.ULONG

	// MaxCountOfBytesToReturn (2 bytes): This field represents the maximum number of
	// bytes that the client is willing to receive.
	MaxCountOfBytesToReturn types.USHORT

	// MinCountOfBytesToReturn (2 bytes): This field represents the minimum number of
	// bytes that the client is willing to receive.
	MinCountOfBytesToReturn types.USHORT

	// Timeout (4 bytes): This field represents the amount of time, in milliseconds,
	// that a server MUST wait before sending a response. It is used only when reading
	// from a named pipe or I/O device and does not apply when reading from a regular
	// file.
	Timeout types.ULONG

	// Remaining (2 bytes): Count of bytes remaining to satisfy client's read request.
	// This field is not used in the NT LAN Manager dialect. Clients MUST set this
	// field to 0x0000, and servers MUST ignore it.
	Remaining types.USHORT
}

ReadAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/7e6c7cc2-c3f1-4335-8263-d7412f77140e

func NewReadAndxRequest

func NewReadAndxRequest() *ReadAndxRequest

NewReadAndxRequest creates a new ReadAndxRequest structure

Returns: - A pointer to the new ReadAndxRequest structure

func (*ReadAndxRequest) IsAndX

func (c *ReadAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*ReadAndxRequest) Marshal

func (c *ReadAndxRequest) Marshal() ([]byte, error)

Marshal marshals the ReadAndxRequest structure into a byte array

Returns: - A byte array representing the ReadAndxRequest structure - An error if the marshaling fails

func (*ReadAndxRequest) Unmarshal

func (c *ReadAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadAndxResponse

type ReadAndxResponse struct {
	command_interface.Command

	// Available (2 bytes): This field is valid when reading from named pipes. This
	// field indicates the number of bytes remaining to be read after the requested
	// read was completed.
	Available types.USHORT

	// DataCompactionMode (2 bytes): Reserved and MUST be 0x0000.
	DataCompactionMode types.USHORT

	// Reserved1 (2 bytes): This field MUST be 0x0000.
	Reserved1 types.USHORT

	// DataLength (2 bytes): The number of data bytes included in the response. If this
	// value is less than the value in the
	// Request.SMB_Parameters.MaxCountOfBytesToReturn field, it indicates that the read
	// operation has reached the end of the file (EOF).
	DataLength types.USHORT

	// DataOffset (2 bytes): The offset in bytes from the header of the read data.
	DataOffset types.USHORT
}

ReadAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/89d6b552-5406-445c-85d5-54c80b94a20f

func NewReadAndxResponse

func NewReadAndxResponse() *ReadAndxResponse

NewReadAndxResponse creates a new ReadAndxResponse structure

Returns: - A pointer to the new ReadAndxResponse structure

func (*ReadAndxResponse) IsAndX

func (c *ReadAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*ReadAndxResponse) Marshal

func (c *ReadAndxResponse) Marshal() ([]byte, error)

Marshal marshals the ReadAndxResponse structure into a byte array

Returns: - A byte array representing the ReadAndxResponse structure - An error if the marshaling fails

func (*ReadAndxResponse) Unmarshal

func (c *ReadAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadMpxRequest

type ReadMpxRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file from which the data MUST be read.
	FID types.USHORT

	// Offset (4 bytes): The offset, in bytes, from the start of the file at which the
	// read begins.
	Offset types.ULONG

	// MaxCountOfBytesToReturn (2 bytes): This field represents the maximum number of
	// bytes that the client is willing to receive.
	MaxCountOfBytesToReturn types.USHORT

	// MinCountOfBytesToReturn (2 bytes): This field represents the minimum number of
	// bytes that the client is willing to receive.
	MinCountOfBytesToReturn types.USHORT

	// Timeout (4 bytes): The number of milliseconds that the server is requested to
	// wait while processing this command. This field is optionally honored only when
	// reading from a named pipe or I/O device. It does not apply when reading from a
	// regular file.
	Timeout types.ULONG

	// Reserved (2 bytes): This field MUST be set to 0x0000.
	Reserved types.USHORT
}

ReadMpxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3e066ba0-9fce-43c7-85fd-756e4721f7ee

func NewReadMpxRequest

func NewReadMpxRequest() *ReadMpxRequest

NewReadMpxRequest creates a new ReadMpxRequest structure

Returns: - A pointer to the new ReadMpxRequest structure

func (*ReadMpxRequest) Marshal

func (c *ReadMpxRequest) Marshal() ([]byte, error)

Marshal marshals the ReadMpxRequest structure into a byte array

Returns: - A byte array representing the ReadMpxRequest structure - An error if the marshaling fails

func (*ReadMpxRequest) Unmarshal

func (c *ReadMpxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadMpxResponse

type ReadMpxResponse struct {
	command_interface.Command

	// Offset (4 bytes): The offset, in bytes, from the start of the file at which the
	// read occurred.
	Offset types.ULONG

	// Count (2 bytes): The total number of bytes designated to be returned in all
	// responses to this request. This value usually starts at MaxCountOfBytesToReturn,
	// but can be an overestimate. The overestimate can be reduced while the read is in
	// progress. The last response generated by the server MUST contain the actual
	// total number of bytes read and sent to the client in all of the responses. If
	// the value in the last response is less than MaxCountOfBytesToReturn, the end of
	// file was encountered during the read. If this value is exactly zero (0x0000),
	// the original Offset into the file began at or after the end of file; in this
	// case, only one response MUST be generated. The value of the field can (and
	// usually does) exceed the negotiated buffer size.
	Count types.USHORT

	// Remaining (2 bytes): This integer MUST be -1 for regular files. For I/O devices
	// or named pipes, this indicates the number of bytes remaining to be read from the
	// file after the bytes returned in the response were de-queued. Servers SHOULD
	// return 0xFFFF if they do not support this function on I/O devices or named
	// pipes.
	Remaining types.USHORT

	// DataCompactionMode (2 bytes): Not used and MUST be 0x0000.
	DataCompactionMode types.USHORT

	// Reserved (2 bytes): This field MUST be set to 0x0000.
	Reserved types.USHORT

	// DataLength (2 bytes): This field is the number of bytes read and included in the
	// response. The value of this field MUST NOT cause the message to exceed the
	// client's maximum buffer size as specified in MaxBufferSize of the
	// SMB_COM_SESSION_SETUP_ANDX (section 2.2.4.53) client request.
	DataLength types.USHORT

	// DataOffset (2 bytes): The offset, in bytes, from the beginning of the SMB Header
	// (section 2.2.3.1) to the start of the Buffer field in the SMB_Data.block.
	DataOffset types.USHORT

	// Pad (variable): Padding bytes to align data on a proper address boundary. The
	// DataOffset field points to the first byte after this field.
	Pad []types.UCHAR

	// Data (variable): The data read from the file.
	Data []types.UCHAR
}

ReadMpxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/4511aa9b-411b-44f7-8143-39f2ca6dcd5f

func NewReadMpxResponse

func NewReadMpxResponse() *ReadMpxResponse

NewReadMpxResponse creates a new ReadMpxResponse structure

Returns: - A pointer to the new ReadMpxResponse structure

func (*ReadMpxResponse) Marshal

func (c *ReadMpxResponse) Marshal() ([]byte, error)

Marshal marshals the ReadMpxResponse structure into a byte array

Returns: - A byte array representing the ReadMpxResponse structure - An error if the marshaling fails

func (*ReadMpxResponse) Unmarshal

func (c *ReadMpxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadRawRequest

type ReadRawRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit signed integer indicating the
	// file from which the data MUST be read.
	FID types.USHORT

	// Offset (4 bytes): The offset, in bytes, from the start of the file at which the
	// read MUST begin. This is the lower 32 bits of a 64-bit value if the WordCount is
	// 0x0A.
	Offset types.ULONG

	// MaxCountOfBytesToReturn (2 bytes): The requested maximum number of bytes to read
	// from the file and return to the client. The value MAY exceed the negotiated buffer
	// size.
	MaxCountOfBytesToReturn types.USHORT

	// MinCountOfBytesToReturn (2 bytes): The requested minimum number of bytes to read
	// from the file and return to the client. This field is used only when reading from
	// a named pipe or a device. It is ignored when reading from a standard file.
	MinCountOfBytesToReturn types.USHORT

	// Timeout (4 bytes): The number of milliseconds that the server is requested to
	// wait while processing this command. This field is optionally honored only when
	// reading from a named pipe or I/O device. It does not apply when reading from a
	// regular file.
	Timeout types.ULONG

	// Reserved (2 bytes): This field SHOULD be set to 0x0000.
	Reserved types.USHORT

	// OffsetHigh (4 bytes): This field is optional, and is included only when WordCount
	// is 0x0A. This field is the upper 32 bits of the offset, in bytes, from the start of
	// the file at which the read MUST start. This field allows the client request to
	// specify 64-bit file offsets.
	OffsetHigh types.ULONG
}

ReadRawRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1458b62a-18ed-4fb2-b8a9-ceabffb2c3b7

func NewReadRawRequest

func NewReadRawRequest() *ReadRawRequest

NewReadRawRequest creates a new ReadRawRequest structure

Returns: - A pointer to the new ReadRawRequest structure

func (*ReadRawRequest) Marshal

func (c *ReadRawRequest) Marshal() ([]byte, error)

Marshal marshals the ReadRawRequest structure into a byte array

Returns: - A byte array representing the ReadRawRequest structure - An error if the marshaling fails

func (*ReadRawRequest) Unmarshal

func (c *ReadRawRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadRequest

type ReadRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit signed integer indicating the
	// file from which the data MUST be read.
	FID types.SHORT

	// CountOfBytesToRead (2 bytes): This field is a 16-bit unsigned integer indicating
	// the number of bytes to be read from the file. The client MUST ensure that the
	// amount of data requested will fit in the negotiated maximum buffer size.
	CountOfBytesToRead types.USHORT

	// ReadOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer indicating
	// the offset, in number of bytes, from which to begin reading from the file. The
	// client MUST ensure that the amount of data requested fits in the negotiated
	// maximum buffer size. Because this field is limited to 32 bits, this command is
	// inappropriate for files having 64-bit offsets.
	ReadOffsetInBytes types.ULONG

	// EstimateOfRemainingBytesToBeRead (2 bytes): This field is a 16-bit unsigned
	// integer indicating the remaining number of bytes that the client intends to read
	// from the file. This is an advisory field and MAY be 0x0000.
	EstimateOfRemainingBytesToBeRead types.USHORT
}

ReadRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/23704aa0-e6d2-4762-8dfd-e8eeaacca71b

func NewReadRequest

func NewReadRequest() *ReadRequest

NewReadRequest creates a new ReadRequest structure

Returns: - A pointer to the new ReadRequest structure

func (*ReadRequest) Marshal

func (c *ReadRequest) Marshal() ([]byte, error)

Marshal marshals the ReadRequest structure into a byte array

Returns: - A byte array representing the ReadRequest structure - An error if the marshaling fails

func (*ReadRequest) Unmarshal

func (c *ReadRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type ReadResponse

type ReadResponse struct {
	command_interface.Command

	// CountOfBytesReturned (2 bytes): The actual number of bytes returned to the
	// client. This MUST be equal to CountOfBytesToRead unless the end of file was
	// reached before reading CoutOfBytesToRead bytes or the ReadOffsetInBytes pointed
	// at or beyond the end of file.
	CountOfBytesReturned types.USHORT

	// Reserved (4 bytes): Reserved. MUST be 0x00000000.
	Reserved types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x01.
	// CountOfBytesRead (2 bytes): The number of bytes read that are contained in the
	// following array of bytes.
	// Bytes (variable): The actual bytes read from the file.
	Bytes types.SMB_STRING
}

ReadResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/bc54fec8-3e8a-4c05-bbe9-11ed116d1d67

func NewReadResponse

func NewReadResponse() *ReadResponse

NewReadResponse creates a new ReadResponse structure

Returns: - A pointer to the new ReadResponse structure

func (*ReadResponse) Marshal

func (c *ReadResponse) Marshal() ([]byte, error)

Marshal marshals the ReadResponse structure into a byte array

Returns: - A byte array representing the ReadResponse structure - An error if the marshaling fails

func (*ReadResponse) Unmarshal

func (c *ReadResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type RenameRequest

type RenameRequest struct {
	command_interface.Command

	// SearchAttributes (2 bytes): Indicates the file attributes that the file(s) to be
	// renamed MUST have. If the value of this field is 0x0000, then only normal files
	// MUST be matched to be renamed. If the System or Hidden attributes are specified,
	// then entries with those attributes MAY be matched in addition to the normal
	// files. Read-only files MUST NOT be renamed. The read-only attribute of the file
	// MUST be cleared before it can be renamed.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// BufferFormat1 (1 byte): This field MUST be 0x04.
	// OldFileName (variable): A null-terminated string that contains the name of the
	// file or files to be renamed. Wildcards MAY be used in the filename component of
	// the path.
	OldFileName types.SMB_STRING

	// BufferFormat2 (1 byte): This field MUST be 0x04.
	// NewFileName (variable): A null-terminated string containing the new name(s) to
	// be given to the file(s) that matches OldFileName or the name of the destination
	// directory into which the files matching OldFileName MUST be moved.
	NewFileName types.SMB_STRING
}

RenameRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c970f3bf-806e-4309-8ea9-6515605f450d

func NewRenameRequest

func NewRenameRequest() *RenameRequest

NewRenameRequest creates a new RenameRequest structure

Returns: - A pointer to the new RenameRequest structure

func (*RenameRequest) Marshal

func (c *RenameRequest) Marshal() ([]byte, error)

Marshal marshals the RenameRequest structure into a byte array

Returns: - A byte array representing the RenameRequest structure - An error if the marshaling fails

func (*RenameRequest) Unmarshal

func (c *RenameRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type RenameResponse

type RenameResponse struct {
	command_interface.Command
}

RenameResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/eda3174f-448e-44b6-bfe0-0a2f3fc3f0f4

func NewRenameResponse

func NewRenameResponse() *RenameResponse

NewRenameResponse creates a new RenameResponse structure

Returns: - A pointer to the new RenameResponse structure

func (*RenameResponse) Marshal

func (c *RenameResponse) Marshal() ([]byte, error)

Marshal marshals the RenameResponse structure into a byte array

Returns: - A byte array representing the RenameResponse structure - An error if the marshaling fails

func (*RenameResponse) Unmarshal

func (c *RenameResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SearchRequest

type SearchRequest struct {
	command_interface.Command

	// MaxCount (2 bytes): The maximum number of directory entries to return. This
	// value represents the maximum number of entries across the entirety of the
	// search, not just the initial response.
	MaxCount types.USHORT

	// SearchAttributes (2 bytes): An attribute mask used to specify the standard
	// attributes a file MUST have in order to match the search. If the value of this
	// field is 0x0000, then only normal files are returned. If the Volume Label
	// attribute is set, the server MUST return only the volume label (the Volume Label
	// attribute is exclusive). If the Directory, System, or Hidden attributes are
	// specified, then those entries are returned in addition to the normal files.
	// Exclusive search attributes (see section 2.2.1.2.4) can also be set.
	SearchAttributes types.SMB_FILE_ATTRIBUTES

	// BufferFormat1 (1 byte): This field MUST be 0x04, which indicates that a
	// null-terminated SMB_STRING is to follow.
	// FileName (variable): A null-terminated SMB_STRING. This is the full directory
	// path (relative to the TID) of the file(s) being sought. Only the final component
	// of the path MAY contain wildcards. This string MAY be the empty string.
	FileName types.SMB_STRING

	// BufferFormat2 (1 byte): This field MUST be 0x05, which indicates a variable
	// block is to follow.
	// ResumeKeyLength (2 bytes): This field MUST be either 0x0000 or 21 (0x0015). If
	// the value of this field is 0x0000, this is an initial search request. The server
	// MUST allocate resources to maintain search state so that subsequent requests MAY
	// be processed. If the value of this field is 21 (0x0015), this request MUST be
	// the continuation of a previous search, and the next field MUST contain a
	// ResumeKey previously returned by the server.
	// ResumeKey (variable): SMB_Resume_Key If the value of ResumeKeyLength is 21
	// (0x0015), this field MUST contain a ResumeKey returned by the server in response
	// to a previous SMB_COM_SEARCH request. The ResumeKey contains data used by both
	// the client and the server to maintain the state of the search. The structure of the
	// ResumeKey follows:
	ResumeKey types.SMB_RESUME_KEY
}

SearchRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/239b0def-8370-4dc7-8391-ee60952901b1

func NewSearchRequest

func NewSearchRequest() *SearchRequest

NewSearchRequest creates a new SearchRequest structure

Returns: - A pointer to the new SearchRequest structure

func (*SearchRequest) Marshal

func (c *SearchRequest) Marshal() ([]byte, error)

Marshal marshals the SearchRequest structure into a byte array

Returns: - A byte array representing the SearchRequest structure - An error if the marshaling fails

func (*SearchRequest) Unmarshal

func (c *SearchRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SearchResponse

type SearchResponse struct {
	command_interface.Command

	// Count (2 bytes): The number of directory entries returned in this response
	// message. This value MUST be less than or equal to the value of MaxCount in the
	// initial request.
	Count types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x05, which indicates that a
	// variable-size block is to follow.
	// DataLength (2 bytes): The size, in bytes, of the DirectoryInformationData array,
	// which follows. This field MUST be equal to 43 times the value of
	// SMB_Parameters.Count.
	// DirectoryInformationData (variable): Array of SMB_Directory_Information An array
	// of zero or more SMB_Directory_Information records. The structure and contents of
	// these records is specified below. Note that the SMB_Directory_Information record
	// structure is a fixed 43 bytes in length.
	SMB_Directory_Information types.SMB_STRING
}

SearchResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/12a609ad-8709-4492-9b95-4a402589cf56

func NewSearchResponse

func NewSearchResponse() *SearchResponse

NewSearchResponse creates a new SearchResponse structure

Returns: - A pointer to the new SearchResponse structure

func (*SearchResponse) Marshal

func (c *SearchResponse) Marshal() ([]byte, error)

Marshal marshals the SearchResponse structure into a byte array

Returns: - A byte array representing the SearchResponse structure - An error if the marshaling fails

func (*SearchResponse) Unmarshal

func (c *SearchResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SeekRequest

type SeekRequest struct {
	command_interface.Command

	// FID (2 bytes): The File ID of the open file within which to seek.
	FID types.USHORT

	// Mode (2 bytes): The seek mode. Possible values are as follows.
	Mode types.USHORT

	// Offset (4 bytes): A 32-bit signed long value indicating the file position,
	// relative to the position indicated in Mode, to which to set the updated file
	// pointer. The value of Offset ranges from -2 gigabytes to +2 gigabytes
	// ((-2**31) to (2**31 -1) bytes).
	Offset types.LONG
}

SeekRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/e9dd996c-ba2b-474b-ae5d-5f65c3be1251

func NewSeekRequest

func NewSeekRequest() *SeekRequest

NewSeekRequest creates a new SeekRequest structure

Returns: - A pointer to the new SeekRequest structure

func (*SeekRequest) Marshal

func (c *SeekRequest) Marshal() ([]byte, error)

Marshal marshals the SeekRequest structure into a byte array

Returns: - A byte array representing the SeekRequest structure - An error if the marshaling fails

func (*SeekRequest) Unmarshal

func (c *SeekRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SeekResponse

type SeekResponse struct {
	command_interface.Command

	// The response returns the new file pointer in Offset, expressed as the number of
	// bytes from the start of the file. The Offset MAY be beyond the current end of
	// file. An attempt to seek to before the start of file sets the current file
	// pointer to the start of the file (0x00000000).
	Offset types.ULONG
}

SeekResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/089b214b-8501-4bcb-a9bd-9b2aa80b0042

func NewSeekResponse

func NewSeekResponse() *SeekResponse

NewSeekResponse creates a new SeekResponse structure

Returns: - A pointer to the new SeekResponse structure

func (*SeekResponse) Marshal

func (c *SeekResponse) Marshal() ([]byte, error)

Marshal marshals the SeekResponse structure into a byte array

Returns: - A byte array representing the SeekResponse structure - An error if the marshaling fails

func (*SeekResponse) Unmarshal

func (c *SeekResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SessionSetupAndxRequest

type SessionSetupAndxRequest struct {
	command_interface.Command

	// MaxBufferSize (2 bytes): The maximum size, in bytes, of the largest SMB
	// message that the client can receive. This is the size of the largest SMB message
	// that the server can send to the client. SMB message size includes the size of
	// the SMB header, parameter, and data blocks. This size MUST NOT include any
	// transport-layer framing or other transport-layer data.
	MaxBufferSize types.USHORT

	// MaxMpxCount (2 bytes): The maximum number of pending requests supported by the
	// client. This value MUST be less than or equal to the MaxMpxCount field value
	// provided by the server in the SMB_COM_NEGOTIATE Response.
	MaxMpxCount types.USHORT

	// VcNumber (2 bytes): The number of this VC (virtual circuit) between the client
	// and the server. This field SHOULD be set to a value of 0x0000 for the first
	// virtual circuit between the client and the server and it SHOULD be set to a
	// unique nonzero value for each additional virtual circuit.
	VcNumber types.USHORT

	// SessionKey (4 bytes): The client MUST set this field to be equal to the
	// SessionKey field in the SMB_COM_NEGOTIATE Response for this SMB connection.
	SessionKey types.ULONG

	// If SMB_FLAGS2_UNICODE is set (1), the value of OEMPasswordLen MUST be 0x0000 and
	// the password MUST be encoded using UTF-16LE Unicode. Padding MUST NOT be added
	// to align this plaintext Unicode string to a word boundary.
	OEMPasswordLen types.USHORT

	// If SMB_FLAGS2_UNICODE is clear (0), the value of UnicodePasswordLen MUST be
	// 0x0000, and the password MUST be encoded using the 8-bit OEM character set
	// (extended ASCII).
	UnicodePasswordLen types.USHORT

	// Reserved (4 bytes): Reserved. This field MUST be 0x00000000. The server MUST
	// ignore the contents of this field.
	Reserved types.ULONG

	// Capabilities (4 bytes): A 32-bit field providing a set of client capability
	// indicators. The client uses this field to report its own set of capabilities to
	// the server. The client capabilities are a subset of the server capabilities.
	Capabilities capabilities.Capabilities

	// The OEMPassword value is an array of bytes, not a null-terminated string.
	OEMPassword []types.UCHAR

	// UnicodePassword (variable): The contents of this field depends upon the
	// authentication methods in use (See section 3.2.4.2.4 for a description of
	// authentication mechanisms used with CIFS.):
	//
	//   - If Unicode has been negotiated and the client sends a plaintext password,
	// this field MUST contain the password represented in UTF-16LE Unicode.
	//
	//   - If the client uses challenge/response authentication, this field can contain
	// a cryptographic response.
	//
	//   - This field MAY be empty.
	//
	//   - If the client sends a plaintext password, then the password MUST be encoded
	// in either OEM or Unicode characters, but not both. The value of the SMB_FLAGS2_UNICODE
	// bit of the SMB_Header.Flags2 indicates the character encoding of the password.
	//
	//   - If a plaintext password is sent, then:
	//       + If SMB_FLAGS2_UNICODE is clear (0), the value of UnicodePasswordLen MUST be 0x0000,
	//     and the password MUST be encoded using the 8-bit OEM character set (extended ASCII).
	//       + If SMB_FLAGS2_UNICODE is set (1), the value of OEMPasswordLen MUST be 0x0000 and the
	// password MUST be encoded using UTF-16LE Unicode. Padding MUST NOT be added to align this
	// plaintext Unicode string to a word boundary.
	UnicodePassword []types.UCHAR

	// Pad (variable): Padding bytes. If Unicode support has been enabled and
	// SMB_FLAGS2_UNICODE is set in SMB_Header.Flags2, this field MUST contain zero
	// (0x00) or one null padding byte as needed to ensure that the AccountName string
	// is aligned on a 16-bit boundary. This also forces alignment of subsequent
	// strings without additional padding.
	Pad []types.UCHAR

	// AccountName (variable): The name of the account (username) with which the user
	// authenticates.
	AccountName types.SMB_STRING

	// PrimaryDomain (variable): A string representing the desired authentication domain.
	// This MAY be the empty string. If SMB_FLAGS2_UNICODE is set in the Flags2 field of
	// the SMB header of the request, this string MUST be a null-terminated array of
	// 16-bit Unicode characters. Otherwise, this string MUST be a null-terminated array
	// of OEM characters. If this string consists of Unicode characters, this field
	// MUST be aligned to start on a 2-byte boundary from the start of the SMB header.
	PrimaryDomain types.SMB_STRING

	// NativeOS (variable): A string representing the native operating system of the
	// CIFS client. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header
	// of the request, this string MUST be a null-terminated array of 16-bit Unicode
	// characters. Otherwise, this string MUST be a null-terminated array of OEM
	// characters. If this string consists of Unicode characters, this field MUST be
	// aligned to start on a 2-byte boundary from the start of the SMB header.
	NativeOS types.SMB_STRING

	// NativeLanMan (variable): A string that represents the native LAN manager type
	// of the client. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header
	// of the request, this string MUST be a null-terminated array of 16-bit Unicode
	// characters. Otherwise, this string MUST be a null-terminated array of OEM
	// characters. If this string consists of Unicode characters, this field MUST be
	// aligned to start on a 2-byte boundary from the start of the SMB header.
	NativeLanMan types.SMB_STRING
}

SessionSetupAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/81e15dee-8fb6-4102-8644-7eaa7ded63f7

func NewSessionSetupAndxRequest

func NewSessionSetupAndxRequest() *SessionSetupAndxRequest

NewSessionSetupAndxRequest creates a new SessionSetupAndxRequest structure

Returns: - A pointer to the new SessionSetupAndxRequest structure

func (*SessionSetupAndxRequest) IsAndX

func (c *SessionSetupAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*SessionSetupAndxRequest) Marshal

func (c *SessionSetupAndxRequest) Marshal() ([]byte, error)

Marshal marshals the SessionSetupAndxRequest structure into a byte array

Returns: - A byte array representing the SessionSetupAndxRequest structure - An error if the marshaling fails

func (*SessionSetupAndxRequest) Unmarshal

func (c *SessionSetupAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SessionSetupAndxResponse

type SessionSetupAndxResponse struct {
	command_interface.Command

	// Action (2 bytes): A 16-bit field. The two lowest-order bits have been defined:
	Action types.USHORT

	// Pad (variable): Padding bytes. If Unicode support has been enabled, this field
	// MUST contain zero or one null padding byte as needed to ensure that the NativeOS
	// field, which follows, is aligned on a 16-bit boundary.
	Pad []types.UCHAR

	// NativeOS (variable): A string that represents the native operating system of the
	// server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header of
	// the response, the string MUST be a null-terminated array of 16-bit Unicode
	// characters. Otherwise, the string MUST be a null-terminated array of OEM
	// characters. If the string consists of Unicode characters, this field MUST be
	// aligned to start on a 2-byte boundary from the start of the SMB header.
	NativeOS types.SMB_STRING

	// NativeLanMan (variable): A string that represents the native LAN Manager type
	// of the server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header
	// of the response, the string MUST be a null-terminated array of 16-bit Unicode
	// characters. Otherwise, the string MUST be a null-terminated array of OEM characters.
	// If the string consists of Unicode characters, this field MUST be aligned to start
	// on a 2-byte boundary from the start of the SMB header.
	NativeLanMan types.SMB_STRING

	// PrimaryDomain (variable): A string representing the primary domain or workgroup
	// name of the server. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the SMB header
	// of the response, the string MUST be a null-terminated array of 16-bit Unicode characters.
	// Otherwise, the string MUST be a null-terminated array of OEM characters. If the string
	// consists of Unicode characters, this field MUST be aligned to start on a 2-byte boundary
	// from the start of the SMB header.
	PrimaryDomain types.SMB_STRING
}

SessionSetupAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/e7514918-a0f6-4932-9f00-ced094445537

func NewSessionSetupAndxResponse

func NewSessionSetupAndxResponse() *SessionSetupAndxResponse

NewSessionSetupAndxResponse creates a new SessionSetupAndxResponse structure

Returns: - A pointer to the new SessionSetupAndxResponse structure

func (*SessionSetupAndxResponse) IsAndX

func (c *SessionSetupAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*SessionSetupAndxResponse) Marshal

func (c *SessionSetupAndxResponse) Marshal() ([]byte, error)

Marshal marshals the SessionSetupAndxResponse structure into a byte array

Returns: - A byte array representing the SessionSetupAndxResponse structure - An error if the marshaling fails

func (*SessionSetupAndxResponse) Unmarshal

func (c *SessionSetupAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SetInformation2Request

type SetInformation2Request struct {
	command_interface.Command

	// FID (2 bytes): This is the FID representing the file for which attributes are to
	// be set.
	FID types.USHORT

	// CreateDate (2 bytes): This is the date when the file was created.
	CreateDate types.SMB_DATE

	// CreateTime (2 bytes): This is the time on CreateDate when the file was created.
	CreationTime types.SMB_TIME

	// LastAccessDate (2 bytes): This is the date when the file was last accessed.
	LastAccessDate types.SMB_DATE

	// LastAccessTime (2 bytes): This is the time on LastAccessDate when the file was
	// last accessed.
	LastAccessTime types.SMB_TIME

	// LastWriteDate (2 bytes): This is the date when data was last written to the
	// file.
	LastWriteDate types.SMB_DATE

	// LastWriteTime (2 bytes): This is the time on LastWriteDate when data was last
	// written to the file.
	LastWriteTime types.SMB_TIME
}

SetInformation2Request Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/de521278-f800-4a57-b524-4811fe9edd8f

func NewSetInformation2Request

func NewSetInformation2Request() *SetInformation2Request

NewSetInformation2Request creates a new SetInformation2Request structure

Returns: - A pointer to the new SetInformation2Request structure

func (*SetInformation2Request) Marshal

func (c *SetInformation2Request) Marshal() ([]byte, error)

Marshal marshals the SetInformation2Request structure into a byte array

Returns: - A byte array representing the SetInformation2Request structure - An error if the marshaling fails

func (*SetInformation2Request) Unmarshal

func (c *SetInformation2Request) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SetInformation2Response

type SetInformation2Response struct {
	command_interface.Command
}

SetInformation2Response Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/b8fb4dc1-abb5-4f46-b6f7-454152240d97

func NewSetInformation2Response

func NewSetInformation2Response() *SetInformation2Response

NewSetInformation2Response creates a new SetInformation2Response structure

Returns: - A pointer to the new SetInformation2Response structure

func (*SetInformation2Response) Marshal

func (c *SetInformation2Response) Marshal() ([]byte, error)

Marshal marshals the SetInformation2Response structure into a byte array

Returns: - A byte array representing the SetInformation2Response structure - An error if the marshaling fails

func (*SetInformation2Response) Unmarshal

func (c *SetInformation2Response) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SetInformationRequest

type SetInformationRequest struct {
	command_interface.Command

	// FileAttributes (2 bytes): This field is a 16-bit unsigned bit field encoded as
	// SMB_FILE_ATTRIBUTES (section 2.2.4.10.1)
	FileAttributes types.SMB_FILE_ATTRIBUTES

	// LastWriteTime (4 bytes): The time of the last write to the file.
	LastWriteTime types.FILETIME

	// Reserved (5 bytes): This field MUST be 0x0000000000000000.
	Reserved [5]types.UCHAR

	// BufferFormat (1 byte): This field MUST be 0x04.
	// FileName (variable): A null-terminated string that represents the fully
	// qualified name of the file relative to the supplied TID. This is the file for
	// which attributes are set.
	FileName types.SMB_STRING
}

SetInformationRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/76577ee1-eb2d-4db7-9bed-65c74a952741

func NewSetInformationRequest

func NewSetInformationRequest() *SetInformationRequest

NewSetInformationRequest creates a new SetInformationRequest structure

Returns: - A pointer to the new SetInformationRequest structure

func (*SetInformationRequest) Marshal

func (c *SetInformationRequest) Marshal() ([]byte, error)

Marshal marshals the SetInformationRequest structure into a byte array

Returns: - A byte array representing the SetInformationRequest structure - An error if the marshaling fails

func (*SetInformationRequest) Unmarshal

func (c *SetInformationRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type SetInformationResponse

type SetInformationResponse struct {
	command_interface.Command
}

SetInformationResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/ae244b27-eeeb-4d71-b884-3a74b1c37c03

func NewSetInformationResponse

func NewSetInformationResponse() *SetInformationResponse

NewSetInformationResponse creates a new SetInformationResponse structure

Returns: - A pointer to the new SetInformationResponse structure

func (*SetInformationResponse) Marshal

func (c *SetInformationResponse) Marshal() ([]byte, error)

Marshal marshals the SetInformationResponse structure into a byte array

Returns: - A byte array representing the SetInformationResponse structure - An error if the marshaling fails

func (*SetInformationResponse) Unmarshal

func (c *SetInformationResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type Transaction2Request

type Transaction2Request struct {
	command_interface.Command

	// TotalParameterCount (2 bytes): The total number of SMB_COM_TRANSACTION2
	// parameter bytes to be sent in this transaction request. This value MAY be
	// reduced in any or all subsequent SMB_COM_TRANSACTION2_SECONDARY requests that
	// are part of the same transaction. This value represents transaction parameter
	// bytes, not SMB parameter words. Transaction parameter bytes are carried in the
	// SMB_Data block of the SMB_COM_TRANSACTION2 request.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of SMB_COM_TRANSACTION2 data bytes to
	// be sent in this transaction request. This value MAY be reduced in any or all
	// subsequent SMB_COM_TRANSACTION2_SECONDARY requests that are part of the same
	// transaction. This value represents transaction data bytes, not SMB data bytes.
	TotalDataCount types.USHORT

	// MaxParameterCount (2 bytes): The maximum number of parameter bytes that the
	// client will accept in the transaction reply. The server MUST NOT return more
	// than this number of parameter bytes.
	MaxParameterCount types.USHORT

	// MaxDataCount (2 bytes): The maximum number of data bytes that the client will
	// accept in the transaction reply. The server MUST NOT return more than this
	// number of data bytes.
	MaxDataCount types.USHORT

	// MaxSetupCount (1 byte): The maximum number of setup bytes that the client will
	// accept in the transaction reply. The server MUST NOT return more than this
	// number of setup bytes.
	MaxSetupCount types.UCHAR

	// Reserved1 (1 byte): A padding byte. This field MUST be zero. Existing CIFS
	// implementations MAY combine this field with MaxSetupCount to form a USHORT. If
	// MaxSetupCount is defined as a USHORT, the high order byte MUST be 0x00.
	Reserved1 types.UCHAR

	// Flags (2 bytes): A set of bit flags that alter the behavior of the requested
	// operation. Unused bit fields MUST be set to zero by the client sending the
	// request, and MUST be ignored by the server receiving the request. The client MAY
	// set either or both of the following bit flags:
	Flags types.USHORT

	// Timeout (4 bytes): The number of milliseconds that the server waits for
	// completion of the transaction before generating a time-out. A value of
	// 0x00000000 indicates that the operation is not blocked.
	Timeout types.ULONG

	// Reserved2 (2 bytes): Reserved. This field MUST be 0x0000 in the client request.
	// The server MUST ignore the contents of this field.
	Reserved2 types.USHORT

	// ParameterCount (2 bytes): The number of transaction parameter bytes being sent
	// in this SMB message. If the transaction fits within a single
	// SMB_COM_TRANSACTION2 request, then this value MUST be equal to
	// TotalParameterCount. Otherwise, the sum of the ParameterCount values in the
	// primary and secondary transaction request messages MUST be equal to the smallest
	// TotalParameterCount value reported to the server. If the value of this field is
	// less than the value of TotalParameterCount, then at least one
	// SMB_COM_TRANSACTION2_SECONDARY message MUST be used to transfer the remaining
	// parameter bytes. The ParameterCount field MUST be used to determine the number
	// of transaction parameter bytes contained within the SMB_COM_TRANSACTION2
	// message.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): The offset, in bytes, from the start of the
	// SMB_Header to the transaction parameter bytes. This MUST be the number of bytes
	// from the start of the SMB message to the start of the SMB_Data.Bytes.Parameters
	// field. Server implementations MUST use this value to locate the transaction
	// parameter block within the SMB message. If ParameterCount is zero, the
	// client/server MAY set this field to zero.
	ParameterOffset types.USHORT

	// DataCount (2 bytes): The number of transaction data bytes being sent in this SMB
	// message. If the transaction fits within a single SMB_COM_TRANSACTION2 request,
	// then this value MUST be equal to TotalDataCount. Otherwise, the sum of the
	// DataCount values in the primary and secondary transaction request messages MUST
	// be equal to the smallest TotalDataCount value reported to the server. If the
	// value of this field is less than the value of TotalDataCount, then at least one
	// SMB_COM_TRANSACTION2_SECONDARY message MUST be used to transfer the remaining
	// data bytes.
	DataCount types.USHORT

	// DataOffset (2 bytes): The offset, in bytes, from the start of the SMB Header
	// (section 2.2.3.1) to the transaction data bytes. This MUST be the number of
	// bytes from the start of the SMB message to the start of the SMB_Data.Bytes.Data
	// field. Server implementations MUST use this value to locate the transaction data
	// block within the SMB message. If DataCount is zero, the client/server MAY set
	// this field to zero.
	DataOffset types.USHORT

	// SetupCount (1 byte): The number of setup words that are included in the
	// transaction request.
	SetupCount types.UCHAR

	// Reserved3 (1 byte): A padding byte. This field MUST be 0x00. Existing CIFS
	// implementations MAY combine this field with SetupCount to form a USHORT. If
	// SetupCount is defined as a USHORT, the high order byte MUST be0x00.
	Reserved3 types.UCHAR

	// Name (1 byte): This field is not used in SMB_COM_TRANSACTION2 requests. This
	// field MUST be set to zero, and the server MUST ignore it on receipt.
	Name types.UCHAR

	// Pad1 (variable): This field MUST be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB Header
	// (section 2.2.3.1). This constraint can cause this field to be a zero-length
	// field. This field SHOULD be set to zero by the client/server and MUST be ignored
	// by the server/client.
	Pad1 []types.UCHAR

	// Trans2_Parameters (variable): Transaction parameter bytes. See the individual
	// SMB_COM_TRANSACTION2 subcommand descriptions for information on parameters sent
	// for each subcommand.
	Trans2_Parameters []types.UCHAR

	// Pad2 (variable): This field MUST be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// Trans2_Data (variable): Transaction data bytes. See the individual
	// SMB_COM_TRANSACTION2 subcommand descriptions for information on data sent for
	// each subcommand.
	Trans2_Data []types.UCHAR
}

Transaction2Request Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f7d148cd-e3d5-49ae-8b37-9633822bfeac

func NewTransaction2Request

func NewTransaction2Request() *Transaction2Request

NewTransaction2Request creates a new Transaction2Request structure

Returns: - A pointer to the new Transaction2Request structure

func (*Transaction2Request) Marshal

func (c *Transaction2Request) Marshal() ([]byte, error)

Marshal marshals the Transaction2Request structure into a byte array

Returns: - A byte array representing the Transaction2Request structure - An error if the marshaling fails

func (*Transaction2Request) Unmarshal

func (c *Transaction2Request) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type Transaction2Response

type Transaction2Response struct {
	command_interface.Command
}

Transaction2Response Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/216e606a-eee1-4c3f-b88e-0eb14dc380b2 The SMB_COM_TRANSACTION2 response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_TRANSACTION2 request if secondary request messages (SMB_COM_TRANSACTION2_SECONDARY) are pending. Whenever a transaction request is split across multiple SMB requests, the server MUST evaluate the initial SMB_COM_TRANSACTION2 request to determine whether or not it has the resources necessary to process the transaction. It MUST also check for any other errors it can detect based upon the initial request, and then send back an interim response. The interim response advises the client as to whether it can send the rest of the transaction to the server. TODO: Implement the two possible formats

func NewTransaction2Response

func NewTransaction2Response() *Transaction2Response

NewTransaction2Response creates a new Transaction2Response structure

Returns: - A pointer to the new Transaction2Response structure

func (*Transaction2Response) Marshal

func (c *Transaction2Response) Marshal() ([]byte, error)

Marshal marshals the Transaction2Response structure into a byte array

Returns: - A byte array representing the Transaction2Response structure - An error if the marshaling fails

func (*Transaction2Response) Unmarshal

func (c *Transaction2Response) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type Transaction2SecondaryRequest

type Transaction2SecondaryRequest struct {
	command_interface.Command

	// TotalParameterCount (2 bytes): The total number of transaction parameter bytes
	// to be sent to the server over the course of this transaction. This value MAY be
	// less than or equal to the TotalParameterCount in preceding request messages that
	// are part of the same transaction. This value represents transaction parameter
	// bytes, not SMB parameter words.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of transaction data bytes to be sent
	// to the server over the course of this transaction. This value MAY be less than
	// or equal to the TotalDataCount in preceding request messages that are part of
	// the same transaction. This value represents transaction data bytes, not SMB data
	// bytes.
	TotalDataCount types.USHORT

	// ParameterCount (2 bytes): The number of transaction parameter bytes being sent
	// in the SMB message. This value MUST be less than TotalParameterCount. The sum of
	// the ParameterCount values across all of the request messages in a transaction
	// MUST be equal to the TotalParameterCount reported in the last request message of
	// the transaction.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): The offset, in bytes, from the start of the
	// SMB_Header to the transaction parameter bytes contained in this SMB message.
	// This MUST be the number of bytes from the start of the SMB message to the start
	// of the SMB_Data.Bytes.Trans2_Parameters field. Server implementations MUST use
	// this value to locate the transaction parameter block within the SMB message. If
	// ParameterCount is zero, the client/server MAY set this field to zero.
	ParameterOffset types.USHORT

	// ParameterDisplacement (2 bytes): The offset relative to all of the transaction
	// parameter bytes sent to the server in this transaction at which this block of
	// parameter bytes SHOULD be placed. This value can be used by the server to
	// correctly reassemble the transaction parameters even if the SMB request messages
	// are received out of order.
	ParameterDisplacement types.USHORT

	// DataCount (2 bytes): The number of transaction data bytes being sent in this SMB
	// message. This value MUST be less than the value of TotalDataCount. The sum of
	// the DataCount values across all of the request messages in a transaction MUST be
	// equal to the smallest TotalDataCount value reported to the server.
	DataCount types.USHORT

	// DataOffset (2 bytes): The offset, in bytes, from the start of the SMB_Header to
	// the transaction data bytes contained in this SMB message. This MUST be the
	// number of bytes from the start of the SMB message to the start of the
	// SMB_Data.Bytes.Trans2_Data field. Server implementations MUST use this value to
	// locate the transaction data block within the SMB message. If DataCount is zero,
	// the client/server MAY set this field to zero.
	DataOffset types.USHORT

	// DataDisplacement (2 bytes): The offset relative to all of the transaction data
	// bytes sent to the server in this transaction at which this block of parameter
	// bytes SHOULD be placed. This value MAY be used by the server to correctly
	// reassemble the transaction data block even if the SMB request messages are
	// received out of order.
	DataDisplacement types.USHORT

	// FID (2 bytes): Either a valid File ID returned by a previous Open or Create
	// operation, or 0xFFFF. A FID value of 0xFFFF is, by definition, an invalid FID
	// and indicates that no FID is being sent in this request. See the individual
	// descriptions of the Trans2 subcommands for specific information on the use of
	// this field.
	FID types.USHORT

	// Pad1 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB Header
	// (section 2.2.3.1). This constraint can cause this field to be a zero-length
	// field. This field SHOULD be set to zero by the client/server and MUST be ignored
	// by the server/client.
	Pad1 []types.UCHAR

	// Trans2_Parameters (variable): Transaction parameter bytes.
	Trans2_Parameters []types.UCHAR

	// Pad2 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// Trans2_Data (variable): Transaction data bytes.
	Trans2_Data []types.UCHAR
}

Transaction2SecondaryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/da6bf4b0-3a71-4f1f-9c04-8426cf82b892

func NewTransaction2SecondaryRequest

func NewTransaction2SecondaryRequest() *Transaction2SecondaryRequest

NewTransaction2SecondaryRequest creates a new Transaction2SecondaryRequest structure

Returns: - A pointer to the new Transaction2SecondaryRequest structure

func (*Transaction2SecondaryRequest) Marshal

func (c *Transaction2SecondaryRequest) Marshal() ([]byte, error)

Marshal marshals the Transaction2SecondaryRequest structure into a byte array

Returns: - A byte array representing the Transaction2SecondaryRequest structure - An error if the marshaling fails

func (*Transaction2SecondaryRequest) Unmarshal

func (c *Transaction2SecondaryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type Transaction2SecondaryResponse

type Transaction2SecondaryResponse struct {
	command_interface.Command
}

Transaction2SecondaryResponse There is no response message defined for the SMB_COM_TRANSACTION2_SECONDARY request. Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/b0028be1-5325-4fef-8659-341524362431

func NewTransaction2SecondaryResponse

func NewTransaction2SecondaryResponse() *Transaction2SecondaryResponse

NewTransaction2SecondaryResponse creates a new Transaction2SecondaryResponse structure

Returns: - A pointer to the new Transaction2SecondaryResponse structure

func (*Transaction2SecondaryResponse) Marshal

func (c *Transaction2SecondaryResponse) Marshal() ([]byte, error)

Marshal marshals the Transaction2SecondaryResponse structure into a byte array

Returns: - A byte array representing the Transaction2SecondaryResponse structure - An error if the marshaling fails

func (*Transaction2SecondaryResponse) Unmarshal

func (c *Transaction2SecondaryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TransactionRequest

type TransactionRequest struct {
	command_interface.Command

	// TotalParameterCount (2 bytes): The total number of transaction parameter bytes
	// the client expects to send to the server for this request. Parameter bytes for a
	// transaction are carried within the SMB_Data.Trans_Parameters field of the
	// SMB_COM_TRANSACTION request. If the size of all of the required
	// SMB_Data.Trans_Parameters for a given transaction causes the request to exceed
	// the MaxBufferSize established during session setup, then the client MUST NOT
	// send all of the parameters in one request. The client MUST break up the
	// parameters and send additional requests using the SMB_COM_TRANSACTION_SECONDARY
	// command to send the additional parameters. Any single request MUST NOT exceed
	// the MaxBufferSize established during session setup. The client indicates to the
	// server to expect additional parameters, and thus at least one
	// SMB_COM_TRANSACTION_SECONDARY, by setting ParameterCount (see following) to be
	// less than TotalParameterCount. See SMB_COM_TRANSACTION_SECONDARY for more
	// information.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of transaction data bytes that the
	// client attempts to send to the server for this request. Data bytes of a
	// transaction are carried within the SMB_Data.Trans_Data field of the
	// SMB_COM_TRANSACTION request. If the size of all of the required
	// SMB_Data.Trans_Data for a given transaction causes the request to exceed the
	// MaxBufferSize established during session setup, then the client MUST NOT send
	// all of the data in one request. The client MUST break up the data and send
	// additional requests using the SMB_COM_TRANSACTION_SECONDARY command to send the
	// additional data. Any single request MUST NOT exceed the MaxBufferSize
	// established during session setup. The client indicates to the server to expect
	// additional data, and thus at least one SMB_COM_TRANSACTION_SECONDARY, by setting
	// DataCount (see following) to be less than TotalDataCount. See
	// SMB_COM_TRANSACTION_SECONDARY for more information.
	TotalDataCount types.USHORT

	// MaxParameterCount (2 bytes): The maximum number of SMB_Data.Trans_Parameters
	// bytes that the client accepts in the transaction response. The server MUST NOT
	// return more than this number of bytes in the SMB_Data.Trans_Parameters field of
	// the response.
	MaxParameterCount types.USHORT

	// MaxDataCount (2 bytes): The maximum number of SMB_Data.Trans_Data bytes that the
	// client accepts in the transaction response. The server MUST NOT return more than
	// this number of bytes in the SMB_Data.Trans_Data field.
	MaxDataCount types.USHORT

	// MaxSetupCount (1 byte): The maximum number of bytes that the client accepts in
	// the Setup field of the transaction response. The server MUST NOT return more
	// than this number of bytes in the Setup field.
	MaxSetupCount types.UCHAR

	// Reserved1 (1 byte): A padding byte. This field MUST be 0x00. Existing CIFS
	// implementations MAY combine this field with MaxSetupCount to form a USHORT. If
	// MaxSetupCount is defined as a USHORT, the high order byte MUST be 0x00.
	Reserved1 types.UCHAR

	// Flags (2 bytes): A set of bit flags that alter the behavior of the requested
	// operation. Unused bit fields MUST be set to zero by the client sending the
	// request, and MUST be ignored by the server receiving the request. The client can
	// set either or both of the following bit flags.
	Flags types.USHORT

	// Timeout (4 bytes): The value of this field MUST be the maximum number of
	// milliseconds that the server SHOULD wait for completion of the transaction
	// before generating a time-out and returning a response to the client. The client
	// SHOULD set this field to 0x00000000 to indicate that no time-out is expected. A
	// value of 0x00000000 indicates that the server returns an error if the resource
	// is not immediately available. If the operation does not complete within the
	// specified time, the server MAY abort the request and send a failure
	// response.
	Timeout types.ULONG

	// Reserved2 (2 bytes): Reserved. This field MUST be 0x0000 in the client request.
	// The server MUST ignore the contents of this field.
	Reserved2 types.USHORT

	// ParameterCount (2 bytes): The number of transaction parameter bytes that the
	// client attempts to send to the server in this request. Parameter bytes for a
	// transaction are carried within the SMB_Data.Trans_Parameters field of the
	// SMB_COM_TRANSACTION request. If the transaction request fits within a single
	// SMB_COM_TRANSACTION request (the request size does not exceed MaxBufferSize),
	// then this value SHOULD be equal to TotalParameterCount. Otherwise, the sum of
	// the ParameterCount values in the primary and secondary transaction request
	// messages MUST be equal to the smallest TotalParameterCount value reported to the
	// server. If the value of this field is less than the value of
	// TotalParameterCount, then at least one SMB_COM_TRANSACTION_SECONDARY message
	// MUST be used to transfer the remaining transaction SMB_Data.Trans_Parameters
	// bytes. The ParameterCount field MUST be used to determine the number of
	// transaction SMB_Data.Trans_Parameters bytes that are contained within the
	// SMB_COM_TRANSACTION message.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): This field MUST contain the number of bytes from the
	// start of the SMB Header to the start of the SMB_Data.Trans_Parameters field.
	// Server implementations MUST use this value to locate the transaction parameter
	// block within the request. If ParameterCount is zero, the client/server MAY set
	// this field to zero.
	ParameterOffset types.USHORT

	// DataCount (2 bytes): The number of transaction data bytes that the client sends
	// to the server in this request. Data bytes for a transaction are carried within
	// the SMB_Data.Trans_Data field of the SMB_COM_TRANSACTION request. If the
	// transaction request fits within a single SMB_COM_TRANSACTION request (the
	// request size does not exceed MaxBufferSize), then this value SHOULD be equal to
	// TotalDataCount. Otherwise, the sum of the DataCount values in the primary and
	// secondary transaction request messages MUST be equal to the smallest
	// TotalDataCount value reported to the server. If the value of this field is less
	// than the value of TotalDataCount, then at least one
	// SMB_COM_TRANSACTION_SECONDARY message MUST be used to transfer the remaining
	// transaction SMB_Data.Trans_Data bytes. The DataCount field MUST be used to
	// determine the number of transaction SMB_Data.Trans_Data bytes contained within
	// the SMB_COM_TRANSACTION message.
	DataCount types.USHORT

	// DataOffset (2 bytes): This field MUST be the number of bytes from the start of
	// the SMB Header of the request to the start of the SMB_Data.Trans_Data field.
	// Server implementations MUST use this value to locate the transaction data block
	// within the request. If DataCount is zero, the client/server MAY set this
	// field to zero.
	DataOffset types.USHORT

	// SetupCount (1 byte): This field MUST be the number of setup words that are
	// included in the transaction request.
	SetupCount types.UCHAR

	// Reserved3 (1 byte): A padding byte. This field MUST be 0x00. Existing CIFS
	// implementations MAY combine this field with SetupCount to form a USHORT. If
	// SetupCount is defined as a USHORT, the high order byte MUST be 0x00.
	Reserved3 types.UCHAR

	// Setup (variable): A variable-length array of setup words.
	Setup []types.USHORT

	// Name (variable): The pathname of the mailslot or named pipe to which the
	// transaction subcommand applies, or a client-supplied identifier that provides a
	// name for the transaction. See the individual SMB_COM_TRANSACTION subprotocol
	// subcommand descriptions for information about the value set for each subcommand.
	// If the field is not specified in the section for the subcommands, the field
	// SHOULD be set to \pipe\. If SMB_FLAGS2_UNICODE is set in the Flags2 field of the
	// SMB Header (section 2.2.3.1) of the request, this field MUST be a
	// null-terminated array of 16-bit Unicode characters which MUST be aligned to
	// start on a 2-byte boundary from the start of the SMB header. Otherwise, this
	// field MUST be a null-terminated array of OEM characters. The Name field MUST be
	// the first field in this section.
	Name types.SMB_STRING

	// Pad1 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB Header
	// (section 2.2.3.1). This constraint can cause this field to be a zero-length
	// field. This field SHOULD be set to zero by the client/server and MUST be ignored
	// by the server/client.
	Pad1 []types.UCHAR

	// Trans_Parameters (variable): Transaction parameter bytes. See the individual
	// SMB_COM_TRANSACTION subprotocol subcommands descriptions for information on the
	// parameters sent for each subcommand.
	Trans_Parameters []types.UCHAR

	// Pad2 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// Data (variable): Transaction data bytes. See the individual SMB_COM_TRANSACTION
	// subprotocol subcommands descriptions for information on the data sent for each
	// subcommand.
	Trans_Data []types.UCHAR
}

TransactionRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/57bfc115-fe29-4482-a0fe-a935757e0a4f

func NewTransactionRequest

func NewTransactionRequest() *TransactionRequest

NewTransactionRequest creates a new TransactionRequest structure

Returns: - A pointer to the new TransactionRequest structure

func (*TransactionRequest) Marshal

func (c *TransactionRequest) Marshal() ([]byte, error)

Marshal marshals the TransactionRequest structure into a byte array

Returns: - A byte array representing the TransactionRequest structure - An error if the marshaling fails

func (*TransactionRequest) Unmarshal

func (c *TransactionRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TransactionResponse

type TransactionResponse struct {
	command_interface.Command
}

TransactionResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c9303b42-8978-4144-9c18-a813c0033ca5 The SMB_COM_TRANSACTION response has two possible formats. The standard format is used to return the results of the completed transaction. A shortened interim response message is sent following the initial SMB_COM_TRANSACTION request if the server determines that at least one SMB_COM_TRANSACTION_SECONDARY request message is expected from the client. TODO: Implement the two possible formats

func NewTransactionResponse

func NewTransactionResponse() *TransactionResponse

NewTransactionResponse creates a new TransactionResponse structure

Returns: - A pointer to the new TransactionResponse structure

func (*TransactionResponse) Marshal

func (c *TransactionResponse) Marshal() ([]byte, error)

Marshal marshals the TransactionResponse structure into a byte array

Returns: - A byte array representing the TransactionResponse structure - An error if the marshaling fails

func (*TransactionResponse) Unmarshal

func (c *TransactionResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TransactionSecondaryRequest

type TransactionSecondaryRequest struct {
	command_interface.Command

	// TotalParameterCount (2 bytes): The total number of transaction parameter bytes
	// to be sent to the server over the course of this transaction. This value MAY be
	// less than or equal to the TotalParameterCount in preceding request messages that
	// are part of the same transaction. This value represents transaction parameter
	// bytes, not SMB parameter words.
	TotalParameterCount types.USHORT

	// TotalDataCount (2 bytes): The total number of transaction data bytes to be sent
	// to the server over the course of this transaction. This value MAY be less than
	// or equal to the TotalDataCount in preceding request messages that are part of
	// the same transaction. This value represents transaction data bytes, not SMB data
	// bytes.
	TotalDataCount types.USHORT

	// ParameterCount (2 bytes): The number of transaction parameter bytes being sent
	// in the SMB message. This value MUST be less than TotalParameterCount. The sum of
	// the ParameterCount values across all of the request messages in a transaction
	// MUST be equal to the TotalParameterCount reported in the last request message of
	// the transaction.
	ParameterCount types.USHORT

	// ParameterOffset (2 bytes): The offset, in bytes, from the start of the
	// SMB_Header to the transaction parameter bytes contained in this SMB message.
	// This MUST be the number of bytes from the start of the SMB message to the start
	// of the SMB_Data.Bytes.Trans_Parameters field. Server implementations MUST use
	// this value to locate the transaction parameter block within the SMB message. If
	// ParameterCount is zero, the client/server MAY set this field to zero.
	ParameterOffset types.USHORT

	// ParameterDisplacement (2 bytes): The offset, relative to all of the transaction
	// parameter bytes sent to the server in this transaction, at which this block of
	// parameter bytes MUST be placed. This value can be used by the server to
	// correctly reassemble the transaction parameters even if the SMB request messages
	// are received out of order.
	ParameterDisplacement types.USHORT

	// DataCount (2 bytes): The number of transaction data bytes being sent in this SMB
	// message. This value MUST be less than the value of TotalDataCount. The sum of
	// the DataCount values across all of the request messages in a transaction MUST be
	// equal to the smallest TotalDataCount value reported to the server.
	DataCount types.USHORT

	// DataOffset (2 bytes): The offset, in bytes, from the start of the SMB_Header to
	// the transaction data bytes contained in this SMB message. This MUST be the
	// number of bytes from the start of the SMB message to the start of the
	// SMB_Data.Bytes.Trans_Data field. Server implementations MUST use this value to
	// locate the transaction data block within the SMB message. If DataCount is zero,
	// the client/server MAY set this field to zero.
	DataOffset types.USHORT

	// DataDisplacement (2 bytes): The offset, relative to all of the transaction data
	// bytes sent to the server in this transaction, at which this block of parameter
	// bytes MUST be placed. This value can be used by the server to correctly
	// reassemble the transaction data block even if the SMB request messages are
	// received out of order.
	DataDisplacement types.USHORT

	// Pad1 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB Header
	// (section 2.2.3.1). This constraint can cause this field to be a zero-length
	// field. This field SHOULD be set to zero by the client/server and MUST be ignored
	// by the server/client.
	Pad1 []types.UCHAR

	// Trans2_Parameters (variable): Transaction parameter bytes.
	Trans2_Parameters []types.UCHAR

	// Pad2 (variable): This field SHOULD be used as an array of padding bytes to align
	// the following field to a 4-byte boundary relative to the start of the SMB
	// Header. This constraint can cause this field to be a zero-length field. This
	// field SHOULD be set to zero by the client/server and MUST be ignored by the
	// server/client.
	Pad2 []types.UCHAR

	// Trans2_Data (variable): Transaction data bytes.
	Trans2_Data []types.UCHAR
}

TransactionSecondaryRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/79ece32a-139d-46b0-ba28-055f822a8c05

func NewTransactionSecondaryRequest

func NewTransactionSecondaryRequest() *TransactionSecondaryRequest

NewTransactionSecondaryRequest creates a new TransactionSecondaryRequest structure

Returns: - A pointer to the new TransactionSecondaryRequest structure

func (*TransactionSecondaryRequest) Marshal

func (c *TransactionSecondaryRequest) Marshal() ([]byte, error)

Marshal marshals the TransactionSecondaryRequest structure into a byte array

Returns: - A byte array representing the TransactionSecondaryRequest structure - An error if the marshaling fails

func (*TransactionSecondaryRequest) Unmarshal

func (c *TransactionSecondaryRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TransactionSecondaryResponse

type TransactionSecondaryResponse struct {
	command_interface.Command
}

TransactionSecondaryResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/5130e027-1ad0-494c-a280-39d643c21a6c

func NewTransactionSecondaryResponse

func NewTransactionSecondaryResponse() *TransactionSecondaryResponse

NewTransactionSecondaryResponse creates a new TransactionSecondaryResponse structure

Returns: - A pointer to the new TransactionSecondaryResponse structure

func (*TransactionSecondaryResponse) Marshal

func (c *TransactionSecondaryResponse) Marshal() ([]byte, error)

Marshal marshals the TransactionSecondaryResponse structure into a byte array

Returns: - A byte array representing the TransactionSecondaryResponse structure - An error if the marshaling fails

func (*TransactionSecondaryResponse) Unmarshal

func (c *TransactionSecondaryResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeConnectAndxRequest

type TreeConnectAndxRequest struct {
	command_interface.Command

	// Flags (2 bytes): A 16-bit field used to modify the SMB_COM_TREE_CONNECT_ANDX
	// Request (section 2.2.4.55.1). The client MUST set reserved values to 0, and the
	// server MUST ignore them.
	Flags types.USHORT

	// PasswordLength (2 bytes): This field MUST be the length, in bytes, of the
	// SMB_Data.Bytes.Password field.
	PasswordLength types.USHORT

	// Password (variable): An array of bytes.
	//
	// - If the server is operating in share level access control mode and plaintext
	// passwords have been negotiated, then the Password MUST be an OEM_STRING
	// representing the user's password in plaintext.
	//
	// - If the server is operating in share level access control mode and
	// challenge/response authentication has been negotiated, then the Password
	// MUST be an authentication response.
	//
	// - If authentication is not used, then the Password SHOULD be a single null
	// padding byte (which takes the place of the Pad[] byte).
	//
	// The SMB_Parameters.Bytes.PasswordLength MUST be the full length of the
	// Password field. If the Password is the null padding byte, the password
	// length is 1.
	Password []types.UCHAR

	// Pad (variable): Padding bytes. If Unicode support has been enabled and
	// SMB_FLAGS2_UNICODE is set in SMB_Header.Flags2, this field MUST contain zero or
	// one null padding bytes as needed to ensure that the Path string is aligned on a
	// 16-bit boundary.
	Pad []types.UCHAR

	// Path (variable): A null-terminated string that represents the server and share
	// name of the resource to which the client attempts to connect. This field MUST be
	// encoded using Universal Naming Convention (UNC) syntax. If SMB_FLAGS2_UNICODE is
	// set in the Flags2 field of the SMB Header of the request, the string MUST be a
	// null-terminated array of 16-bit Unicode characters. Otherwise, the string MUST
	// be a null-terminated array of OEM characters. If the string consists of Unicode
	// characters, this field MUST be aligned to start on a 2-byte boundary from the
	// start of the SMB Header. A path in UNC syntax would be represented by a string
	// in the following form:
	Path types.SMB_STRING

	// Service (variable): The type of resource that the client attempts to access.
	// This field MUST be a null-terminated array of OEM characters even if the client
	// and server have negotiated to use Unicode strings. The valid values for this
	// field are as follows:
	Service types.OEM_STRING
}

TreeConnectAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/90bf689a-8536-4f03-9f1b-683ee4bdd67c

func NewTreeConnectAndxRequest

func NewTreeConnectAndxRequest() *TreeConnectAndxRequest

NewTreeConnectAndxRequest creates a new TreeConnectAndxRequest structure

Returns: - A pointer to the new TreeConnectAndxRequest structure

func (*TreeConnectAndxRequest) IsAndX

func (c *TreeConnectAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*TreeConnectAndxRequest) Marshal

func (c *TreeConnectAndxRequest) Marshal() ([]byte, error)

Marshal marshals the TreeConnectAndxRequest structure into a byte array

Returns: - A byte array representing the TreeConnectAndxRequest structure - An error if the marshaling fails

func (*TreeConnectAndxRequest) Unmarshal

func (c *TreeConnectAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeConnectAndxResponse

type TreeConnectAndxResponse struct {
	command_interface.Command

	// OptionalSupport (2 bytes): A 16-bit field. The following OptionalSupport field
	// flags are defined. Any combination of the following flags MUST be supported. All
	// undefined values are considered reserved. The server SHOULD set them to 0, and
	// the client MUST ignore them.
	OptionalSupport types.USHORT

	// Service (variable): The type of the shared resource to which the TID is connected.
	// The Service field MUST be encoded as a null-terminated array of OEM characters, even
	// if the client and server have negotiated to use Unicode strings. The valid values for
	// this field are as follows.
	Service types.OEM_STRING

	// NativeFileSystem (variable): The name of the file system on the local resource to
	// which the returned TID is connected. If SMB_FLAGS2_UNICODE is set in the Flags2 field
	// of the SMB Header of the response, this value MUST be a null-terminated string of Unicode
	// characters. Otherwise, this field MUST be a null-terminated string of OEM characters.
	// For resources that are not backed by a file system, such as the IPC$ share used for
	// named pipes, this field MUST be set to the empty string.
	NativeFileSystem types.SMB_STRING
}

TreeConnectAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3286744b-5b58-4ad5-b62e-c4f29a2492f1

func NewTreeConnectAndxResponse

func NewTreeConnectAndxResponse() *TreeConnectAndxResponse

NewTreeConnectAndxResponse creates a new TreeConnectAndxResponse structure

Returns: - A pointer to the new TreeConnectAndxResponse structure

func (*TreeConnectAndxResponse) IsAndX

func (c *TreeConnectAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*TreeConnectAndxResponse) Marshal

func (c *TreeConnectAndxResponse) Marshal() ([]byte, error)

Marshal marshals the TreeConnectAndxResponse structure into a byte array

Returns: - A byte array representing the TreeConnectAndxResponse structure - An error if the marshaling fails

func (*TreeConnectAndxResponse) Unmarshal

func (c *TreeConnectAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeConnectRequest

type TreeConnectRequest struct {
	command_interface.Command

	// BufferFormat1 (1 byte): A buffer format identifier. The value of this field MUST
	// be 0x04.
	// Path (variable): A null-terminated string that represents the server and share
	// name of the resource to which the client is attempting to connect. This field
	// MUST be encoded using Universal Naming Convention (UNC) syntax. The string MUST
	// be a null-terminated array of OEM characters, even if the client and server have
	// negotiated to use Unicode strings.
	Path types.OEM_STRING

	// BufferFormat2 (1 byte): A buffer format identifier. The value of this field MUST
	// be 0x04.
	// Password (variable): A null-terminated string that represents a share password
	// in plaintext form. The string MUST be a null-terminated array of OEM characters,
	// even if the client and server have negotiated to use Unicode strings.
	Password types.OEM_STRING

	// BufferFormat3 (1 byte): A buffer format identifier. The value of this field MUST
	// be 0x04.
	// Service (variable): A null-terminated string representing the type of resource
	// that the client intends to access. This field MUST be a null-terminated array of
	// OEM characters, even if the client and server have negotiated to use Unicode
	// strings. The valid values for this field are as follows:
	Service types.OEM_STRING
}

TreeConnectRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/0036eb81-7466-4e1c-afb6-ea8bc9dd19dc

func NewTreeConnectRequest

func NewTreeConnectRequest() *TreeConnectRequest

NewTreeConnectRequest creates a new TreeConnectRequest structure

Returns: - A pointer to the new TreeConnectRequest structure

func (*TreeConnectRequest) Marshal

func (c *TreeConnectRequest) Marshal() ([]byte, error)

Marshal marshals the TreeConnectRequest structure into a byte array

Returns: - A byte array representing the TreeConnectRequest structure - An error if the marshaling fails

func (*TreeConnectRequest) Unmarshal

func (c *TreeConnectRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeConnectResponse

type TreeConnectResponse struct {
	command_interface.Command

	// MaxBufferSize (2 bytes): The maximum size, in bytes, of the largest SMB message
	// that the server can receive. This is the size of the largest SMB message that
	// the client can send to the server. SMB message size includes the size of the SMB
	// Header (section 2.2.3.1), parameter, and data blocks. This size MUST NOT include
	// any transport-layer framing or other transport-layer data.
	MaxBufferSize types.USHORT

	// TID (2 bytes): The newly generated Tree ID, used in subsequent CIFS client
	// requests to refer to a resource relative to the SMB_Data.Bytes.Path specified in
	// the request. Most access to the server requires a valid TID, whether the resource
	// is password protected or not. The value 0xFFFF is reserved; the server MUST NOT
	// return a TID value of 0xFFFF.
	TID types.USHORT
}

TreeConnectResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f9a8a713-1c53-4fb0-908e-625389840cf8

func NewTreeConnectResponse

func NewTreeConnectResponse() *TreeConnectResponse

NewTreeConnectResponse creates a new TreeConnectResponse structure

Returns: - A pointer to the new TreeConnectResponse structure

func (*TreeConnectResponse) Marshal

func (c *TreeConnectResponse) Marshal() ([]byte, error)

Marshal marshals the TreeConnectResponse structure into a byte array

Returns: - A byte array representing the TreeConnectResponse structure - An error if the marshaling fails

func (*TreeConnectResponse) Unmarshal

func (c *TreeConnectResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeDisconnectRequest

type TreeDisconnectRequest struct {
	command_interface.Command
}

TreeDisconnectRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/354844d7-5d39-46d2-8e6b-727fcf53e98d

func NewTreeDisconnectRequest

func NewTreeDisconnectRequest() *TreeDisconnectRequest

NewTreeDisconnectRequest creates a new TreeDisconnectRequest structure

Returns: - A pointer to the new TreeDisconnectRequest structure

func (*TreeDisconnectRequest) Marshal

func (c *TreeDisconnectRequest) Marshal() ([]byte, error)

Marshal marshals the TreeDisconnectRequest structure into a byte array

Returns: - A byte array representing the TreeDisconnectRequest structure - An error if the marshaling fails

func (*TreeDisconnectRequest) Unmarshal

func (c *TreeDisconnectRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type TreeDisconnectResponse

type TreeDisconnectResponse struct {
	command_interface.Command
}

TreeDisconnectResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/7a4c4123-1e5d-4c3f-8a05-dd5e49694a6d

func NewTreeDisconnectResponse

func NewTreeDisconnectResponse() *TreeDisconnectResponse

NewTreeDisconnectResponse creates a new TreeDisconnectResponse structure

Returns: - A pointer to the new TreeDisconnectResponse structure

func (*TreeDisconnectResponse) Marshal

func (c *TreeDisconnectResponse) Marshal() ([]byte, error)

Marshal marshals the TreeDisconnectResponse structure into a byte array

Returns: - A byte array representing the TreeDisconnectResponse structure - An error if the marshaling fails

func (*TreeDisconnectResponse) Unmarshal

func (c *TreeDisconnectResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type UnlockByteRangeRequest

type UnlockByteRangeRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit signed integer indicating the
	// file from which the data MUST be read.
	FID types.SHORT

	// CountOfBytesToUnlock (4 bytes): This field is a 32-bit unsigned integer
	// indicating the number of contiguous bytes to be unlocked.
	CountOfBytesToUnlock types.ULONG

	// UnlockOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer
	// indicating the offset, in number of bytes, from which to begin the unlock.
	// Because this field is limited to 32-bits, this command is inappropriate for
	// files that have 64-bit offsets.
	UnlockOffsetInBytes types.ULONG
}

UnlockByteRangeRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/7d3d2faf-8421-4acc-885c-805162028764

func NewUnlockByteRangeRequest

func NewUnlockByteRangeRequest() *UnlockByteRangeRequest

NewUnlockByteRangeRequest creates a new UnlockByteRangeRequest structure

Returns: - A pointer to the new UnlockByteRangeRequest structure

func (*UnlockByteRangeRequest) Marshal

func (c *UnlockByteRangeRequest) Marshal() ([]byte, error)

Marshal marshals the UnlockByteRangeRequest structure into a byte array

Returns: - A byte array representing the UnlockByteRangeRequest structure - An error if the marshaling fails

func (*UnlockByteRangeRequest) Unmarshal

func (c *UnlockByteRangeRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type UnlockByteRangeResponse

type UnlockByteRangeResponse struct {
	command_interface.Command
}

UnlockByteRangeResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/620101d6-5422-4aeb-8a4a-7f39e0562893

func NewUnlockByteRangeResponse

func NewUnlockByteRangeResponse() *UnlockByteRangeResponse

NewUnlockByteRangeResponse creates a new UnlockByteRangeResponse structure

Returns: - A pointer to the new UnlockByteRangeResponse structure

func (*UnlockByteRangeResponse) Marshal

func (c *UnlockByteRangeResponse) Marshal() ([]byte, error)

Marshal marshals the UnlockByteRangeResponse structure into a byte array

Returns: - A byte array representing the UnlockByteRangeResponse structure - An error if the marshaling fails

func (*UnlockByteRangeResponse) Unmarshal

func (c *UnlockByteRangeResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndCloseRequest

type WriteAndCloseRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file to which the data SHOULD be written.
	FID types.USHORT

	// CountOfBytesToWrite (2 bytes): This field is a 16-bit unsigned integer
	// indicating the number of bytes to be written to the file. The client MUST ensure
	// that the amount of data sent can fit in the negotiated maximum buffer size. If
	// the value of this field is zero (0x0000), the server MUST truncate or extend the
	// file to match the WriteOffsetInBytes.
	CountOfBytesToWrite types.USHORT

	// WriteOffsetInBytes  (4 bytes): This field is a 32-bit unsigned integer indicating
	// the offset, in number of bytes, from the beginning of the file at which to begin
	// writing to the file. The client MUST ensure that the amount of data sent can
	// it in the negotiated maximum buffer size. Because this field is limited to 32-bits,
	// this command is inappropriate for files that have 64-bit offsets.
	WriteOffsetInBytes types.ULONG

	// LastWriteTime (4 bytes): This field is a 32-bit unsigned integer indicating the
	// number of seconds since Jan 1, 1970, 00:00:00.0. The server SHOULD set the last
	// write time of the file represented by the FID to this value. If the value is
	// zero (0x00000000), the server SHOULD use the current local time of the server to
	// set the value. Failure to set the time MUST NOT result in an error response from
	// the server.
	LastWriteTime types.FILETIME

	// Reserved (12 bytes): This field is optional. This field is reserved, and all
	// entries MUST be zero (0x00000000). This field is used only in the 12-word version
	// of the request.
	Reserved [3]types.ULONG

	// Pad (1 byte): The value of this field SHOULD be ignored. This is padding to
	// force the byte alignment to a double word boundary.
	Pad types.UCHAR

	// Data (variable): The raw bytes to be written to the file.
	Data []types.UCHAR
}

WriteAndCloseRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/99526875-4b5a-49cc-9686-68ab49825a65

func NewWriteAndCloseRequest

func NewWriteAndCloseRequest() *WriteAndCloseRequest

NewWriteAndCloseRequest creates a new WriteAndCloseRequest structure

Returns: - A pointer to the new WriteAndCloseRequest structure

func (*WriteAndCloseRequest) Marshal

func (c *WriteAndCloseRequest) Marshal() ([]byte, error)

Marshal marshals the WriteAndCloseRequest structure into a byte array

Returns: - A byte array representing the WriteAndCloseRequest structure - An error if the marshaling fails

func (*WriteAndCloseRequest) Unmarshal

func (c *WriteAndCloseRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndCloseResponse

type WriteAndCloseResponse struct {
	command_interface.Command

	// CountOfBytesWritten  (2 bytes): Indicates the actual number of bytes written to
	// the file. For successful writes, this MUST equal the CountOfBytesToWrite in the
	// client's request. If the number of bytes written differs from the number requested
	// and no error is indicated, then the server has no resources available with which
	// to satisfy the complete write.
	CountOfBytesWritten types.USHORT
}

WriteAndCloseResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/fcf13ef6-ce16-4143-a926-e7cafabaeea3

func NewWriteAndCloseResponse

func NewWriteAndCloseResponse() *WriteAndCloseResponse

NewWriteAndCloseResponse creates a new WriteAndCloseResponse structure

Returns: - A pointer to the new WriteAndCloseResponse structure

func (*WriteAndCloseResponse) Marshal

func (c *WriteAndCloseResponse) Marshal() ([]byte, error)

Marshal marshals the WriteAndCloseResponse structure into a byte array

Returns: - A byte array representing the WriteAndCloseResponse structure - An error if the marshaling fails

func (*WriteAndCloseResponse) Unmarshal

func (c *WriteAndCloseResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndUnlockRequest

type WriteAndUnlockRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file to which the data MUST be written.
	FID types.USHORT

	// CountOfBytesToWrite (2 bytes): This field is a 16-bit unsigned integer
	// indicating the number of bytes to be written to the file. The client MUST ensure
	// that the amount of data sent can fit in the negotiated maximum buffer size.
	CountOfBytesToWrite types.USHORT

	// WriteOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer indicating
	// the offset, in number of bytes, from the beginning of the file at which to begin
	// writing to the file. The client MUST ensure that the amount of data sent can fit
	// in the negotiated maximum buffer size. Because this field is limited to 32 bits,
	// this command is inappropriate for files that have 64-bit offsets.
	WriteOffsetInBytes types.ULONG

	// EstimateOfRemainingBytesToBeWritten (2 bytes): This field is a 16-bit unsigned
	// integer indicating the remaining number of bytes that the client designates to
	// write to the file. This is an advisory field and MAY be zero. This information
	// can be used by the server to optimize cache behavior.
	EstimateOfRemainingBytesToBeWritten types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x01.
	// DataLength (2 bytes): This field MUST be CountOfBytesToWrite.
	// Data (variable): The raw bytes to be written to the file.
	Data types.SMB_STRING
}

WriteAndUnlockRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c03fec3f-d709-4e7f-96b1-de9760766f77

func NewWriteAndUnlockRequest

func NewWriteAndUnlockRequest() *WriteAndUnlockRequest

NewWriteAndUnlockRequest creates a new WriteAndUnlockRequest structure

Returns: - A pointer to the new WriteAndUnlockRequest structure

func (*WriteAndUnlockRequest) Marshal

func (c *WriteAndUnlockRequest) Marshal() ([]byte, error)

Marshal marshals the WriteAndUnlockRequest structure into a byte array

Returns: - A byte array representing the WriteAndUnlockRequest structure - An error if the marshaling fails

func (*WriteAndUnlockRequest) Unmarshal

func (c *WriteAndUnlockRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndUnlockResponse

type WriteAndUnlockResponse struct {
	command_interface.Command

	// CountOfBytesWritten (2 bytes): Indicates the actual number of bytes written
	// to the file. For successful writes, this MUST equal the CountOfBytesToWrite
	// in the client Request. If the number of bytes written differs from the number
	// requested and no error is indicated, then the server has no resources available
	// to satisfy the complete write.
	CountOfBytesWritten types.USHORT
}

WriteAndUnlockResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/6d09be23-58ea-4966-b1be-86f27c8ea45a

func NewWriteAndUnlockResponse

func NewWriteAndUnlockResponse() *WriteAndUnlockResponse

NewWriteAndUnlockResponse creates a new WriteAndUnlockResponse structure

Returns: - A pointer to the new WriteAndUnlockResponse structure

func (*WriteAndUnlockResponse) Marshal

func (c *WriteAndUnlockResponse) Marshal() ([]byte, error)

Marshal marshals the WriteAndUnlockResponse structure into a byte array

Returns: - A byte array representing the WriteAndUnlockResponse structure - An error if the marshaling fails

func (*WriteAndUnlockResponse) Unmarshal

func (c *WriteAndUnlockResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndxRequest

type WriteAndxRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid FID indicating the file to which the
	// data SHOULD be written.
	FID types.USHORT

	// Offset (4 bytes): If WordCount is 0x0C, this field represents a 32-bit offset,
	// measured in bytes, of where the write SHOULD start relative to the beginning of
	// the file. If WordCount is 0xE, this field represents the lower 32 bits of a
	// 64-bit offset.
	Offset types.ULONG

	// Timeout (4 bytes): This field is the time-out, in milliseconds, to wait for the
	// write to complete. This field is used only when writing to a named pipe or an
	// I/O device. It does not apply and MUST be 0x00000000 when writing to a regular
	// file.
	Timeout types.ULONG

	// WriteMode (2 bytes): A 16-bit field containing flags defined as follows:
	WriteMode types.USHORT

	// Remaining (2 bytes): This field is an advisory field telling the server
	// approximately how many bytes are to be written to this file before the next
	// non-write operation. It SHOULD include the number of bytes to be written by this
	// request. The server MAY either ignore this field or use it to perform
	// optimizations. If a pipe write spans multiple requests, the client SHOULD set
	// this field to the number of bytes remaining to be written.
	Remaining types.USHORT

	// Reserved (2 bytes): This field MUST be 0x0000.
	Reserved types.USHORT

	// DataLength (2 bytes): This field is the number of bytes included in the SMB_Data
	// that are to be written to the file.
	DataLength types.USHORT

	// The DataOffset field can be used to relocate the SMB_Data.Bytes.Data block to
	// the end of the message, even if the message is a multi-part AndX chain. If the
	// SMB_Data.Bytes.Data block is relocated, the contents of SMB_Data.Bytes will not
	// be contiguous.
	DataOffset types.USHORT

	// OffsetHigh (4 bytes): This field is optional. If WordCount is 0x0C, this field
	// is not included in the request. If WordCount is 0x0E, this field represents the
	// upper 32 bits of a 64-bit offset, measured in bytes, of where the write SHOULD
	// start relative to the beginning of the file.
	OffsetHigh types.ULONG

	// Pad (1 byte): Padding byte that MUST be ignored.
	Pad types.UCHAR

	// Data (variable): The raw bytes to be written to the file.
	Data []types.UCHAR
}

WriteAndxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/a66126d2-a1db-446b-8736-b9f5559c49bd

func NewWriteAndxRequest

func NewWriteAndxRequest() *WriteAndxRequest

NewWriteAndxRequest creates a new WriteAndxRequest structure

Returns: - A pointer to the new WriteAndxRequest structure

func (*WriteAndxRequest) IsAndX

func (c *WriteAndxRequest) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*WriteAndxRequest) Marshal

func (c *WriteAndxRequest) Marshal() ([]byte, error)

Marshal marshals the WriteAndxRequest structure into a byte array

Returns: - A byte array representing the WriteAndxRequest structure - An error if the marshaling fails

func (*WriteAndxRequest) Unmarshal

func (c *WriteAndxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteAndxResponse

type WriteAndxResponse struct {
	command_interface.Command

	// Count (2 bytes): The number of bytes written to the file.
	Count types.USHORT

	// Available (2 bytes): This field is valid when writing to named pipes or I/O
	// devices. This field indicates the number of bytes remaining to be written after
	// the requested write was completed. If the client wrote to a disk file, this
	// field MUST be set to 0xFFFF.
	Available types.USHORT

	// Reserved (4 bytes): This field MUST be 0x00000000.
	Reserved types.ULONG
}

WriteAndxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/43a10562-269f-4536-b460-17b494405cc4

func NewWriteAndxResponse

func NewWriteAndxResponse() *WriteAndxResponse

NewWriteAndxResponse creates a new WriteAndxResponse structure

Returns: - A pointer to the new WriteAndxResponse structure

func (*WriteAndxResponse) IsAndX

func (c *WriteAndxResponse) IsAndX() bool

IsAndX returns true if the command is an AndX

func (*WriteAndxResponse) Marshal

func (c *WriteAndxResponse) Marshal() ([]byte, error)

Marshal marshals the WriteAndxResponse structure into a byte array

Returns: - A byte array representing the WriteAndxResponse structure - An error if the marshaling fails

func (*WriteAndxResponse) Unmarshal

func (c *WriteAndxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteMpxRequest

type WriteMpxRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file to which the data is to be written.
	FID types.USHORT

	// TotalByteCount (2 bytes): The requested total number of bytes to write to the
	// file. The value MAY exceed the negotiated buffer size.
	TotalByteCount types.USHORT

	// Reserved (2 bytes): The server MUST ignore this value.
	Reserved types.USHORT

	// ByteOffsetToBeginWrite (4 bytes): The offset, in bytes, from the start of the file
	// at which the write is to begin. This value indicates the offset at which to write the
	// data contained in the SMB_Data.Bytes.Buffer field of the same message.
	ByteOffsetToBeginWrite types.ULONG

	// Timeout (4 bytes): This field MUST be ignored by the server.
	Timeout types.ULONG

	// WriteMode (2 bytes): A 16-bit field containing flags defined as follows.
	WriteMode types.USHORT

	// RequestMask (4 bytes): This field is a bit mask indicating this SMB request's
	// identity to the server. The server's response MUST contain the logical OR of all
	// of the RequestMask values received. This response MUST be generated.
	RequestMask types.ULONG

	// DataLength (2 bytes): This field value is the number of data bytes included in
	// this request.
	DataLength types.USHORT

	// DataOffset (2 bytes): This field value is the offset, in bytes, from the start
	// of the SMB Header (section 2.2.3.1) to the start of the data buffer.
	DataOffset types.USHORT

	// Pad (variable): Null padding bytes to align Buffer to a 16- or 32-bit boundary.
	Pad []types.UCHAR

	// Buffer (variable): The raw data, in bytes, that is to be written to the file.
	Buffer []types.UCHAR
}

WriteMpxRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/c7fa0e9f-343b-47df-8157-719a3ca9035c

func NewWriteMpxRequest

func NewWriteMpxRequest() *WriteMpxRequest

NewWriteMpxRequest creates a new WriteMpxRequest structure

Returns: - A pointer to the new WriteMpxRequest structure

func (*WriteMpxRequest) Marshal

func (c *WriteMpxRequest) Marshal() ([]byte, error)

Marshal marshals the WriteMpxRequest structure into a byte array

Returns: - A byte array representing the WriteMpxRequest structure - An error if the marshaling fails

func (*WriteMpxRequest) Unmarshal

func (c *WriteMpxRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteMpxResponse

type WriteMpxResponse struct {
	command_interface.Command

	// ResponseMask (4 bytes): This field is the logical OR-ing of the RequestMask
	// value contained in each SMB_COM_WRITE_MPX (section 2.2.4.26) received since the
	// last sequenced SMB_COM_WRITE_MPX. The server responds only to the final
	// (sequenced) command. This response contains the accumulated ResponseMask from
	// all successfully received requests. The client uses the ResponseMask received to
	// determine which packets, if any, MUST be retransmitted.
	ResponseMask types.ULONG
}

WriteMpxResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/25efbb00-5ad0-42a2-8861-99a79c4d63fe

func NewWriteMpxResponse

func NewWriteMpxResponse() *WriteMpxResponse

NewWriteMpxResponse creates a new WriteMpxResponse structure

Returns: - A pointer to the new WriteMpxResponse structure

func (*WriteMpxResponse) Marshal

func (c *WriteMpxResponse) Marshal() ([]byte, error)

Marshal marshals the WriteMpxResponse structure into a byte array

Returns: - A byte array representing the WriteMpxResponse structure - An error if the marshaling fails

func (*WriteMpxResponse) Unmarshal

func (c *WriteMpxResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WritePrintFileRequest

type WritePrintFileRequest struct {
	command_interface.Command

	// FID: This field MUST be a valid FID that is created using the
	// SMB_COM_OPEN_PRINT_FILE command.
	FID types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x01.
	// DataLength (2 bytes): Length, in bytes, of the following data block.
	// Data (variable): STRING Bytes to be written to the spool file indicated by FID.
	Data types.SMB_STRING
}

WritePrintFileRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1f2768bc-c966-4ca9-b43f-857efa3b725a

func NewWritePrintFileRequest

func NewWritePrintFileRequest() *WritePrintFileRequest

NewWritePrintFileRequest creates a new WritePrintFileRequest structure

Returns: - A pointer to the new WritePrintFileRequest structure

func (*WritePrintFileRequest) Marshal

func (c *WritePrintFileRequest) Marshal() ([]byte, error)

Marshal marshals the WritePrintFileRequest structure into a byte array

Returns: - A byte array representing the WritePrintFileRequest structure - An error if the marshaling fails

func (*WritePrintFileRequest) Unmarshal

func (c *WritePrintFileRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WritePrintFileResponse

type WritePrintFileResponse struct {
	command_interface.Command
}

WritePrintFileResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/2c9b7ac3-3dc8-4624-9ce4-80306c8c6d3a

func NewWritePrintFileResponse

func NewWritePrintFileResponse() *WritePrintFileResponse

NewWritePrintFileResponse creates a new WritePrintFileResponse structure

Returns: - A pointer to the new WritePrintFileResponse structure

func (*WritePrintFileResponse) Marshal

func (c *WritePrintFileResponse) Marshal() ([]byte, error)

Marshal marshals the WritePrintFileResponse structure into a byte array

Returns: - A byte array representing the WritePrintFileResponse structure - An error if the marshaling fails

func (*WritePrintFileResponse) Unmarshal

func (c *WritePrintFileResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteRawFinal

type WriteRawFinal struct {
	command_interface.Command

	// Count (2 bytes): This field contains the total number of bytes written to the file
	// by the server.
	Count types.USHORT
}

WriteRawFinal Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/f767334e-7724-4f41-b5df-31b56d3b4328

func NewWriteRawFinal

func NewWriteRawFinal() *WriteRawFinal

NewWriteRawFinal creates a new WriteRawFinal structure

Returns: - A pointer to the new WriteRawFinal structure

func (*WriteRawFinal) Marshal

func (c *WriteRawFinal) Marshal() ([]byte, error)

Marshal marshals the WriteRawFinal structure into a byte array

Returns: - A byte array representing the WriteRawFinal structure - An error if the marshaling fails

func (*WriteRawFinal) Unmarshal

func (c *WriteRawFinal) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteRawInterim

type WriteRawInterim struct {
	command_interface.Command

	// Available (2 bytes): This field is valid when writing to named pipe or I/O
	// devices. This field indicates the number of bytes remaining to be written after
	// the requested write was completed. If the client writes to a disk file, this
	// field MUST be set to 0xFFFF.
	Available types.USHORT
}

WriteRawInterim Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/d115b1d2-1492-42aa-b37f-222bfe272fbd

func NewWriteRawInterim

func NewWriteRawInterim() *WriteRawInterim

NewWriteRawInterim creates a new WriteRawInterim structure

Returns: - A pointer to the new WriteRawInterim structure

func (*WriteRawInterim) Marshal

func (c *WriteRawInterim) Marshal() ([]byte, error)

Marshal marshals the WriteRawInterim structure into a byte array

Returns: - A byte array representing the WriteRawInterim structure - An error if the marshaling fails

func (*WriteRawInterim) Unmarshal

func (c *WriteRawInterim) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteRawRequest

type WriteRawRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file, named pipe, or device to which the data MUST be written.
	FID types.USHORT

	// CountOfBytes (2 bytes): The total number of bytes to be written to the file during
	// the entire dialog. The value MAY exceed the maximum buffer size (MaxBufferSize)
	// established for the session.
	CountOfBytes types.USHORT

	// Reserved1 (2 bytes): This field is reserved and MUST be ignored by the server.
	Reserved1 types.USHORT

	// Offset (4 bytes): The offset, in bytes, from the start of the file at which the
	// write SHOULD begin. If WordCount is 0x0E, this is the lower 32 bits of a 64-bit value.
	Offset types.ULONG

	// Timeout (4 bytes): This field is the time-out, in milliseconds, to wait for the write
	// to complete. This field is optionally honored only when writing to a named pipe or I/O
	// device. It does not apply and MUST be 0x00000000 when writing to a regular file.
	Timeout types.ULONG

	// WriteMode (2 bytes): A 16-bit field containing flags defined as follows. The flag
	// names below are provided for reference only.
	// If WritethroughMode is not set, this SMB is assumed to be a form of write behind
	// (cached write). The SMB transport layer guarantees delivery of raw data from the client.
	// If an error occurs at the server end, all bytes MUST be received and discarded. If an
	// error occurs while writing data to disk (such as disk full) the next access to the file
	// handle (another write, close, read, etc.) MUST result in an error, reporting this situation.
	// If WritethroughMode is set, the server MUST receive the data, write it to disk and
	// then send a Final Server Response (section 2.2.4.25.3) indicating the result of the write.
	// The total number of bytes successfully written MUST also be returned in the SMB_Parameters.Count
	// field of the response.
	WriteMode types.USHORT

	// Reserved2 (4 bytes): This field MUST be 0x00000000.
	Reserved2 types.ULONG

	// DataLength (2 bytes): This field is the number of bytes included in the SMB_Data
	// block that are to be written to the file.
	DataLength types.USHORT

	// DataOffset (2 bytes): This field is the offset, in bytes, from the start of the
	// SMB Header (section 2.2.3.1) to the start of the data to be written to the file
	// from the Data[] field. Specifying this offset allows the client to efficiently
	// align the data buffer.
	DataOffset types.USHORT

	// OffsetHigh (4 bytes): If WordCount is 0x0E, this is the upper 32 bits of the 64-bit
	// offset in bytes from the start of the file at which the write MUST start. Support
	// of this field is optional.
	OffsetHigh types.ULONG

	// Pad (variable): Padding bytes for the client to align the data on an appropriate
	// boundary for transfer of the SMB transport. The server MUST ignore these bytes.
	Pad []types.UCHAR

	// Data (variable): The bytes to be written to the file.
	Data []types.UCHAR
}

WriteRawRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1ff2a25f-efe2-470c-a780-b06ef46c4089

func NewWriteRawRequest

func NewWriteRawRequest() *WriteRawRequest

NewWriteRawRequest creates a new WriteRawRequest structure

Returns: - A pointer to the new WriteRawRequest structure

func (*WriteRawRequest) Marshal

func (c *WriteRawRequest) Marshal() ([]byte, error)

Marshal marshals the WriteRawRequest structure into a byte array

Returns: - A byte array representing the WriteRawRequest structure - An error if the marshaling fails

func (*WriteRawRequest) Unmarshal

func (c *WriteRawRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteRequest

type WriteRequest struct {
	command_interface.Command

	// FID (2 bytes): This field MUST be a valid 16-bit unsigned integer indicating the
	// file to which the data MUST be written.
	FID types.USHORT

	// CountOfBytesToWrite (2 bytes): This field is a 16-bit unsigned integer
	// indicating the number of bytes to be written to the file. The client MUST ensure
	// that the amount of data sent can fit in the negotiated maximum buffer size.
	CountOfBytesToWrite types.USHORT

	// WriteOffsetInBytes (4 bytes): This field is a 32-bit unsigned integer indicating
	// the offset, in number of bytes, from the beginning of the file at which to begin
	// writing to the file. The client MUST ensure that the amount of data sent fits in
	// the negotiated maximum buffer size. Because this field is limited to 32 bits,
	// this command is inappropriate for files that have 64-bit offsets.
	WriteOffsetInBytes types.ULONG

	// EstimateOfRemainingBytesToBeWritten (2 bytes): This field is a 16-bit unsigned
	// integer indicating the remaining number of bytes that the client anticipates to
	// write to the file. This is an advisory field and can be 0x0000. This information
	// can be used by the server to optimize cache behavior.
	EstimateOfRemainingBytesToBeWritten types.USHORT

	// BufferFormat (1 byte): This field MUST be 0x01.
	// DataLength (2 bytes): This field MUST match SMB_Parameters.CountOfBytesToWrite.
	// Data (variable): The raw bytes to be written to the file.
	Data types.SMB_STRING
}

WriteRequest Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/861c96cf-d6b1-4fb9-b6e3-1783220813ad

func NewWriteRequest

func NewWriteRequest() *WriteRequest

NewWriteRequest creates a new WriteRequest structure

Returns: - A pointer to the new WriteRequest structure

func (*WriteRequest) Marshal

func (c *WriteRequest) Marshal() ([]byte, error)

Marshal marshals the WriteRequest structure into a byte array

Returns: - A byte array representing the WriteRequest structure - An error if the marshaling fails

func (*WriteRequest) Unmarshal

func (c *WriteRequest) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

type WriteResponse

type WriteResponse struct {
	command_interface.Command

	// CountOfBytesWritten (2 bytes): Indicates the actual number of bytes written to
	// the file. For successful writes, this MUST equal the CountOfBytesToWrite in the
	// client Request. If the number of bytes written differs from the number requested
	// and no error is indicated, then the server has no resources available to satisfy
	// the complete write.
	CountOfBytesWritten types.USHORT
}

WriteResponse Source: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/3f68a73c-e6d6-4383-b81a-d49c2eb4234b

func NewWriteResponse

func NewWriteResponse() *WriteResponse

NewWriteResponse creates a new WriteResponse structure

Returns: - A pointer to the new WriteResponse structure

func (*WriteResponse) Marshal

func (c *WriteResponse) Marshal() ([]byte, error)

Marshal marshals the WriteResponse structure into a byte array

Returns: - A byte array representing the WriteResponse structure - An error if the marshaling fails

func (*WriteResponse) Unmarshal

func (c *WriteResponse) Unmarshal(data []byte) (int, error)

Unmarshal unmarshals a byte array into the command structure

Parameters: - data: The byte array to unmarshal

Returns: - The number of bytes unmarshalled

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL