smb2

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SMB2CloseRequestMinSize       = 24
	SMB2CloseRequestStructureSize = 24

	SMB2CloseResponseMinSize       = 60
	SMB2CloseResponseStructureSize = 60
)
View Source
const (
	SMB2CreateRequestMinSize       = 57
	SMB2CreateRequestStructureSize = 57

	SMB2CreateResponseMinSize       = 88
	SMB2CreateResponseStructureSize = 89
)
View Source
const (
	// Oplock level
	OPLOCK_LEVEL_NONE      = 0x00
	OPLOCK_LEVEL_II        = 0x01
	OPLOCK_LEVEL_EXCLUSIVE = 0x08
	OPLOCK_LEVEL_BATCH     = 0x09
	OPLOCK_LEVEL_LEASE     = 0xff
)
View Source
const (
	// Impersonation level
	IMPERSONATION_ANONYMOUS      = 0x00000000
	IMPERSONATION_IDENTIFICATION = 0x00000001
	IMPERSONATION_IMPERSONATION  = 0x00000002
	IMPERSONATION_DELEGATE       = 0x00000003
)
View Source
const (
	// Share access
	FILE_SHARE_READ   = 0x00000001
	FILE_SHARE_WRITE  = 0x00000002
	FILE_SHARE_DELETE = 0x00000004
)
View Source
const (
	// Create disposition
	FILE_SUPERSEDE    = 0x00000000
	FILE_OPEN         = 0x00000001
	FILE_CREATE       = 0x00000002
	FILE_OPEN_IF      = 0x00000003
	FILE_OVERWRITE    = 0x00000004
	FILE_OVERWRITE_IF = 0x00000005
)
View Source
const (
	// Create options
	FILE_DIRECTORY_FILE            = 0x00000001
	FILE_WRITE_THROUGH             = 0x00000002
	FILE_SEQUENTIAL_ONLY           = 0x00000004
	FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008
	FILE_SYNCHRONOUS_IO_ALERT      = 0x00000010
	FILE_SYNCHRONOUS_IO_NONALERT   = 0x00000020
	FILE_NON_DIRECTORY_FILE        = 0x00000040
	FILE_COMPLETE_IF_OPLOCKED      = 0x00000100
	FILE_NO_EA_KNOWLEDGE           = 0x00000200
	FILE_OPEN_REMOTE_INSTANCE      = 0x00000400
	FILE_RANDOM_ACCESS             = 0x00000800
	FILE_DELETE_ON_CLOSE           = 0x00001000
	FILE_OPEN_BY_FILE_ID           = 0x00002000
	FILE_OPEN_FOR_BACKUP_INTENT    = 0x00004000
	FILE_NO_COMPRESSION            = 0x00008000
	FILE_OPEN_REQUIRING_OPLOCK     = 0x00010000
	FILE_DISALLOW_EXCLUSIVE        = 0x00020000
	FILE_RESERVE_OPFILTER          = 0x00100000
	FILE_OPEN_REPARSE_POINT        = 0x00200000
	FILE_OPEN_NO_RECALL            = 0x00400000
	FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000
)
View Source
const (
	// File attributes
	FILE_ATTRIBUTE_READONLY              = 0x00000001
	FILE_ATTRIBUTE_HIDDEN                = 0x00000002
	FILE_ATTRIBUTE_SYSTEM                = 0x00000004
	FILE_ATTRIBUTE_DIRECTORY             = 0x00000010
	FILE_ATTRIBUTE_ARCHIVE               = 0x00000020
	FILE_ATTRIBUTE_NORMAL                = 0x00000080
	FILE_ATTRIBUTE_TEMPORARY             = 0x00000100
	FILE_ATTRIBUTE_SPARSE_FILE           = 0x00000200
	FILE_ATTRIBUTE_REPARSE_POINT         = 0x00000400
	FILE_ATTRIBUTE_COMPRESSED            = 0x00000800
	FILE_ATTRIBUTE_OFFLINE               = 0x00001000
	FILE_ATTRIBUTE_NOT_CONTENT_INDEXED   = 0x00002000
	FILE_ATTRIBUTE_ENCRYPTED             = 0x00004000
	FILE_ATTRIBUTE_INTEGRITY_STREAM      = 0x00008000
	FILE_ATTRIBUTE_NO_SCRUB_DATA         = 0x00020000
	FILE_ATTRIBUTE_RECALL_ON_OPEN        = 0x00040000
	FILE_ATTRIBUTE_PINNED                = 0x00080000
	FILE_ATTRIBUTE_UNPINNED              = 0x00100000
	FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x00400000
)
View Source
const (
	// Create context
	CREATE_EA_BUFFER                    = 0x45787441
	CREATE_SD_BUFFER                    = 0x53656344
	CREATE_DURABLE_HANDLE_REQUEST       = 0x44486e51
	CREATE_DURABLE_HANDLE_RECONNECT     = 0x44486e43
	CREATE_ALLOCATION_SIZE              = 0x416c5369
	CREATE_QUERY_MAXIMAL_ACCESS_REQUEST = 0x4d784163
	CREATE_TIMEWAROP_TOKEN              = 0x54577270
	CREATE_QUERY_ON_DISK_ID             = 0x51466964
	CREATE_REQUEST_LEASE                = 0x52714c73
)
View Source
const (
	OplockNone int = iota
	OplockHeld
	OplockBreaking
)
View Source
const (
	// Create action
	FILE_SUPERSEDED  = 0x00000000
	FILE_OPENED      = 0x00000001
	FILE_CREATED     = 0x00000002
	FILE_OVERWRITTEN = 0x00000003
)
View Source
const (
	SMB2ErrorResponseMinSize       = 8
	SMB2ErrorResponseStructureSize = 9
)
View Source
const (
	STATUS_OK                       = 0x00000000
	STATUS_PENDING                  = 0x00000103
	STATUS_NOTIFY_CLEANUP           = 0x0000010b
	STATUS_NOTIFY_ENUM_DIR          = 0x0000010c
	STATUS_NO_MORE_FILES            = 0x80000006
	STATUS_INFO_LENGTH_MISMATCH     = 0xc0000004
	STATUS_INVALID_HANDLE           = 0xc0000008
	STATUS_INVALID_PARAMETER        = 0xc000000d
	STATUS_NO_SUCH_FILE             = 0xc000000f
	STATUS_END_OF_FILE              = 0xc0000011
	STATUS_MORE_PROCESSING_REQUIRED = 0xc0000016
	STATUS_ACCESS_DENIED            = 0xc0000022
	STATUS_OBJECT_NAME_NOT_FOUND    = 0xc0000034
	STATUS_OBJECT_NAME_COLLISION    = 0xc0000035
	STATUS_DATA_ERROR               = 0xc000003e
	STATUS_EAS_NOT_SUPPORTED        = 0xc000004f
	STATUS_NO_SUCH_USER             = 0xc0000064
	STATUS_NONE_MAPPED              = 0xc0000073
	STATUS_IO_TIMEOUT               = 0xc00000b5
	STATUS_NOT_SUPPORTED            = 0xc00000bb
	STATUS_NETWORK_NAME_DELETED     = 0xc00000c9
	STATUS_NETWORK_ACCESS_DENIED    = 0xc00000ca
	STATUS_BAD_NETWORK_NAME         = 0xc00000cc
	STATUS_CANCELLED                = 0xc0000120
	STATUS_FILE_CLOSED              = 0xc0000128
	STATUS_USER_SESSION_DELETED     = 0xc0000203
	STATUS_NOT_FOUND                = 0xc0000225
	STATUS_DUPLICATE_OBJECTID       = 0xc000022a
)
View Source
const (
	SMB2FlushRequestMinSize       = 24
	SMB2FlushRequestStructureSize = 24

	SMB2FlushResponseMinSize       = 4
	SMB2FlushResponseStructureSize = 4
)
View Source
const (
	PROTOCOL_SMB             = 0x424d53ff
	PROTOCOL_SMB2            = 0x424d53fe
	PROTOCOL_SMB2_ENCRYPTED  = 0x424d53fd
	PROTOCOL_SMB2_COMPRESSED = 0x424d53fc
)
View Source
const (
	SMB_COM_NEGOTIATE = 0x72

	SMB2_NEGOTIATE                     = 0x0000
	SMB2_SESSION_SETUP                 = 0x0001
	SMB2_LOGOFF                        = 0x0002
	SMB2_TREE_CONNECT                  = 0x0003
	SMB2_TREE_DISCONNECT               = 0x0004
	SMB2_CREATE                        = 0x0005
	SMB2_CLOSE                         = 0x0006
	SMB2_FLUSH                         = 0x0007
	SMB2_READ                          = 0x0008
	SMB2_WRITE                         = 0x0009
	SMB2_LOCK                          = 0x000a
	SMB2_IOCTL                         = 0x000b
	SMB2_CANCEL                        = 0x000c
	SMB2_ECHO                          = 0x000d
	SMB2_QUERY_DIRECTORY               = 0x000e
	SMB2_CHANGE_NOTIFY                 = 0x000f
	SMB2_QUERY_INFO                    = 0x0010
	SMB2_SET_INFO                      = 0x0011
	SMB2_OPLOCK_BREAK                  = 0x0012
	SMB2_SERVER_TO_CLIENT_NOTIFICATION = 0x0013
)
View Source
const (
	FLAGS_SERVER_TO_REDIR    = 0x00000001
	FLAGS_ASYNC_COMMAND      = 0x00000002
	FLAGS_RELATED_OPERATIONS = 0x00000004
	FLAGS_SIGNED             = 0x00000008
	FLAGS_PRIORITY_MASK      = 0x00000070
	FLAGS_DFS_OPERATIONS     = 0x10000000
	FLAGS_REPLAY_OPERATION   = 0x20000000
)
View Source
const (
	SMBHeaderSize  = 32
	SMB2HeaderSize = 64

	SMB2HeaderStructureSize = 64
)
View Source
const (
	SMB2SetInfoRequestMinSize       = 32
	SMB2SetInfoRequestStructureSize = 33

	SMB2SetInfoResponseMinSize       = 2
	SMB2SetInfoResponseStructureSize = 2
)
View Source
const (
	SMB2IoctlRequestMinSize       = 56
	SMB2IoctlRequestStructureSize = 57

	SMB2IoctlResponseMinSize       = 48
	SMB2IoctlResponseStructureSize = 49
)
View Source
const (
	FSCTL_DFS_GET_REFERRALS            = 0x00060194
	FSCTL_PIPE_PEEK                    = 0x0011400c
	FSCTL_PIPE_WAIT                    = 0x00110018
	FSCTL_PIPE_TRANSCEIVE              = 0x0011c017
	FSCTL_SRV_COPYCHUNK                = 0x001440f2
	FSCTL_SRV_ENUMERATE_SNAPSHOTS      = 0x00144064
	FSCTL_SRV_REQUEST_RESUME_KEY       = 0x00140078
	FSCTL_SRV_READ_HASH                = 0x001441bb
	FSCTL_SRV_COPYCHUNK_WRITE          = 0x001480f2
	FSCTL_LMR_REQUEST_RESILIENCY       = 0x001401d4
	FSCTL_QUERY_NETWORK_INTERFACE_INFO = 0x001401fc
	FSCTL_SET_REPARSE_POINT            = 0x000900a4
	FSCTL_DFS_GET_REFERRALS_EX         = 0x000601b0
	FSCTL_FILE_LEVEL_TRIM              = 0x00098208
	FSCTL_VALIDATE_NEGOTIATE_INFO      = 0x00140204
	FSCTL_CREATE_OR_GET_OBJECT_ID      = 0x000900c0
)
View Source
const (
	SMB2LockRequestMinSize       = 24
	SMB2LockRequestStructureSize = 48

	SMB2LockResponseMinSize       = 4
	SMB2LockResponseStructureSize = 4
)
View Source
const (
	LOCKFLAG_SHARED_LOCK      = 0x00000001
	LOCKFLAG_EXCLUSIVE_LOCK   = 0x00000002
	LOCKFLAG_UNLOCK           = 0x00000004
	LOCKFLAG_FAIL_IMMEDIATELY = 0x00000010
)
View Source
const (
	SMB2LogoffRequestMinSize       = 4
	SMB2LogoffRequestStructureSize = 4

	SMB2LogoffResponseMinSize       = 4
	SMB2LogoffResponseStructureSize = 4
)
View Source
const (
	SMBNegotiateRequestMinSize = 5

	SMB2NegotiateRequestMinSize       = 36
	SMB2NegotiateRequestStructureSize = 36

	SMB2NegotiateResponseMinSize       = 64
	SMB2NegotiateResponseStructureSize = 65
)
View Source
const (
	MaxTransactSize = 1048576 * 4
	MaxReadSize     = 1048576 * 4
	MaxWriteSize    = 1048576 * 4
)
View Source
const (
	SMB_DIALECT_1     = "NT LM 0.12"
	SMB_DIALECT_2     = "SMB 2.002"
	SMB_DIALECT_MULTI = "SMB 2.???"

	SMB_DIALECT_202         = 0x0202
	SMB_DIALECT_21          = 0x0210
	SMB_DIALECT_30          = 0x0300
	SMB_DIALECT_302         = 0x0302
	SMB_DIALECT_311         = 0x0311
	SMB_DIALECT_MULTICREDIT = 0x02ff
	SMB_DIALECT_UNKNOWN     = 0xffff
)
View Source
const (
	NEGOTIATE_SIGNING_ENABLED  = 0x0001
	NEGOTIATE_SIGNING_REQUIRED = 0x0002
)
View Source
const (
	GLOBAL_CAP_DFS                = 0x00000001
	GLOBAL_CAP_LEASING            = 0x00000002
	GLOBAL_CAP_LARGE_MTU          = 0x00000004
	GLOBAL_CAP_MULTI_CHANNEL      = 0x00000008
	GLOBAL_CAP_PERSISTENT_HANDLES = 0x00000010
	GLOBAL_CAP_DIRECTORY_LEASING  = 0x00000020
	GLOBAL_CAP_ENCRYPTION         = 0x00000040
	GLOBAL_CAP_NOTIFICATIONS      = 0x00000080
)
View Source
const (
	SMB2ChangeNotifyRequestMinSize       = 32
	SMB2ChangeNotifyRequestStructureSize = 32

	SMB2ChangeNotifyResponseMinSize       = 8
	SMB2ChangeNotifyResponseStructureSize = 9
)
View Source
const (
	FILE_NOTIFY_CHANGE_FILE_NAME    = 0x00000001
	FILE_NOTIFY_CHANGE_DIR_NAME     = 0x00000002
	FILE_NOTIFY_CHANGE_ATTRIBUTES   = 0x00000004
	FILE_NOTIFY_CHANGE_SIZE         = 0x00000008
	FILE_NOTIFY_CHANGE_LAST_WRITE   = 0x00000010
	FILE_NOTIFY_CHANGE_LAST_ACCESS  = 0x00000020
	FILE_NOTIFY_CHANGE_CREATION     = 0x00000040
	FILE_NOTIFY_CHANGE_EA           = 0x00000080
	FILE_NOTIFY_CHANGE_SECURITY     = 0x00000100
	FILE_NOTIFY_CHANGE_STREAM_NAME  = 0x00000200
	FILE_NOTIFY_CHANGE_STREAM_SIZE  = 0x00000400
	FILE_NOTIFY_CHANGE_STREAM_WRITE = 0x00000800
)
View Source
const (
	SMB2QueryDirectoryRequestMinSize       = 32
	SMB2QueryDirectoryRequestStructureSize = 33

	SMB2QueryDirectoryResponseMinSize       = 8
	SMB2QueryDirectoryResponseStructureSize = 9

	SMB2QueryInfoRequestMinSize       = 40
	SMB2QueryInfoRequestStructureSize = 41

	SMB2QueryInfoResponseMinSize       = 8
	SMB2QueryInfoResponseStructureSize = 9
)
View Source
const (
	FILE_DIRECTORY_INFORMATION                  = 0x01
	FILE_FULL_DIRECTORY_INFORMATION             = 0x02
	FILE_ID_FULL_DIRECTORY_INFORMATION          = 0x26
	FILE_BOTH_DIRECTORY_INFORMATION             = 0x03
	FILE_ID_BOTH_DIRECTORY_INFORMATION          = 0x25
	FILE_NAMES_INFORMATION                      = 0x0c
	FILE_ID_EXTD_DIRECTORY_INFORMATION          = 0x3c
	FILE_ID_64_EXTD_DIRECTORY_INFORMATION       = 0x4e
	FILE_ID_64_EXTD_BOTH_DIRECTORY_INFORMATION  = 0x4f
	FILE_ID_ALL_EXTD_DIRECTORY_INFORMATION      = 0x50
	FILE_ID_ALL_EXTD_BOTH_DIRECTORY_INFORMATION = 0x51
	FILE_INFORMATION_CLASS_RESERVED             = 0x64
)
View Source
const (
	RESTART_SCANS       = 0x01
	RETURN_SINGLE_ENTRY = 0x02
	INDEX_SPECIFIED     = 0x04
	REOPEN              = 0x10
)
View Source
const (
	INFO_FILE       = 0x01
	INFO_FILESYSTEM = 0x02
	INFO_SECURITY   = 0x03
	INFO_QUOTA      = 0x04
)
View Source
const (
	FileAccessInformation          = 0x08
	FileAlignmentInformation       = 0x11
	FileAllInformation             = 0x12
	FileAllocationInformation      = 0x13
	FileAlternateNameInformation   = 0x15
	FileAttributeTagInformation    = 0x23
	FileBasicInformation           = 0x04
	FileCompressionInformation     = 0x1c
	FileDispositionInformation     = 0x0d
	FileEaInformation              = 0x07
	FileEndOfFileInformation       = 0x14
	FileFullEaInformation          = 0x0f
	FileIdInformation              = 0x3b
	FileInternalInformation        = 0x06
	FileLinkInformation            = 0x0b
	FileModeInformation            = 0x10
	FileNetworkOpenInformation     = 0x22
	FileNormalizedNameInformation  = 0x30
	FilePipeInformation            = 0x17
	FilePipeLocalInformation       = 0x18
	FilePipeRemoteInformation      = 0x19
	FilePositionInformation        = 0x0e
	FileRenameInformation          = 0x0a
	FileShortNameInformation       = 0x28
	FileStandardInformation        = 0x05
	FileStreamInformation          = 0x16
	FileValidDataLengthInformation = 0x27
	FileInfoClass_Reserved         = 0x64

	FileFsAttributeInformation  = 0x05
	FileFsControlInformation    = 0x06
	FileFsDeviceInformation     = 0x04
	FileFsFullSizeInformation   = 0x07
	FileFsObjectIdInformation   = 0x08
	FileFsSectorSizeInformation = 0x0b
	FileFsSizeInformation       = 0x03
	FileFsVolumeInformation     = 0x01
)
View Source
const (
	OWNER_SECURITY_INFORMATION     = 0x00000001
	GROUP_SECURITY_INFORMATION     = 0x00000002
	DACL_SECURITY_INFORMATION      = 0x00000004
	SACL_SECURITY_INFORMATION      = 0x00000008
	LABEL_SECURITY_INFORMATION     = 0x00000010
	ATTRIBUTE_SECURITY_INFORMATION = 0x00000020
	SCOPE_SECURITY_INFORMATION     = 0x00000040
	BACKUP_SECURITY_INFORMATION    = 0x00010000
)
View Source
const (
	SL_RESTART_SCAN        = 0x00000001
	SL_RETURN_SINGLE_ENTRY = 0x00000002
	SL_INDEX_SPECIFIED     = 0x00000004
)
View Source
const (
	SMB2ReadRequestMinSize       = 48
	SMB2ReadRequestStructureSize = 49

	SMB2ReadResponseMinSize       = 16
	SMB2ReadResponseStructureSize = 17
)
View Source
const (
	SMB2CancelRequestMinSize       = 4
	SMB2CancelRequestStructureSize = 4

	SMB2EchoRequestMinSize       = 4
	SMB2EchoRequestStructureSize = 4

	SMB2EchoResponseMinSize       = 4
	SMB2EchoResponseStructureSize = 4
)
View Source
const (
	SMB2SessionSetupRequestMinSize       = 24
	SMB2SessionSetupRequestStructureSize = 25

	SMB2SessionSetupResponseMinSize       = 8
	SMB2SessionSetupResponseStructureSize = 9
)
View Source
const (
	SESSION_FLAG_IS_GUEST = 0x0001
	SESSION_FLAG_IS_NULL  = 0x0002
)
View Source
const (
	SMB2TreeConnectRequestMinSize       = 8
	SMB2TreeConnectRequestStructureSize = 9

	SMB2TreeConnectResponseMinSize       = 16
	SMB2TreeConnectResponseStructureSize = 16

	SMB2TreeDisconnectRequestMinSize       = 4
	SMB2TreeDisconnectRequestStructureSize = 4

	SMB2TreeDisconnectResponseMinSize       = 4
	SMB2TreeDisconnectResponseStructureSize = 4
)
View Source
const (
	SHARE_TYPE_DISK  = 0x01
	SHARE_TYPE_PIPE  = 0x02
	SHARE_TYPE_PRINT = 0x03
)
View Source
const (
	SHAREFLAG_MANUAL_CACHING              = 0x00000000
	SHAREFLAG_AUTO_CACHING                = 0x00000010
	SHAREFLAG_VDO_CACHING                 = 0x00000020
	SHAREFLAG_NO_CACHING                  = 0x00000030
	SHAREFLAG_DFS                         = 0x00000001
	SHAREFLAG_DFS_ROOT                    = 0x00000002
	SHAREFLAG_RESTRICT_EXCLUSIVE_OPENS    = 0x00000100
	SHAREFLAG_FORCE_SHARED_DELETE         = 0x00000200
	SHAREFLAG_ALLOW_NAMESPACE_CACHING     = 0x00000400
	SHAREFLAG_ACCESS_BASED_DIRECTORY_ENUM = 0x00000800
	SHAREFLAG_FORCE_LEVELII_OPLOCK        = 0x00001000
	SHAREFLAG_ENABLE_HASH_V1              = 0x00002000
	SHAREFLAG_ENABLE_HASH_V2              = 0x00004000
	SHAREFLAG_ENCRYPT_DATA                = 0x00008000
	SHAREFLAG_IDENTITY_REMOTING           = 0x00040000
	SHAREFLAG_COMPRESS_DATA               = 0x00100000
	SHAREFLAG_ISOLATED_TRANSPORT          = 0x00200000
)
View Source
const (
	SHARE_CAP_DFS                     = 0x00000008
	SHARE_CAP_CONTINUOUS_AVAILABILITY = 0x00000010
	SMB2_SHARE_CAP_SCALEOUT           = 0x00000020
	SHARE_CAP_CLUSTER                 = 0x00000040
	SHARE_CAP_ASYMMETRIC              = 0x00000080
	SHARE_CAP_REDIRECT_TO_OWNER       = 0x00000100
)
View Source
const (
	// File access
	FILE_READ_DATA         = 0x00000001
	FILE_WRITE_DATA        = 0x00000002
	FILE_APPEND_DATA       = 0x00000004
	FILE_READ_EA           = 0x00000008
	FILE_WRITE_EA          = 0x00000010
	FILE_EXECUTE           = 0x00000020
	FILE_DELETE_CHILD      = 0x00000040
	FILE_READ_ATTRIBUTES   = 0x00000080
	FILE_WRITE_ATTRIBUTES  = 0x00000100
	DELETE                 = 0x00010000
	READ_CONTROL           = 0x00020000
	WRITE_DAC              = 0x00040000
	WRITE_OWNER            = 0x00080000
	SYNCHRONIZE            = 0x00100000
	ACCESS_SYSTEM_SECURITY = 0x01000000
	MAXIMUM_ALLOWED        = 0x02000000
	GENERIC_ALL            = 0x10000000
	GENERIC_EXECUTE        = 0x20000000
	GENERIC_WRITE          = 0x40000000
	GENERIC_READ           = 0x80000000
)
View Source
const (
	// Directory access
	FILE_LIST_DIRECTORY   = 0x00000001
	FILE_ADD_FILE         = 0x00000002
	FILE_ADD_SUBDIRECTORY = 0x00000004
	FILE_TRAVERSE         = 0x00000020
)
View Source
const (
	SMB2WriteRequestMinSize       = 48
	SMB2WriteRequestStructureSize = 49

	SMB2WriteResponseMinSize       = 16
	SMB2WriteResponseStructureSize = 17
)
View Source
const (
	BytesPerSector = 4 * 1024 * 1024
)
View Source
const (
	CLOSE_FLAG_POSTQUERY_ATTRIB = 0x0001
)
View Source
const (
	IOCTL_IS_FSCTL = 0x00000001
)
View Source
const (
	WATCH_TREE = 0x0001
)

Variables

View Source
var (
	ErrEncryptedMessage  = errors.New("message encryption not supported")
	ErrCompressedMessage = errors.New("message compression not supported")
	ErrWrongLength       = errors.New("wrong data length")
	ErrWrongFormat       = errors.New("wrong data format")
	ErrWrongProtocol     = errors.New("unsupported protocol")
)
View Source
var (
	ErrDialectNotSupported = errors.New("dialect not supported")
	ErrInvalidParameter    = errors.New("wrong parameter supplied")
)
View Source
var (
	ErrRelatedRequests   = errors.New("first request in a chain cannot be related")
	ErrMixedRequests     = errors.New("wrong usage of the related flag")
	ErrUnalignedRequests = errors.New("chained requests must be aligned to a 8-byte boundary")
)
View Source
var (
	DummyFileID = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
)
View Source
var (
	ErrNotSupported = errors.New("not supported")
)

Functions

func FileFSObjectIDInfo

func FileFSObjectIDInfo(volumeID uint64) []byte

func FileFsAttributeInfo

func FileFsAttributeInfo() []byte

func FileFsDeviceInfo

func FileFsDeviceInfo() []byte

func FileFsFullSizeInfo

func FileFsFullSizeInfo(total, used uint64, redundancy api.RedundancySettings) []byte

func FileFsSizeInfo

func FileFsSizeInfo(total, used uint64, redundancy api.RedundancySettings) []byte

func FileFsVolumeInfo

func FileFsVolumeInfo(createdAt time.Time, serialNo uint32, label string) []byte

func HandleCreateDurableHandleRequest

func HandleCreateDurableHandleRequest() []byte

func HandleCreateQueryMaximalAccessRequest

func HandleCreateQueryMaximalAccessRequest(ctx []byte, modTime time.Time, maxAccess uint32) []byte

func HandleCreateQueryOnDiskID

func HandleCreateQueryOnDiskID(fid, vid uint64) []byte

func NewSecInfo

func NewSecInfo(ctx ntlm.SecurityContext, info uint32, access uint32) []byte

func QueryDirectoryBuffer

func QueryDirectoryBuffer(class uint8, entries []api.ObjectMetadata, bufSize uint32, single, root bool, dir, parent FileInfo) (buf []byte, num int)

Types

type ACE

type ACE struct {
	Type   uint8
	Flags  uint8
	Access uint32
	SID    dtyp.SID
}

func (*ACE) Encode

func (ace *ACE) Encode() []byte

type ACL

type ACL struct {
	Revision uint16
	ACEs     []ACE
}

func (*ACL) Encode

func (acl *ACL) Encode() []byte

type CancelRequest

type CancelRequest struct {
	Request
}

func (CancelRequest) Validate

func (cr CancelRequest) Validate() error

type ChangeNotifyRequest

type ChangeNotifyRequest struct {
	Request
}

func (ChangeNotifyRequest) CompletionFilter

func (cnr ChangeNotifyRequest) CompletionFilter() uint32

func (ChangeNotifyRequest) FileID

func (cnr ChangeNotifyRequest) FileID() []byte

func (ChangeNotifyRequest) Flags

func (cnr ChangeNotifyRequest) Flags() uint16

func (ChangeNotifyRequest) OutputBufferLength

func (cnr ChangeNotifyRequest) OutputBufferLength() uint32

func (ChangeNotifyRequest) Validate

func (cnr ChangeNotifyRequest) Validate() error

type ChangeNotifyResponse

type ChangeNotifyResponse struct {
	Response
}

func (*ChangeNotifyResponse) FromRequest

func (cnr *ChangeNotifyResponse) FromRequest(req GenericRequest)

func (*ChangeNotifyResponse) Generate

func (cnr *ChangeNotifyResponse) Generate(buf []byte)

func (*ChangeNotifyResponse) SetOutputBuffer

func (cnr *ChangeNotifyResponse) SetOutputBuffer(buf []byte)

type CloseRequest

type CloseRequest struct {
	Request
}

func (CloseRequest) FileID

func (cr CloseRequest) FileID() []byte

func (CloseRequest) Flags

func (cr CloseRequest) Flags() uint16

func (CloseRequest) Validate

func (cr CloseRequest) Validate() error

type CloseResponse

type CloseResponse struct {
	Response
}

func (*CloseResponse) FromRequest

func (cr *CloseResponse) FromRequest(req GenericRequest)

func (*CloseResponse) Generate

func (cr *CloseResponse) Generate(modTime time.Time, size, allocated uint64, fa uint32)

func (*CloseResponse) SetFileAttributes

func (cr *CloseResponse) SetFileAttributes(fa uint32)

func (*CloseResponse) SetFileTime

func (cr *CloseResponse) SetFileTime(creation, lastAccess, lastWrite, change time.Time)

func (*CloseResponse) SetFilesize

func (cr *CloseResponse) SetFilesize(size, allocated uint64)

func (*CloseResponse) SetFlags

func (cr *CloseResponse) SetFlags(flags uint16)

type CreateRequest

type CreateRequest struct {
	Request
}

func (CreateRequest) CreateContexts

func (cr CreateRequest) CreateContexts() (map[uint32][]byte, error)

func (CreateRequest) CreateDisposition

func (cr CreateRequest) CreateDisposition() uint32

func (CreateRequest) CreateOptionSelected

func (cr CreateRequest) CreateOptionSelected(option uint32) bool

func (CreateRequest) CreateOptions

func (cr CreateRequest) CreateOptions() uint32

func (CreateRequest) DesiredAccess

func (cr CreateRequest) DesiredAccess() uint32

func (CreateRequest) FileAttributes

func (cr CreateRequest) FileAttributes() uint32

func (CreateRequest) Filename

func (cr CreateRequest) Filename() string

func (CreateRequest) ImpersonationLevel

func (cr CreateRequest) ImpersonationLevel() uint32

func (CreateRequest) RequestedOplockLevel

func (cr CreateRequest) RequestedOplockLevel() uint8

func (*CreateRequest) SetCreateOptions

func (cr *CreateRequest) SetCreateOptions(options uint32)

func (*CreateRequest) SetDesiredAccess

func (cr *CreateRequest) SetDesiredAccess(da uint32)

func (CreateRequest) ShareAccess

func (cr CreateRequest) ShareAccess() uint32

func (CreateRequest) Validate

func (cr CreateRequest) Validate() error

type CreateResponse

type CreateResponse struct {
	Response
}

func (*CreateResponse) FromRequest

func (cr *CreateResponse) FromRequest(req GenericRequest)

func (*CreateResponse) Generate

func (cr *CreateResponse) Generate(
	oplockLevel uint8,
	createAction uint32,
	size uint64,
	allocated uint64,
	modTime time.Time,
	isDir bool,
	fileID uint64,
	durableFileID uint64,
	createContexts map[uint32][]byte,
)

func (*CreateResponse) SetCreateAction

func (cr *CreateResponse) SetCreateAction(ca uint32)

func (*CreateResponse) SetCreateContexts

func (cr *CreateResponse) SetCreateContexts(contexts map[uint32][]byte)

func (*CreateResponse) SetFileAttributes

func (cr *CreateResponse) SetFileAttributes(fa uint32)

func (*CreateResponse) SetFileID

func (cr *CreateResponse) SetFileID(fid []byte)

func (*CreateResponse) SetFileTime

func (cr *CreateResponse) SetFileTime(creation, lastAccess, lastWrite, change time.Time)

func (*CreateResponse) SetFilesize

func (cr *CreateResponse) SetFilesize(size, allocated uint64)

func (*CreateResponse) SetOplockLevel

func (cr *CreateResponse) SetOplockLevel(ol uint8)

type EchoRequest

type EchoRequest struct {
	Request
}

func (EchoRequest) Validate

func (er EchoRequest) Validate() error

type EchoResponse

type EchoResponse struct {
	Response
}

func (*EchoResponse) FromRequest

func (er *EchoResponse) FromRequest(req GenericRequest)

type ErrorResponse

type ErrorResponse struct {
	Response
}

func NegotiateErrorResponse

func NegotiateErrorResponse(status uint32) *ErrorResponse

func NewErrorResponse

func NewErrorResponse(req GenericRequest, status uint32, data []byte) *ErrorResponse

func (*ErrorResponse) FromRequest

func (er *ErrorResponse) FromRequest(req GenericRequest)

func (*ErrorResponse) SetErrorData

func (er *ErrorResponse) SetErrorData(data []byte)

type FileAccessInfo

type FileAccessInfo struct {
	AccessFlags uint32
}

func (FileAccessInfo) Encode

func (fai FileAccessInfo) Encode() []byte

type FileAlignmentInfo

type FileAlignmentInfo struct {
	AlignmentRequirement uint32
}

func (FileAlignmentInfo) Encode

func (fai FileAlignmentInfo) Encode() []byte

type FileAllInfo

type FileAllInfo struct {
	BasicInfo     FileBasicInfo
	StandardInfo  FileStandardInfo
	InternalInfo  FileInternalInfo
	EaInfo        FileEaInfo
	AccessInfo    FileAccessInfo
	PositionInfo  FilePositionInfo
	ModeInfo      FileModeInfo
	AlignmentInfo FileAlignmentInfo
	NameInfo      FileNameInfo
}

func (FileAllInfo) Encode

func (fai FileAllInfo) Encode() []byte

type FileBasicInfo

type FileBasicInfo struct {
	CreationTime   time.Time
	LastAccessTime time.Time
	LastWriteTime  time.Time
	ChangeTime     time.Time
	FileAttributes uint32
}

func (*FileBasicInfo) Decode

func (fbi *FileBasicInfo) Decode(buf []byte) error

func (FileBasicInfo) Encode

func (fbi FileBasicInfo) Encode() []byte

type FileEaInfo

type FileEaInfo struct {
	EaSize uint32
}

func (FileEaInfo) Encode

func (fei FileEaInfo) Encode() []byte

type FileInfo

type FileInfo struct {
	ID64      uint64
	ID        []byte
	CreatedAt time.Time
}

type FileInternalInfo

type FileInternalInfo struct {
	IndexNumber uint64
}

func (FileInternalInfo) Encode

func (fii FileInternalInfo) Encode() []byte

type FileModeInfo

type FileModeInfo struct {
	Mode uint32
}

func (FileModeInfo) Encode

func (fmi FileModeInfo) Encode() []byte

type FileNameInfo

type FileNameInfo struct {
	FileName string
}

func (FileNameInfo) Encode

func (fni FileNameInfo) Encode() []byte

type FileNetworkOpenInfo

type FileNetworkOpenInfo struct {
	CreationTime   time.Time
	LastAccessTime time.Time
	LastWriteTime  time.Time
	ChangeTime     time.Time
	AllocationSize uint64
	EndOfFile      uint64
	FileAttributes uint32
}

func (FileNetworkOpenInfo) Encode

func (fnoi FileNetworkOpenInfo) Encode() []byte

type FilePositionInfo

type FilePositionInfo struct {
	CurrentByteOffset uint64
}

func (FilePositionInfo) Encode

func (fpi FilePositionInfo) Encode() []byte

type FileRenameInfo

type FileRenameInfo struct {
	ReplaceIfExists bool
	RootDirectory   uint64
	FileName        string
}

func (*FileRenameInfo) Decode

func (fri *FileRenameInfo) Decode(buf []byte) error

type FileStandardInfo

type FileStandardInfo struct {
	AllocationSize uint64
	EndOfFile      uint64
	NumberOfLinks  uint32
	DeletePending  bool
	Directory      bool
}

func (FileStandardInfo) Encode

func (fsi FileStandardInfo) Encode() []byte

type FileStreamInfo

type FileStreamInfo struct {
	StreamName           string
	StreamSize           uint64
	StreamAllocationSize uint64
}

func (FileStreamInfo) Encode

func (fsi FileStreamInfo) Encode() []byte

type FlushRequest

type FlushRequest struct {
	Request
}

func (FlushRequest) FileID

func (fr FlushRequest) FileID() []byte

func (FlushRequest) Validate

func (fr FlushRequest) Validate() error

type FlushResponse

type FlushResponse struct {
	Response
}

func (*FlushResponse) FromRequest

func (fr *FlushResponse) FromRequest(req GenericRequest)

type GenericRequest

type GenericRequest interface {
	Validate() error
	Header() Header
	CancelRequestID() uint64
	GroupID() uint64
	OpenID() []byte
}

type GenericResponse

type GenericResponse interface {
	FromRequest(req GenericRequest)
	EncodedLength() int
	Encode() []byte
	Header() Header
	GroupID() uint64
	SessionID() uint64
	SetSessionID(id uint64)
	TreeID() uint32
	SetTreeID(id uint32)
	OpenID() []byte
	SetOpenID(id []byte)
	Append(newResp GenericResponse)
}
type Header []byte

func NewHeader

func NewHeader(data []byte) Header

func (Header) AsyncID

func (h Header) AsyncID() uint64

func (Header) ClearFlag

func (h Header) ClearFlag(flag uint32)

func (Header) Command

func (h Header) Command() uint16

func (Header) CopyFrom

func (h Header) CopyFrom(src Header)

func (Header) CreditCharge

func (h Header) CreditCharge() uint16

func (Header) CreditRequest

func (h Header) CreditRequest() uint16

func (Header) Flags

func (h Header) Flags() uint32

func (Header) IsFlagSet

func (h Header) IsFlagSet(flag uint32) bool

func (Header) IsSmb

func (h Header) IsSmb() bool

func (Header) IsSmb2

func (h Header) IsSmb2() bool

func (Header) LegacyCommand

func (h Header) LegacyCommand() uint8

func (Header) MessageID

func (h Header) MessageID() uint64

func (Header) NextCommand

func (h Header) NextCommand() uint32

func (Header) SessionID

func (h Header) SessionID() uint64

func (Header) SetAsyncID

func (h Header) SetAsyncID(aid uint64)

func (Header) SetCommand

func (h Header) SetCommand(command uint16)

func (Header) SetCreditCharge

func (h Header) SetCreditCharge(cc uint16)

func (Header) SetCreditResponse

func (h Header) SetCreditResponse(cr uint16)

func (Header) SetFlag

func (h Header) SetFlag(flag uint32)

func (Header) SetFlags

func (h Header) SetFlags(flags uint32)

func (Header) SetMessageID

func (h Header) SetMessageID(mid uint64)

func (Header) SetNextCommand

func (h Header) SetNextCommand(nc uint32)

func (Header) SetSessionID

func (h Header) SetSessionID(sid uint64)

func (Header) SetSignature

func (h Header) SetSignature(signature []byte)

func (Header) SetStatus

func (h Header) SetStatus(status uint32)

func (Header) SetTreeID

func (h Header) SetTreeID(tid uint32)

func (Header) Signature

func (h Header) Signature() []byte

func (Header) Status

func (h Header) Status() uint32

func (Header) TreeID

func (h Header) TreeID() uint32

func (Header) Validate

func (h Header) Validate() error

func (Header) WipeSignature

func (h Header) WipeSignature()

type IoctlRequest

type IoctlRequest struct {
	Request
}

func (IoctlRequest) CtlCode

func (ir IoctlRequest) CtlCode() uint32

func (IoctlRequest) FileID

func (ir IoctlRequest) FileID() []byte

func (IoctlRequest) Flags

func (ir IoctlRequest) Flags() uint32

func (IoctlRequest) InputBuffer

func (ir IoctlRequest) InputBuffer() []byte

func (IoctlRequest) MaxInputResponse

func (ir IoctlRequest) MaxInputResponse() uint32

func (IoctlRequest) MaxOutputResponse

func (ir IoctlRequest) MaxOutputResponse() uint32

func (IoctlRequest) Validate

func (ir IoctlRequest) Validate() error

type IoctlResponse

type IoctlResponse struct {
	Response
}

func (*IoctlResponse) FromRequest

func (ir *IoctlResponse) FromRequest(req GenericRequest)

func (*IoctlResponse) Generate

func (ir *IoctlResponse) Generate(code uint32, fid []byte, flags uint32, output []byte)

func (*IoctlResponse) SetCtlCode

func (ir *IoctlResponse) SetCtlCode(code uint32)

func (*IoctlResponse) SetFileID

func (ir *IoctlResponse) SetFileID(fid []byte)

func (*IoctlResponse) SetFlags

func (ir *IoctlResponse) SetFlags(flags uint32)

func (*IoctlResponse) SetOutputBuffer

func (ir *IoctlResponse) SetOutputBuffer(buf []byte)

type Lock

type Lock struct {
	Offset uint64
	Length uint64
	Flags  uint32
}

type LockRequest

type LockRequest struct {
	Request
}

func (LockRequest) FileID

func (lr LockRequest) FileID() []byte

func (LockRequest) Locks

func (lr LockRequest) Locks() []Lock

func (LockRequest) Validate

func (lr LockRequest) Validate() error

type LockResponse

type LockResponse struct {
	Response
}

func (*LockResponse) FromRequest

func (lr *LockResponse) FromRequest(req GenericRequest)

type LogoffRequest

type LogoffRequest struct {
	Request
}

func (LogoffRequest) Validate

func (lr LogoffRequest) Validate() error

type LogoffResponse

type LogoffResponse struct {
	Response
}

func (*LogoffResponse) FromRequest

func (lr *LogoffResponse) FromRequest(req GenericRequest)

type NegotiateRequest

type NegotiateRequest struct {
	Request
}

func (NegotiateRequest) Capabilities

func (nr NegotiateRequest) Capabilities() uint32

func (NegotiateRequest) ClientGuid

func (nr NegotiateRequest) ClientGuid() []byte

func (NegotiateRequest) SecurityMode

func (nr NegotiateRequest) SecurityMode() uint16

func (NegotiateRequest) Validate

func (nr NegotiateRequest) Validate() error

type NegotiateResponse

type NegotiateResponse struct {
	Response
}

func NewNegotiateResponse

func NewNegotiateResponse(serverGuid []byte, ns *ntlm.Server) *NegotiateResponse

func (*NegotiateResponse) FromRequest

func (nr *NegotiateResponse) FromRequest(req GenericRequest)

func (*NegotiateResponse) Generate

func (nr *NegotiateResponse) Generate(serverGuid []byte, ns *ntlm.Server)

func (*NegotiateResponse) SetCapabilities

func (nr *NegotiateResponse) SetCapabilities(cap uint32)

func (*NegotiateResponse) SetDialectRevision

func (nr *NegotiateResponse) SetDialectRevision(dialect uint16)

func (*NegotiateResponse) SetMaxReadSize

func (nr *NegotiateResponse) SetMaxReadSize(size uint32)

func (*NegotiateResponse) SetMaxTransactSize

func (nr *NegotiateResponse) SetMaxTransactSize(size uint32)

func (*NegotiateResponse) SetMaxWriteSize

func (nr *NegotiateResponse) SetMaxWriteSize(size uint32)

func (*NegotiateResponse) SetSecurityBuffer

func (nr *NegotiateResponse) SetSecurityBuffer(buf []byte)

func (*NegotiateResponse) SetSecurityMode

func (nr *NegotiateResponse) SetSecurityMode(sm uint16)

func (*NegotiateResponse) SetServerGuid

func (nr *NegotiateResponse) SetServerGuid(guid []byte)

func (*NegotiateResponse) SetSystemTime

func (nr *NegotiateResponse) SetSystemTime(t time.Time)

type QueryDirectoryRequest

type QueryDirectoryRequest struct {
	Request
}

func (QueryDirectoryRequest) FileID

func (qdr QueryDirectoryRequest) FileID() []byte

func (QueryDirectoryRequest) FileIndex

func (qdr QueryDirectoryRequest) FileIndex() uint32

func (QueryDirectoryRequest) FileInformationClass

func (qdr QueryDirectoryRequest) FileInformationClass() uint8

func (QueryDirectoryRequest) FileName

func (qdr QueryDirectoryRequest) FileName() string

func (QueryDirectoryRequest) Flags

func (qdr QueryDirectoryRequest) Flags() uint8

func (QueryDirectoryRequest) OutputBufferLength

func (qdr QueryDirectoryRequest) OutputBufferLength() uint32

func (QueryDirectoryRequest) Validate

func (qdr QueryDirectoryRequest) Validate() error

type QueryDirectoryResponse

type QueryDirectoryResponse struct {
	Response
}

func (*QueryDirectoryResponse) FromRequest

func (qdr *QueryDirectoryResponse) FromRequest(req GenericRequest)

func (*QueryDirectoryResponse) Generate

func (qdr *QueryDirectoryResponse) Generate(buf []byte)

func (*QueryDirectoryResponse) SetOutputBuffer

func (qdr *QueryDirectoryResponse) SetOutputBuffer(buf []byte)

type QueryInfoRequest

type QueryInfoRequest struct {
	Request
}

func (QueryInfoRequest) AdditionalInformation

func (qir QueryInfoRequest) AdditionalInformation() uint32

func (QueryInfoRequest) FileID

func (qir QueryInfoRequest) FileID() []byte

func (QueryInfoRequest) FileInfoClass

func (qir QueryInfoRequest) FileInfoClass() uint8

func (QueryInfoRequest) Flags

func (qir QueryInfoRequest) Flags() uint32

func (QueryInfoRequest) InfoType

func (qir QueryInfoRequest) InfoType() uint8

func (QueryInfoRequest) InputBuffer

func (qir QueryInfoRequest) InputBuffer() []byte

func (QueryInfoRequest) OutputBufferLength

func (qir QueryInfoRequest) OutputBufferLength() uint32

func (QueryInfoRequest) Validate

func (qir QueryInfoRequest) Validate() error

type QueryInfoResponse

type QueryInfoResponse struct {
	Response
}

func (*QueryInfoResponse) FromRequest

func (qir *QueryInfoResponse) FromRequest(req GenericRequest)

func (*QueryInfoResponse) Generate

func (qir *QueryInfoResponse) Generate(buf []byte)

func (*QueryInfoResponse) SetOutputBuffer

func (qir *QueryInfoResponse) SetOutputBuffer(buf []byte)

type ReadRequest

type ReadRequest struct {
	Request
}

func (ReadRequest) FileID

func (rr ReadRequest) FileID() []byte

func (ReadRequest) Flags

func (rr ReadRequest) Flags() uint8

func (ReadRequest) Length

func (rr ReadRequest) Length() uint32

func (ReadRequest) MinimumCount

func (rr ReadRequest) MinimumCount() uint32

func (ReadRequest) Offset

func (rr ReadRequest) Offset() uint64

func (ReadRequest) Padding

func (rr ReadRequest) Padding() uint8

func (ReadRequest) Validate

func (rr ReadRequest) Validate() error

type ReadResponse

type ReadResponse struct {
	Response
}

func (*ReadResponse) FromRequest

func (rr *ReadResponse) FromRequest(req GenericRequest)

func (*ReadResponse) Generate

func (rr *ReadResponse) Generate(buf []byte, padding uint8)

func (*ReadResponse) SetData

func (rr *ReadResponse) SetData(buf []byte, padding uint8)

type Request

type Request struct {
	// contains filtered or unexported fields
}

func GetRequests

func GetRequests(data []byte, cid uint64) (reqs []*Request, err error)

func (Request) CancelRequestID

func (req Request) CancelRequestID() uint64

func (Request) GroupID

func (req Request) GroupID() uint64

func (Request) Header

func (req Request) Header() Header

func (Request) OpenID

func (req Request) OpenID() []byte

func (*Request) SetOpenID

func (req *Request) SetOpenID(id []byte)

func (Request) Validate

func (req Request) Validate() error

type Response

type Response struct {
	// contains filtered or unexported fields
}

func (*Response) Append

func (resp *Response) Append(newResp GenericResponse)

func (Response) Encode

func (resp Response) Encode() []byte

func (Response) EncodedLength

func (resp Response) EncodedLength() int

func (*Response) FromRequest

func (resp *Response) FromRequest(req GenericRequest)

func (Response) GroupID

func (resp Response) GroupID() uint64

func (Response) Header

func (resp Response) Header() Header

func (Response) OpenID

func (resp Response) OpenID() []byte

func (Response) SessionID

func (resp Response) SessionID() uint64

func (*Response) SetOpenID

func (resp *Response) SetOpenID(id []byte)

func (*Response) SetSessionID

func (resp *Response) SetSessionID(id uint64)

func (*Response) SetTreeID

func (resp *Response) SetTreeID(id uint32)

func (Response) TreeID

func (resp Response) TreeID() uint32

type SecInfo

type SecInfo struct {
	Revision uint16
	Type     uint16
	Owner    dtyp.SID
	Group    dtyp.SID
	SACL     ACL
	DACL     ACL
}

func (*SecInfo) Encode

func (si *SecInfo) Encode() []byte

type SessionSetupRequest

type SessionSetupRequest struct {
	Request
}

func (SessionSetupRequest) Capabilities

func (ssr SessionSetupRequest) Capabilities() uint32

func (SessionSetupRequest) PreviousSessionID

func (ssr SessionSetupRequest) PreviousSessionID() uint64

func (SessionSetupRequest) SecurityBuffer

func (ssr SessionSetupRequest) SecurityBuffer() []byte

func (SessionSetupRequest) SecurityMode

func (ssr SessionSetupRequest) SecurityMode() uint16

func (SessionSetupRequest) Validate

func (ssr SessionSetupRequest) Validate() error

type SessionSetupResponse

type SessionSetupResponse struct {
	Response
}

func (*SessionSetupResponse) FromRequest

func (ssr *SessionSetupResponse) FromRequest(req GenericRequest)

func (*SessionSetupResponse) Generate

func (ssr *SessionSetupResponse) Generate(sid uint64, flags uint16, token []byte, done bool)

func (*SessionSetupResponse) SetSecurityBuffer

func (ssr *SessionSetupResponse) SetSecurityBuffer(buf []byte)

func (*SessionSetupResponse) SetSessionFlags

func (ssr *SessionSetupResponse) SetSessionFlags(flags uint16)

type SetInfoRequest

type SetInfoRequest struct {
	Request
}

func (SetInfoRequest) AdditionalInformation

func (sir SetInfoRequest) AdditionalInformation() uint32

func (SetInfoRequest) Buffer

func (sir SetInfoRequest) Buffer() []byte

func (SetInfoRequest) FileID

func (sir SetInfoRequest) FileID() []byte

func (SetInfoRequest) FileInfoClass

func (sir SetInfoRequest) FileInfoClass() uint8

func (SetInfoRequest) InfoType

func (sir SetInfoRequest) InfoType() uint8

func (SetInfoRequest) Validate

func (sir SetInfoRequest) Validate() error

type SetInfoResponse

type SetInfoResponse struct {
	Response
}

func (*SetInfoResponse) FromRequest

func (sir *SetInfoResponse) FromRequest(req GenericRequest)

type TreeConnectRequest

type TreeConnectRequest struct {
	Request
}

func (TreeConnectRequest) PathName

func (tcr TreeConnectRequest) PathName() string

func (TreeConnectRequest) Validate

func (tcr TreeConnectRequest) Validate() error

type TreeConnectResponse

type TreeConnectResponse struct {
	Response
}

func (*TreeConnectResponse) FromRequest

func (tcr *TreeConnectResponse) FromRequest(req GenericRequest)

func (*TreeConnectResponse) Generate

func (tcr *TreeConnectResponse) Generate(tid uint32, st uint8, access uint32)

func (*TreeConnectResponse) SetCapabilities

func (tcr *TreeConnectResponse) SetCapabilities(cap uint32)

func (*TreeConnectResponse) SetMaximalAccess

func (tcr *TreeConnectResponse) SetMaximalAccess(ma uint32)

func (*TreeConnectResponse) SetShareFlags

func (tcr *TreeConnectResponse) SetShareFlags(flags uint32)

func (*TreeConnectResponse) SetShareType

func (tcr *TreeConnectResponse) SetShareType(st uint8)

type TreeDisconnectRequest

type TreeDisconnectRequest struct {
	Request
}

func (TreeDisconnectRequest) Validate

func (tdr TreeDisconnectRequest) Validate() error

type TreeDisconnectResponse

type TreeDisconnectResponse struct {
	Response
}

func (*TreeDisconnectResponse) FromRequest

func (tdr *TreeDisconnectResponse) FromRequest(req GenericRequest)

type WriteRequest

type WriteRequest struct {
	Request
}

func (WriteRequest) Buffer

func (wr WriteRequest) Buffer() []byte

func (WriteRequest) FileID

func (wr WriteRequest) FileID() []byte

func (WriteRequest) Flags

func (wr WriteRequest) Flags() uint32

func (WriteRequest) Offset

func (wr WriteRequest) Offset() uint64

func (WriteRequest) Validate

func (wr WriteRequest) Validate() error

type WriteResponse

type WriteResponse struct {
	Response
}

func (*WriteResponse) FromRequest

func (wr *WriteResponse) FromRequest(req GenericRequest)

func (*WriteResponse) Generate

func (wr *WriteResponse) Generate(count uint32)

func (*WriteResponse) SetCount

func (wr *WriteResponse) SetCount(count uint32)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL