Documentation ¶
Overview ¶
Package smbserver provides an SMB version 2 and 3 server implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct { smb.Conn Sequencer ConnState GlobalState }
Conn represents the server's view of an SMB connection. It holds connection-specific state.
type ConnState ¶
type ConnState struct { ClientCapabilities smbcap.Flags Dialect smbdialect.State CreationTime time.Time ClientSecurity smbsecmode.Flags SupportMultiCredit bool MaxTransactSize uint32 MaxReadSize uint32 MaxWriteSize uint32 }
ConnState stores information about a connection on the server.
type GlobalState ¶
type GlobalState struct { Server smbid.ID RequireMessageSigning bool EncryptionSupported bool CompressionSupported bool }
GlobalState stores global information about the server.
type HandlerFunc ¶
type HandlerFunc func(c Conn)
HandlerFunc is a function that can act as a Handler.
func (HandlerFunc) ServeSMB ¶
func (h HandlerFunc) ServeSMB(c Conn)
ServeSMB handles the given SMB connection.
type Response ¶
type Response interface { Command() smbcommand.Code Status() uint32 // TODO: Make this strongly typed Size() int Marshal([]byte) }
Response can be marshaled into a message.
type Sequencer ¶
type Sequencer interface { // Credits returns the current number of credits allocated to the // connection. This is the number of outstanding sequence numbers. Credits() int // Expand increases the number of outstanding sequence numbers for the // connection by credits. // // If the expansion would cause the sequence numbers to wrap or a limit // to be exceeded it returns false. Expand(credits int) (ok bool) // Consume removes the given sequence number from the list of outstanding // sequence numbers. // // If the sequence number has already been consumed or is not outstanding // it returns false. Consume(n smb.SeqNum) (ok bool) }
A Sequencer keeps track of message sequence numbers for a connection.
Click to show internal directories.
Click to hide internal directories.