smb2

package
v0.0.0-...-014ce7a Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCESS_ALLOWED_ACE_TYPE = 0x00
	ACCESS_DENIED_ACE_TYPE  = 0x01
)
View Source
const (
	O_SHLOCK = 0x10
	O_EXLOCK = 0x20
)
View Source
const (
	FILE_CASE_SENSITIVE_SEARCH        = 0x00000001
	FILE_CASE_PRESERVED_NAMES         = 0x00000002
	FILE_UNICODE_ON_DISK              = 0x00000004
	FILE_PERSISTENT_ACLS              = 0x00000008
	FILE_FILE_COMPRESSION             = 0x00000010
	FILE_VOLUME_QUOTAS                = 0x00000020
	FILE_SUPPORTS_SPARSE_FILES        = 0x00000040
	FILE_SUPPORTS_REPARSE_POINTS      = 0x00000080
	FILE_SUPPORTS_REMOTE_STORAGE      = 0x00000100
	FILE_VOLUME_IS_COMPRESSED         = 0x00008000
	FILE_SUPPORTS_OBJECT_IDS          = 0x00010000
	FILE_SUPPORTS_ENCRYPTION          = 0x00020000
	FILE_NAMED_STREAMS                = 0x00040000
	FILE_READ_ONLY_VOLUME             = 0x00080000
	FILE_SEQUENTIAL_WRITE_ONCE        = 0x00100000
	FILE_SUPPORTS_TRANSACTIONS        = 0x00200000
	FILE_SUPPORTS_HARD_LINKS          = 0x00400000
	FILE_SUPPORTS_EXTENDED_ATTRIBUTES = 0x00800000
	FILE_SUPPORTS_OPEN_BY_FILE_ID     = 0x01000000
	FILE_SUPPORTS_USN_JOURNAL         = 0x02000000
)
View Source
const (
	FILE_SUPERSEDED  = 0x00000000
	FILE_OPENED      = 0x00000001
	FILE_CREATED     = 0x00000002
	FILE_OVERWRITTEN = 0x00000003
)
View Source
const (
	FILE_DEVICE_CD_ROM = 0x00000002
	FILE_DEVICE_DISK   = 0x00000007
)
View Source
const (
	FILE_REMOVABLE_MEDIA                     = 0x00000001
	FILE_READ_ONLY_DEVICE                    = 0x00000002
	FILE_FLOPPY_DISKETTE                     = 0x00000004
	FILE_WRITE_ONCE_MEDIA                    = 0x00000008
	FILE_REMOTE_DEVICE                       = 0x00000010
	FILE_DEVICE_IS_MOUNTED                   = 0x00000020
	FILE_VIRTUAL_VOLUME                      = 0x00000040
	FILE_DEVICE_SECURE_OPEN                  = 0x00000100
	FILE_CHARACTERISTIC_TS_DEVICE            = 0x00001000
	FILE_CHARACTERISTIC_WEBDAV_DEVICE        = 0x00002000
	FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL = 0x00020000
	FILE_PORTABLE_DEVICE                     = 0x0004000
)
View Source
const (
	FILE_ACTION_ADDED                  = 0x00000001
	FILE_ACTION_REMOVED                = 0x00000002
	FILE_ACTION_MODIFIED               = 0x00000003
	FILE_ACTION_RENAMED_OLD_NAME       = 0x00000004
	FILE_ACTION_RENAMED_NEW_NAME       = 0x00000005
	FILE_ACTION_ADDED_STREAM           = 0x00000006
	FILE_ACTION_REMOVED_STREAM         = 0x00000007
	FILE_ACTION_MODIFIED_STREAM        = 0x00000008
	FILE_ACTION_REMOVED_BY_DELETE      = 0x00000009
	FILE_ACTION_ID_NOT_TUNNELLED       = 0x0000000A
	FILE_ACTION_TUNNELLED_ID_COLLISION = 0x0000000B
)
View Source
const (
	STATE_NEGOTIATE = ConnState(iota)
	STATE_SESSION_SETUP
	STATE_SESSION_SETUP_CHALLENGE
	STATE_SESSION_ACTIVE
)
View Source
const (
	ACL_REVISION = 0x02
)
View Source
const DEFAULT_IOPS = 32
View Source
const PathSeparator = '\\'

Variables

View Source
var (
	SRVSVC_GUID  = FileId{}
	INVALID_GUID = FileId{
		Persistent: [8]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
		Volatile:   [8]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
	}
)
View Source
var CREATOR_SID_AUTHORITY = SID_IDENTIFIER_AUTHORITY{0x00, 0x00, 0x00, 0x00, 0x00, 0x03}
View Source
var LOCAL_SID_AUTHORITY = SID_IDENTIFIER_AUTHORITY{0x00, 0x00, 0x00, 0x00, 0x00, 0x02}
View Source
var NORMALIZE_PATH = true // normalize path arguments automatically
View Source
var NULL_SID_AUTHORITY = SID_IDENTIFIER_AUTHORITY{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
View Source
var SECURITY_NT_AUTHORITY = SID_IDENTIFIER_AUTHORITY{0x00, 0x00, 0x00, 0x00, 0x00, 0x05}
View Source
var WORLD_SID_AUTHORITY = SID_IDENTIFIER_AUTHORITY{0x00, 0x00, 0x00, 0x00, 0x00, 0x01}

Functions

func IsPathSeparator

func IsPathSeparator(c uint8) bool

func UnixModeToAceMask

func UnixModeToAceMask(mode uint8) uint32

rwx -> mask

Types

type ACE

type ACE struct {
	Sid  *SID
	Type uint8
	Mask uint32
}

func (*ACE) Encode

func (a *ACE) Encode(b []uint8)

func (*ACE) Size

func (a *ACE) Size() int

type ACL

type ACL []ACE

func (*ACL) Encode

func (a *ACL) Encode(b []uint8)

func (*ACL) Size

func (a *ACL) Size() int

type AceDecoder

type AceDecoder []byte

func (AceDecoder) Flags

func (a AceDecoder) Flags() uint8

func (AceDecoder) Mask

func (a AceDecoder) Mask() uint32

func (AceDecoder) Sid

func (a AceDecoder) Sid() []byte

func (AceDecoder) Size

func (a AceDecoder) Size() uint16

func (AceDecoder) Type

func (a AceDecoder) Type() uint8

type AclDecoder

type AclDecoder []byte

func (AclDecoder) AceCount

func (a AclDecoder) AceCount() uint16

func (AclDecoder) Aces

func (a AclDecoder) Aces() []byte

func (AclDecoder) AclSize

func (a AclDecoder) AclSize() uint16

func (AclDecoder) Revision

func (a AclDecoder) Revision() uint8

type AfpInfo

type AfpInfo struct {
	Signature  [4]byte // always "AFP_"
	Version    [4]byte // usually 0x00010000 for AFP_AfpInfo
	FileBitmap [2]byte // bitmap for file attributes
	Reserved1  [2]byte
	FinderInfo [32]byte // Finder-specific information
	ProDOSInfo [6]byte  // ProDOS metadata
	Reserved2  [10]byte
}

func (*AfpInfo) Encode

func (i *AfpInfo) Encode(pkt []byte)

func (*AfpInfo) Size

func (i *AfpInfo) Size() int

type Authenticator

type Authenticator interface {
	// contains filtered or unexported methods
}

type ConnState

type ConnState int

type ContextError

type ContextError struct {
	Err error
}

ContextError wraps a context error to support os.IsTimeout function.

func (*ContextError) Error

func (err *ContextError) Error() string

func (*ContextError) Timeout

func (err *ContextError) Timeout() bool

type FileAccessInformationInfo

type FileAccessInformationInfo struct {
	AccessFlags uint32
}

func (*FileAccessInformationInfo) Encode

func (i *FileAccessInformationInfo) Encode(pkt []byte)

func (*FileAccessInformationInfo) Size

func (i *FileAccessInformationInfo) Size() int

type FileAlignmentInformationInfo

type FileAlignmentInformationInfo struct {
	AlignmentRequirement uint32
}

func (*FileAlignmentInformationInfo) Encode

func (i *FileAlignmentInformationInfo) Encode(pkt []byte)

func (*FileAlignmentInformationInfo) Size

type FileAllInformationInfo

type FileAllInformationInfo struct {
	BasicInformation     FileBasicInformationInfo
	StandardInformation  FileStandardInformationInfo
	Internal             FileInternalInformationInfo
	EaInformation        FileEaInformationInfo
	AccessInformation    FileAccessInformationInfo
	PositionInformation  FilePositionInformationInfo
	ModeInformation      FileModeInformationInfo
	AlignmentInformation FileAlignmentInformationInfo
	NameInformation      FileAlternateNameInformationInfo
}

func (*FileAllInformationInfo) Encode

func (i *FileAllInformationInfo) Encode(pkt []byte)

func (*FileAllInformationInfo) Size

func (i *FileAllInformationInfo) Size() int

type FileAlternateNameInformationInfo

type FileAlternateNameInformationInfo struct {
	FileName string
}

func (*FileAlternateNameInformationInfo) Encode

func (i *FileAlternateNameInformationInfo) Encode(pkt []byte)

func (*FileAlternateNameInformationInfo) Size

type FileAttributeTagInformationInfo

type FileAttributeTagInformationInfo struct {
	FileAttributes uint32
	ReparseTag     uint32
}

type FileBasicInformationInfo

type FileBasicInformationInfo struct {
	CreationTime   Filetime
	LastAccessTime Filetime
	LastWriteTime  Filetime
	ChangeTime     Filetime
	FileAttributes uint32
	Pad            uint32
}

func (*FileBasicInformationInfo) Encode

func (i *FileBasicInformationInfo) Encode(pkt []byte)

func (*FileBasicInformationInfo) Size

func (i *FileBasicInformationInfo) Size() int

type FileBasicInformationInfoDecoder

type FileBasicInformationInfoDecoder []byte

func (FileBasicInformationInfoDecoder) ChangeTime

func (f FileBasicInformationInfoDecoder) ChangeTime() *Filetime

func (FileBasicInformationInfoDecoder) CreationTime

func (f FileBasicInformationInfoDecoder) CreationTime() *Filetime

func (FileBasicInformationInfoDecoder) FileAttributes

func (f FileBasicInformationInfoDecoder) FileAttributes() uint32

func (FileBasicInformationInfoDecoder) LastAccessTime

func (f FileBasicInformationInfoDecoder) LastAccessTime() *Filetime

func (FileBasicInformationInfoDecoder) LastWriteTime

func (f FileBasicInformationInfoDecoder) LastWriteTime() *Filetime

type FileBothDirectoryInformationInfo

type FileBothDirectoryInformationInfo struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	//FileNameLength  uint32
	EaSize          uint32
	ShortNameLength uint8
	Pad             uint8
	ShortName       [24]byte // The file's short name in 8.3 format
	FileName        string
}

func (FileBothDirectoryInformationInfo) Encode

func (i FileBothDirectoryInformationInfo) Encode(pkt []byte)

func (FileBothDirectoryInformationInfo) Size

type FileCompressionInformationInfo

type FileCompressionInformationInfo struct {
	CompressedFileSize   int64
	CompressionFormat    uint16
	CompressionUnitShift uint8
	ChunkShift           uint8
	ClusterShift         uint8
	Reserved             [3]uint8 // Placeholder for alignment and future use
}

type FileDirectoryInformationInfo

type FileDirectoryInformationInfo struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	FileName        string
}

func (FileDirectoryInformationInfo) Encode

func (i FileDirectoryInformationInfo) Encode(pkt []byte)

func (FileDirectoryInformationInfo) Size

type FileDispositionInformationInfo

type FileDispositionInformationInfo struct {
	DeletePending byte
}

type FileDispositionInformationInfoDecoder

type FileDispositionInformationInfoDecoder []byte

func (FileDispositionInformationInfoDecoder) DeletePending

func (f FileDispositionInformationInfoDecoder) DeletePending() byte

type FileEaInformationInfo

type FileEaInformationInfo struct {
	EaSize uint32
}

func (*FileEaInformationInfo) Encode

func (i *FileEaInformationInfo) Encode(pkt []byte)

func (*FileEaInformationInfo) Size

func (i *FileEaInformationInfo) Size() int

type FileEndOfFileInformationInfo

type FileEndOfFileInformationInfo struct {
	EndOfFile uint64
}

type FileEndOfFileInformationInfoDecoder

type FileEndOfFileInformationInfoDecoder []byte

func (FileEndOfFileInformationInfoDecoder) EndOfFile

type FileFsAttributeInformationInfo

type FileFsAttributeInformationInfo struct {
	FileSystemAttributes       uint32
	MaximumComponentNameLength uint32
	//FileSystemNameLength       uint32
	FileSystemName string
}

func (*FileFsAttributeInformationInfo) Encode

func (i *FileFsAttributeInformationInfo) Encode(pkt []byte)

func (*FileFsAttributeInformationInfo) Size

type FileFsControlInformationInfo

type FileFsControlInformationInfo struct {
	FreeSpaceStartFiltering int64
	FreeSpaceThreshold      int64
	FreeSpaceStopFiltering  int64
	DefaultQuotaThreshold   int64
	DefaultQuotaLimit       int64
	FileSystemControlFlags  uint32
}

type FileFsDeviceInformationInfo

type FileFsDeviceInformationInfo struct {
	DeviceType      uint32
	Characteristics uint32
}

func (*FileFsDeviceInformationInfo) Encode

func (i *FileFsDeviceInformationInfo) Encode(pkt []byte)

func (*FileFsDeviceInformationInfo) Size

func (i *FileFsDeviceInformationInfo) Size() int

type FileFsFullSizeInformationInfo

type FileFsFullSizeInformationInfo struct {
	TotalAllocationUnits           int64
	CallerAvailableAllocationUnits int64
	ActualAvailableAllocationUnits int64
	SectorsPerAllocationUnit       uint32
	BytesPerSector                 uint32
}

func (*FileFsFullSizeInformationInfo) Encode

func (i *FileFsFullSizeInformationInfo) Encode(pkt []byte)

func (*FileFsFullSizeInformationInfo) Size

type FileFsObjectIdInfo

type FileFsObjectIdInfo struct {
	ObjectId     FileId
	ExtendedInfo [48]byte
}

func (*FileFsObjectIdInfo) Encode

func (i *FileFsObjectIdInfo) Encode(pkt []byte)

func (*FileFsObjectIdInfo) Size

func (i *FileFsObjectIdInfo) Size() int

type FileFsObjectIdInformationInfo

type FileFsObjectIdInformationInfo struct {
	FileSystemObjectId [16]byte // Typically UUIDs are 16 bytes
	ExtendedInfo       [48]byte // Extended information, could be an array of bytes or further structured
}

type FileFsSectorSizeInformationInfo

type FileFsSectorSizeInformationInfo struct {
	LogicalBytesPerSector                                 uint32
	PhysicalBytesPerSectorForAtomicity                    uint32
	PhysicalBytesPerSectorForPerformance                  uint32
	FileSystemEffectivePhysicalBytesPerSectorForAtomicity uint32
	Flags                                                 uint32
	ByteOffsetForSectorAlignment                          uint32
	ByteOffsetForPartitionAlignment                       uint32
}

type FileFsSizeInformationInfo

type FileFsSizeInformationInfo struct {
	TotalAllocationUnits     int64
	AvailableAllocationUnits int64
	SectorsPerAllocationUnit uint32
	BytesPerSector           uint32
}

func (*FileFsSizeInformationInfo) Encode

func (i *FileFsSizeInformationInfo) Encode(pkt []byte)

func (*FileFsSizeInformationInfo) Size

func (i *FileFsSizeInformationInfo) Size() int

type FileFsVolumeInformationInfo

type FileFsVolumeInformationInfo struct {
	VolumeCreationTime Filetime
	VolumeSerialNumber uint32
	//VolumeLabelLength  uint32
	SupportsObjects bool
	VolumeLabel     string
}

func (FileFsVolumeInformationInfo) Encode

func (i FileFsVolumeInformationInfo) Encode(pkt []byte)

func (FileFsVolumeInformationInfo) Size

type FileFullDirectoryInformationInfo

type FileFullDirectoryInformationInfo struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	EaSize          uint32
	FileName        string
}

func (FileFullDirectoryInformationInfo) Encode

func (i FileFullDirectoryInformationInfo) Encode(pkt []byte)

func (FileFullDirectoryInformationInfo) Size

type FileFullEaInformationInfo

type FileFullEaInformationInfo struct {
	NextEntryOffset uint32
	Flags           uint8
	EaNameLength    uint8
	EaValueLength   uint16
	EaName          string
}

type FileIdBothDirectoryInformationInfo

type FileIdBothDirectoryInformationInfo struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	//FileNameLength  uint32
	EaSize          uint32
	ShortNameLength uint8
	Pad             uint8
	ShortName       [24]byte // The file's short name in 8.3 format
	Pad2            uint16
	FileId          uint64
	FileName        string
}

func (FileIdBothDirectoryInformationInfo) Encode

func (i FileIdBothDirectoryInformationInfo) Encode(pkt []byte)

func (FileIdBothDirectoryInformationInfo) Size

type FileIdBothDirectoryInformationInfo2

type FileIdBothDirectoryInformationInfo2 struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	//FileNameLength  uint32
	MaxAccess            uint32
	ShortNameLength      uint8
	Pad                  uint8
	RsrcForkLen          uint64
	CompressedFinderInfo [16]byte
	UnixMode             uint16
	FileId               uint64
	FileName             string
}

func (FileIdBothDirectoryInformationInfo2) Encode

func (i FileIdBothDirectoryInformationInfo2) Encode(pkt []byte)

func (FileIdBothDirectoryInformationInfo2) Size

type FileIdFullDirectoryInformationInfo

type FileIdFullDirectoryInformationInfo struct {
	NextEntryOffset uint32 // Byte offset of the next file or directory entry, 0 if this is the last entry
	FileIndex       uint32
	CreationTime    Filetime
	LastAccessTime  Filetime
	LastWriteTime   Filetime
	ChangeTime      Filetime
	EndOfFile       uint64
	AllocationSize  uint64
	FileAttributes  uint32
	//FileNameLength  uint32
	EaSize   uint32
	Pad2     uint32
	FileId   uint64
	FileName string
}

func (FileIdFullDirectoryInformationInfo) Encode

func (i FileIdFullDirectoryInformationInfo) Encode(pkt []byte)

func (FileIdFullDirectoryInformationInfo) Size

type FileIdInformationInfo

type FileIdInformationInfo struct {
	FileId int64
}

func (*FileIdInformationInfo) Encode

func (i *FileIdInformationInfo) Encode(pkt []byte)

func (*FileIdInformationInfo) Size

func (i *FileIdInformationInfo) Size() int

type FileInformationInfoResponse

type FileInformationInfoResponse struct {
	Items []Encoder
}

func (*FileInformationInfoResponse) Encode

func (i *FileInformationInfoResponse) Encode(pkt []byte)

func (*FileInformationInfoResponse) Size

func (i *FileInformationInfoResponse) Size() int

type FileInternalInformationInfo

type FileInternalInformationInfo struct {
	IndexNumber int64
}

func (*FileInternalInformationInfo) Encode

func (i *FileInternalInformationInfo) Encode(pkt []byte)

func (*FileInternalInformationInfo) Size

func (i *FileInternalInformationInfo) Size() int

type FileModeInformationInfo

type FileModeInformationInfo struct {
	Mode uint32
}

func (*FileModeInformationInfo) Encode

func (i *FileModeInformationInfo) Encode(pkt []byte)

func (*FileModeInformationInfo) Size

func (i *FileModeInformationInfo) Size() int

type FileNetworkOpenInformationInfo

type FileNetworkOpenInformationInfo struct {
	CreationTime   Filetime
	LastAccessTime Filetime
	LastWriteTime  Filetime
	ChangeTime     Filetime
	AllocationSize int64
	EndOfFile      int64
	FileAttributes uint32
}

func (*FileNetworkOpenInformationInfo) Encode

func (i *FileNetworkOpenInformationInfo) Encode(pkt []byte)

func (*FileNetworkOpenInformationInfo) Size

type FileNormalizedNameInformationInfo

type FileNormalizedNameInformationInfo struct {
	NormalizedName string
}

type FileNotifyInformationInfo

type FileNotifyInformationInfo struct {
	NextEntryOffset uint32
	Action          uint32
	FileName        string
}

func (*FileNotifyInformationInfo) Encode

func (i *FileNotifyInformationInfo) Encode(pkt []byte)

func (*FileNotifyInformationInfo) Size

func (i *FileNotifyInformationInfo) Size() int

type FileObjectId1

type FileObjectId1 struct {
	ObjectId      FileId
	BirthVolumeId FileId
	BirthObjectId FileId
	DomainId      FileId
}

func (*FileObjectId1) Encode

func (i *FileObjectId1) Encode(pkt []byte)

func (*FileObjectId1) Size

func (i *FileObjectId1) Size() int

type FilePipeInformationInfo

type FilePipeInformationInfo struct {
	ReadModeMessage uint32
	CompletionMode  uint32
}

type FilePipeLocalInformationInfo

type FilePipeLocalInformationInfo struct {
	NamedPipeType          uint32
	NamedPipeConfiguration uint32
	MaximumInstances       uint32
	CurrentInstances       uint32
	InboundQuota           uint32
	ReadDataAvailable      uint32
	OutboundQuota          uint32
	WriteQuotaAvailable    uint32
	NamedPipeState         uint32
	NamedPipeEnd           uint32
}

type FilePipeRemoteInformationInfo

type FilePipeRemoteInformationInfo struct {
	CollectDataTime int64
	ByteCount       uint32
}

type FilePositionInformationInfo

type FilePositionInformationInfo struct {
	CurrentByteOffset int64
}

func (*FilePositionInformationInfo) Encode

func (i *FilePositionInformationInfo) Encode(pkt []byte)

func (*FilePositionInformationInfo) Size

func (i *FilePositionInformationInfo) Size() int

type FileRenameInformationInfo

type FileRenameInformationInfo struct {
	ReplaceIfExists byte
	//Reserved        [7]byte
	RootDirectory  uint64
	FileNameLength uint32
	FileName       string
}

type FileRenameInformationInfoDecoder

type FileRenameInformationInfoDecoder []byte

func (FileRenameInformationInfoDecoder) FileName

func (FileRenameInformationInfoDecoder) FileNameLength

func (f FileRenameInformationInfoDecoder) FileNameLength() uint32

func (FileRenameInformationInfoDecoder) ReplaceIfExists

func (f FileRenameInformationInfoDecoder) ReplaceIfExists() byte

func (FileRenameInformationInfoDecoder) RootDirectory

func (f FileRenameInformationInfoDecoder) RootDirectory() uint64

type FileStandardInformationInfo

type FileStandardInformationInfo struct {
	AllocationSize int64
	EndOfFile      int64
	NumberOfLinks  uint32
	DeletePending  byte
	Directory      byte
	Pad            [2]byte
}

func (*FileStandardInformationInfo) Encode

func (i *FileStandardInformationInfo) Encode(pkt []byte)

func (*FileStandardInformationInfo) Size

func (i *FileStandardInformationInfo) Size() int

type FileStreamInformationInfo

type FileStreamInformationInfo struct {
	NextEntryOffset uint32
	//StreamNameLength     uint32
	StreamSize           uint64
	StreamAllocationSize uint64
	StreamName           string
}

func (*FileStreamInformationInfo) Encode

func (i *FileStreamInformationInfo) Encode(pkt []byte)

func (*FileStreamInformationInfo) Size

func (i *FileStreamInformationInfo) Size() int

type FileStreamInformationInfoItems

type FileStreamInformationInfoItems []FileStreamInformationInfo

func (FileStreamInformationInfoItems) Encode

func (i FileStreamInformationInfoItems) Encode(pkt []byte)

func (FileStreamInformationInfoItems) Size

type InternalError

type InternalError struct {
	Message string
}

InternalError represents internal error.

func (*InternalError) Error

func (err *InternalError) Error() string

type InvalidRequestError

type InvalidRequestError struct {
	Message string
}

InvalidResponseError represents a data sent by the server is corrupted or unexpected.

func (*InvalidRequestError) Error

func (err *InvalidRequestError) Error() string

type InvalidResponseError

type InvalidResponseError struct {
	Message string
}

InvalidResponseError represents a data sent by the server is corrupted or unexpected.

func (*InvalidResponseError) Error

func (err *InvalidResponseError) Error() string

type Lease

type Lease struct {
}

type NTLMAuthenticator

type NTLMAuthenticator struct {
	UserPassword map[string]string
	TargetSPN    string
	NbDomain     string
	NbName       string
	DnsName      string
	DnsDomain    string
	AllowGuest   bool
	// contains filtered or unexported fields
}

NTLMAuthenticator implements session-setup through NTLMv2. It doesn't support NTLMv1. You can use Hash instead of Password.

type OpLockState

type OpLockState uint8
const (
	LOCKSTATE_NONE OpLockState = iota
	LOCKSTATE_HELD
	LOCKSTATE_BREAKING
)

type Open

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

type RequestError

type RequestError struct {
	Code uint32 // NTSTATUS
	// contains filtered or unexported fields
}

ResponseError represents a error with a nt status code sent by the server. The NTSTATUS is defined in [MS-ERREF]. https://msdn.microsoft.com/en-au/library/cc704588.aspx

func (*RequestError) Error

func (err *RequestError) Error() string

type ResponseError

type ResponseError struct {
	Code uint32 // NTSTATUS
	// contains filtered or unexported fields
}

ResponseError represents a error with a nt status code sent by the server. The NTSTATUS is defined in [MS-ERREF]. https://msdn.microsoft.com/en-au/library/cc704588.aspx

func (*ResponseError) Error

func (err *ResponseError) Error() string

type SID

type SID struct {
	IdentifierAuthority SID_IDENTIFIER_AUTHORITY
	SubAuthority        []uint32
}

func SIDFromGid

func SIDFromGid(gid uint32) *SID

func SIDFromMode

func SIDFromMode(mode uint32) *SID

func SIDFromUid

func SIDFromUid(uid uint32) *SID

func (*SID) Encode

func (s *SID) Encode(b []uint8)

func (*SID) Size

func (s *SID) Size() int

type SID_IDENTIFIER_AUTHORITY

type SID_IDENTIFIER_AUTHORITY [6]byte

type SecurityDescriptor

type SecurityDescriptor struct {
	OwnerSid *SID
	GroupSid *SID
	Sacl     *ACL
	Dacl     *ACL
}

func (*SecurityDescriptor) Encode

func (d *SecurityDescriptor) Encode(b []uint8)

func (*SecurityDescriptor) Size

func (d *SecurityDescriptor) Size() int

type SecurityDescriptorDecoder

type SecurityDescriptorDecoder []byte

func (SecurityDescriptorDecoder) Control

func (sd SecurityDescriptorDecoder) Control() uint16

func (SecurityDescriptorDecoder) Dacl

func (sd SecurityDescriptorDecoder) Dacl() []byte

func (SecurityDescriptorDecoder) GroupSid

func (sd SecurityDescriptorDecoder) GroupSid() []byte

func (SecurityDescriptorDecoder) OffsetDacl

func (sd SecurityDescriptorDecoder) OffsetDacl() uint32

func (SecurityDescriptorDecoder) OffsetGroup

func (sd SecurityDescriptorDecoder) OffsetGroup() uint32

func (SecurityDescriptorDecoder) OffsetOwner

func (sd SecurityDescriptorDecoder) OffsetOwner() uint32

func (SecurityDescriptorDecoder) OffsetSacl

func (sd SecurityDescriptorDecoder) OffsetSacl() uint32

func (SecurityDescriptorDecoder) OwnerSid

func (sd SecurityDescriptorDecoder) OwnerSid() []byte

func (SecurityDescriptorDecoder) Revision

func (sd SecurityDescriptorDecoder) Revision() uint8

func (SecurityDescriptorDecoder) Sacl

func (sd SecurityDescriptorDecoder) Sacl() []byte

type Server

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

func NewServer

func NewServer(cfg *ServerConfig, a Authenticator, shares map[string]vfs.VFSFileSystem) *Server

func (*Server) Serve

func (d *Server) Serve(addr string) error

func (*Server) Shutdown

func (d *Server) Shutdown()

type ServerConfig

type ServerConfig struct {
	AllowGuest       bool
	MaxIOReads       int
	MaxIOWrites      int
	Xatrrs           bool
	IgnoreSetAttrErr bool
}

type ServerNegotiator

type ServerNegotiator struct {
	RequireMessageSigning bool   // enforce signing?
	SpecifiedDialect      uint16 // if it's zero, clientDialects is used. (See feature.go for more details)
	Spnego                *spnegoServer
}

Negotiator contains options for func (*Dialer) Dial.

type TransportError

type TransportError struct {
	Err error
}

TransportError represents a error come from net.Conn layer.

func (*TransportError) Error

func (err *TransportError) Error() string

Jump to

Keyboard shortcuts

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