gvisorgvisor.dev/gvisor/pkg/tcpip/seqnum Index | Files

package seqnum

import "gvisor.dev/gvisor/pkg/tcpip/seqnum"

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

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.

Source Files

seqnum.go

Version
v0.0.0-20250515200445-d30c58e5b8a4 (latest)
Published
May 15, 2025
Platform
linux/amd64
Last checked
9 hours ago

Tools for package owners.