smbsequencer

package
v0.0.0-...-c8c792b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package smbsequencer provides an smbserver.Sequencer implementation that relies on a non-allocating circular bitmask.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sequencer

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

Sequencer keeps track of message sequence numbers for a connection. It must be created by calling New.

func New

func New(limit int) *Sequencer

New returns a new sequencer without any credits. The maximum number of credits allowed will be constrained by limit.

func (*Sequencer) Consume

func (s *Sequencer) Consume(n smb.SeqNum) (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.

func (*Sequencer) Credits

func (s *Sequencer) Credits() int

Credits returns the current number of credits allocated to the connection. This is the number of outstanding sequence numbers.

func (*Sequencer) Expand

func (s *Sequencer) Expand(credits int) (ok bool)

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.

Jump to

Keyboard shortcuts

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