smb2

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNotActive = "An instance of a named pipe cannot be found in the listening state"

Variables

This section is empty.

Functions

func CompatDialer

func CompatDialer(d any) (*smb2_fork.Dialer, error)

func NewDialer

func NewDialer(opts ...DialerOption) *smb2.Dialer

Types

type Dialect

type Dialect uint16
const (
	// SMB2.0.2 dialects.
	SMB202 Dialect = 0x0202
	// SMB2.1 dialects.
	SMB210 Dialect = 0x0210
	// SMB3.0 dialects.
	SMB300 Dialect = 0x0300
	// SMB3.0.2 dialects.
	SMB302 Dialect = 0x0302
	// SMB3.1.1 dialects.
	SMB311 Dialect = 0x0311
)

type DialerOption

type DialerOption func(*smb2.Dialer)

DialerOption is a function that configures a SMB2/3 Dialer.

func WithDialect

func WithDialect(dialect Dialect) DialerOption

WithDialect returns a DialerOption that configures a SMB2/3 Dialer to use the specified dialect.

func WithSeal

func WithSeal() DialerOption

WithSeal returns a DialerOption that configures a SMB2/3 Dialer to use message encryption whenever possible.

func WithSecurity

func WithSecurity(opts ...gssapi.ContextOption) DialerOption

WithSecurity returns a DialerOption that configures a SMB2/3 Dialer to use the specified GSSAPI security context.

func WithSign

func WithSign() DialerOption

WithSign returns a DialerOption that configures a SMB2/3 Dialer to require message signing.

type Initiator

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

func SecurtiyContextInitiator

func SecurtiyContextInitiator(opts ...gssapi.ContextOption) *Initiator

func (*Initiator) AcceptSecContext

func (i *Initiator) AcceptSecContext(b []byte) ([]byte, error)

func (*Initiator) InitSecContext

func (i *Initiator) InitSecContext() ([]byte, error)

func (*Initiator) OID

func (i *Initiator) OID() asn1.ObjectIdentifier

func (*Initiator) SessionKey

func (i *Initiator) SessionKey() []byte

func (*Initiator) Sum

func (i *Initiator) Sum(b []byte) []byte

type NamedPipe

type NamedPipe struct {
	*smb2.File
	Logger          zerolog.Logger
	Address         string
	Port            int
	Timeout         time.Duration
	Dialer          *smb2.Dialer
	NetworkDialFunc func(ctx context.Context, network, address string) (net.Conn, error)
	ShareName       string
	Name            string
}

func (*NamedPipe) Connect

func (pipe *NamedPipe) Connect(ctx context.Context) error

Jump to

Keyboard shortcuts

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