stack

package
v0.0.0-...-cb763c6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package stack provides a thin wrapper around a gVisor's stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Stack) error

func WithDefault

func WithDefault() Option

WithDefault sets all default values for stack.

func WithDefaultTTL

func WithDefaultTTL(ttl uint8) Option

WithDefaultTTL sets the default TTL used by stack.

func WithForwarding

func WithForwarding(v bool) Option

WithForwarding sets packet forwarding between NICs for IPv4 & IPv6.

func WithICMPBurst

func WithICMPBurst(burst int) Option

WithICMPBurst sets the number of ICMP messages that can be sent in a single burst.

func WithICMPLimit

func WithICMPLimit(limit rate.Limit) Option

WithICMPLimit sets the maximum number of ICMP messages permitted by rate limiter.

func WithTCPBufferSizeRange

func WithTCPBufferSizeRange(a, b, c int) Option

WithTCPBufferSizeRange sets the receive and send buffer size range for TCP.

func WithTCPCongestionControl

func WithTCPCongestionControl(cc string) Option

WithTCPCongestionControl sets the current congestion control algorithm.

func WithTCPDelay

func WithTCPDelay(v bool) Option

WithTCPDelay enables or disables Nagle's algorithm in TCP.

func WithTCPModerateReceiveBuffer

func WithTCPModerateReceiveBuffer(v bool) Option

WithTCPModerateReceiveBuffer sets receive buffer moderation for TCP.

func WithTCPSACKEnabled

func WithTCPSACKEnabled(v bool) Option

WithTCPSACKEnabled sets the SACK option for TCP.

type Stack

type Stack struct {
	*stack.Stack
	// contains filtered or unexported fields
}

func New

func New(ep stack.LinkEndpoint, handler core.Handler, opts ...Option) (*Stack, error)

New allocates a new *Stack with given options.

Jump to

Keyboard shortcuts

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