Class SequenceWindow

java.lang.Object
com.hierynomus.smbj.connection.SequenceWindow

public class SequenceWindow extends Object
[MS-SMB2] 3.2.4.1.6 Algorithm for Handling Available Message Sequence Numbers by the Client.

The client MUST implement an algorithm to manage message sequence numbers.

Sequence numbers are used to associate requests with responses and to determine what requests are allowed for processing. The algorithm MUST meet the following conditions:

  • When the connection is first established, the allowable sequence numbers for sending a request MUST be set to the set { 0 }.
  • The client MUST never send a request on a given connection with a sequence number that has already been used unless it is a request to cancel a previously sent request.
  • The client MUST grow the set in a monotonically increasing manner based on the credits granted. If the set is { 0 }, and 2 credits are granted, the set MUST grow to { 0, 1, 2 }.
  • The client MUST use the lowest available sequence number in its allowable set for each request.
  • For a multi-credit request as specified in section 3.2.4.1.5, the client MUST use the lowest available range of consecutive sequence numbers.
  • Field Details

  • Constructor Details

    • SequenceWindow

      public SequenceWindow()
  • Method Details

    • get

      long get()
    • get

      long[] get(int credits)
    • disableCredits

      void disableCredits()
    • available

      public int available()
    • creditsGranted

      public void creditsGranted(int credits)
    • range

      private long[] range(long start, long stop)