seqnum

package
v0.0.0-...-7458283 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0, MIT Imports: 0 Imported by: 24

Documentation

Overview

Package seqnum defines the types and methods for TCP sequence numbers such that they fit in 32-bit words and work properly when overflows occur.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Size

type Size uint32

Size represents the size (length) of a sequence number window.

type Value

type Value uint32

Value represents the value of a sequence number.

func (Value) Add

func (v Value) Add(s Size) Value

Add calculates the sequence number following the [v, v+s) window.

func (Value) InRange

func (v Value) InRange(a, b Value) bool

InRange checks if v is in the range [a,b), i.e., a <= v < b.

func (Value) InWindow

func (v Value) InWindow(first Value, size Size) bool

InWindow checks if v is in the window that starts at 'first' and spans 'size' sequence numbers.

func (Value) LessThan

func (v Value) LessThan(w Value) bool

LessThan checks if v is before w, i.e., v < w.

func (Value) LessThanEq

func (v Value) LessThanEq(w Value) bool

LessThanEq returns true if v==w or v is before i.e., v < w.

func (Value) Size

func (v Value) Size(w Value) Size

Size calculates the size of the window defined by [v, w).

func (*Value) UpdateForward

func (v *Value) UpdateForward(s Size)

UpdateForward updates v such that it becomes v + s.

Jump to

Keyboard shortcuts

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