Documentation
¶
Index ¶
- func NewDefaultStack(ipAddr string, macAddress string, networkIfaceGateway string, ...) (*stack.Stack, error)
- type Option
- func WithCreatingNIC(nicId tcpip.NICID, ep stack.LinkEndpoint) Option
- func WithDefault() Option
- func WithDefaultTTL(ttl uint8) Option
- func WithForwarding(v bool) Option
- func WithICMPBurst(burst int) Option
- func WithICMPLimit(limit rate.Limit) Option
- func WithIPv4RouteTableDefaultGateway(nicID tcpip.NICID, gateway netip.Addr) Option
- func WithMainNICIP(nicID tcpip.NICID, ip tcpip.Address, mac net.HardwareAddr) Option
- func WithMulticastGroups(nicID tcpip.NICID, multicastGroups []netip.Addr) Option
- func WithPromiscuousMode(nicID tcpip.NICID, v bool) Option
- func WithRouteTable(nicID tcpip.NICID) Option
- func WithSpoofing(nicID tcpip.NICID, v bool) Option
- func WithTCPCongestionControl(cc string) Option
- func WithTCPDelay(v bool) Option
- func WithTCPHandler(handle func(TCPConn)) Option
- func WithTCPModerateReceiveBuffer(v bool) Option
- func WithTCPReceiveBufferSize(size int) Option
- func WithTCPReceiveBufferSizeRange(a, b, c int) Option
- func WithTCPRecovery(v tcpip.TCPRecovery) Option
- func WithTCPSACKEnabled(v bool) Option
- func WithTCPSendBufferSize(size int) Option
- func WithTCPSendBufferSizeRange(a, b, c int) Option
- func WithUDPHandler(handle func(UDPConn)) Option
- type TCPConn
- type TransportHandler
- type UDPConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
func WithCreatingNIC ¶
func WithCreatingNIC(nicId tcpip.NICID, ep stack.LinkEndpoint) Option
func WithDefaultTTL ¶
WithDefaultTTL sets the default TTL used by stack.
func WithForwarding ¶
WithForwarding sets packet forwarding between NICs for IPv4 & IPv6.
func WithICMPBurst ¶
WithICMPBurst sets the number of ICMP messages that can be sent in a single burst.
func WithICMPLimit ¶
WithICMPLimit sets the maximum number of ICMP messages permitted by rate limiter.
func WithMainNICIP ¶
func WithMulticastGroups ¶
withMulticastGroups adds a NIC to the given multicast groups.
func WithPromiscuousMode ¶
WithPromiscuousMode sets promiscuous mode in the given NICs.
func WithRouteTable ¶
func WithSpoofing ¶
WithSpoofing sets address spoofing in the given NICs, allowing endpoints to bind to any address in the NIC.
func WithTCPCongestionControl ¶
WithTCPCongestionControl sets the current congestion control algorithm.
func WithTCPDelay ¶
WithTCPDelay enables or disables Nagle's algorithm in TCP.
func WithTCPHandler ¶
func WithTCPModerateReceiveBuffer ¶
WithTCPModerateReceiveBuffer sets receive buffer moderation for TCP.
func WithTCPReceiveBufferSize ¶
WithTCPReceiveBufferSize sets the default receive buffer size for TCP.
func WithTCPReceiveBufferSizeRange ¶
WithTCPReceiveBufferSizeRange sets the receive buffer size range for TCP.
func WithTCPRecovery ¶
func WithTCPRecovery(v tcpip.TCPRecovery) Option
WithTCPRecovery sets the recovery option for TCP.
func WithTCPSACKEnabled ¶
WithTCPSACKEnabled sets the SACK option for TCP.
func WithTCPSendBufferSize ¶
WithTCPSendBufferSize sets default the send buffer size for TCP.
func WithTCPSendBufferSizeRange ¶
WithTCPSendBufferSizeRange sets the send buffer size range for TCP.
func WithUDPHandler ¶
type TCPConn ¶
type TCPConn interface {
net.Conn
// ID returns the transport endpoint id of TCPConn.
ID() *stack.TransportEndpointID
}
TCPConn implements the net.Conn interface.
type TransportHandler ¶
TransportHandler is a TCP/UDP connection handler that implements HandleTCP and HandleUDP methods.
type UDPConn ¶
type UDPConn interface {
net.Conn
net.PacketConn
// ID returns the transport endpoint id of UDPConn.
ID() *stack.TransportEndpointID
}
UDPConn implements net.Conn and net.PacketConn.
Directories
¶
| Path | Synopsis |
|---|---|
|
gvisor
|
|
|
pkg/atomicbitops
Package atomicbitops provides extensions to the sync/atomic package.
|
Package atomicbitops provides extensions to the sync/atomic package. |
|
pkg/bits
Package bits includes all bit related types and operations.
|
Package bits includes all bit related types and operations. |
|
pkg/buffer
Package buffer provides the implementation of a non-contiguous buffer that is reference counted, pooled, and copy-on-write.
|
Package buffer provides the implementation of a non-contiguous buffer that is reference counted, pooled, and copy-on-write. |
|
pkg/context
Package context defines an internal context type.
|
Package context defines an internal context type. |
|
pkg/cpuid
Package cpuid provides basic functionality for creating and adjusting CPU feature sets.
|
Package cpuid provides basic functionality for creating and adjusting CPU feature sets. |
|
pkg/gohacks
Package gohacks contains utilities for subverting the Go compiler.
|
Package gohacks contains utilities for subverting the Go compiler. |
|
pkg/goid
Package goid provides the Get function.
|
Package goid provides the Get function. |
|
pkg/linewriter
Package linewriter provides an io.Writer which calls an emitter on each line.
|
Package linewriter provides an io.Writer which calls an emitter on each line. |
|
pkg/rand
Package rand implements a cryptographically secure pseudorandom number generator.
|
Package rand implements a cryptographically secure pseudorandom number generator. |
|
pkg/refs
Package refs defines an interface for reference counted objects.
|
Package refs defines an interface for reference counted objects. |
|
pkg/sleep
Package sleep allows goroutines to efficiently sleep on multiple sources of notifications (wakers).
|
Package sleep allows goroutines to efficiently sleep on multiple sources of notifications (wakers). |
|
pkg/state
Package state provides functionality related to saving and loading object graphs.
|
Package state provides functionality related to saving and loading object graphs. |
|
pkg/state/wire
Package wire contains a few basic types that can be composed to serialize graph information for the state package.
|
Package wire contains a few basic types that can be composed to serialize graph information for the state package. |
|
pkg/sync
Package sync provides synchronization primitives.
|
Package sync provides synchronization primitives. |
|
pkg/sync/locking
Package locking implements lock primitives with the correctness validator.
|
Package locking implements lock primitives with the correctness validator. |
|
pkg/tcpip
Package tcpip provides the interfaces and related types that users of the tcpip stack will use in order to create endpoints used to send and receive data over the network stack.
|
Package tcpip provides the interfaces and related types that users of the tcpip stack will use in order to create endpoints used to send and receive data over the network stack. |
|
pkg/tcpip/adapters/gonet
Package gonet provides a Go net package compatible wrapper for a tcpip stack.
|
Package gonet provides a Go net package compatible wrapper for a tcpip stack. |
|
pkg/tcpip/checksum
Package checksum provides the implementation of the encoding and decoding of network protocol headers.
|
Package checksum provides the implementation of the encoding and decoding of network protocol headers. |
|
pkg/tcpip/hash/jenkins
Package jenkins implements Jenkins's one_at_a_time, non-cryptographic hash functions created by by Bob Jenkins.
|
Package jenkins implements Jenkins's one_at_a_time, non-cryptographic hash functions created by by Bob Jenkins. |
|
pkg/tcpip/header
Package header provides the implementation of the encoding and decoding of network protocol headers.
|
Package header provides the implementation of the encoding and decoding of network protocol headers. |
|
pkg/tcpip/header/parse
Package parse provides utilities to parse packets.
|
Package parse provides utilities to parse packets. |
|
pkg/tcpip/internal/tcp
Package tcp contains internal type definitions that are not expected to be used by anyone else outside pkg/tcpip.
|
Package tcp contains internal type definitions that are not expected to be used by anyone else outside pkg/tcpip. |
|
pkg/tcpip/link/channel
Package channel provides the implementation of channel-based data-link layer endpoints.
|
Package channel provides the implementation of channel-based data-link layer endpoints. |
|
pkg/tcpip/network/arp
Package arp implements the ARP network protocol.
|
Package arp implements the ARP network protocol. |
|
pkg/tcpip/network/hash
Package hash contains utility functions for hashing.
|
Package hash contains utility functions for hashing. |
|
pkg/tcpip/network/internal/fragmentation
Package fragmentation contains the implementation of IP fragmentation.
|
Package fragmentation contains the implementation of IP fragmentation. |
|
pkg/tcpip/network/internal/ip
Package ip holds IPv4/IPv6 common utilities.
|
Package ip holds IPv4/IPv6 common utilities. |
|
pkg/tcpip/network/internal/multicast
Package multicast contains utilities for supporting multicast routing.
|
Package multicast contains utilities for supporting multicast routing. |
|
pkg/tcpip/network/ipv4
Package ipv4 contains the implementation of the ipv4 network protocol.
|
Package ipv4 contains the implementation of the ipv4 network protocol. |
|
pkg/tcpip/network/ipv6
Package ipv6 contains the implementation of the ipv6 network protocol.
|
Package ipv6 contains the implementation of the ipv6 network protocol. |
|
pkg/tcpip/ports
Package ports provides PortManager that manages allocating, reserving and releasing ports.
|
Package ports provides PortManager that manages allocating, reserving and releasing ports. |
|
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.
|
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. |
|
pkg/tcpip/stack
Package stack provides the glue between networking protocols and the consumers of the networking stack.
|
Package stack provides the glue between networking protocols and the consumers of the networking stack. |
|
pkg/tcpip/transport
Package transport supports transport protocols.
|
Package transport supports transport protocols. |
|
pkg/tcpip/transport/icmp
Package icmp contains the implementation of the ICMP and IPv6-ICMP transport protocols for use in ping.
|
Package icmp contains the implementation of the ICMP and IPv6-ICMP transport protocols for use in ping. |
|
pkg/tcpip/transport/internal/network
Package network provides facilities to support tcpip.Endpoints that operate at the network layer or above.
|
Package network provides facilities to support tcpip.Endpoints that operate at the network layer or above. |
|
pkg/tcpip/transport/internal/noop
Package noop contains an endpoint that implements all tcpip.Endpoint functions as noops.
|
Package noop contains an endpoint that implements all tcpip.Endpoint functions as noops. |
|
pkg/tcpip/transport/packet
Package packet provides the implementation of packet sockets (see packet(7)).
|
Package packet provides the implementation of packet sockets (see packet(7)). |
|
pkg/tcpip/transport/raw
Package raw provides the implementation of raw sockets (see raw(7)).
|
Package raw provides the implementation of raw sockets (see raw(7)). |
|
pkg/tcpip/transport/tcp
Package tcp contains the implementation of the TCP transport protocol.
|
Package tcp contains the implementation of the TCP transport protocol. |
|
pkg/tcpip/transport/tcpconntrack
Package tcpconntrack implements a TCP connection tracking object.
|
Package tcpconntrack implements a TCP connection tracking object. |
|
pkg/tcpip/transport/udp
Package udp contains the implementation of the UDP transport protocol.
|
Package udp contains the implementation of the UDP transport protocol. |
|
pkg/waiter
Package waiter provides the implementation of a wait queue, where waiters can be enqueued to be notified when an event of interest happens.
|
Package waiter provides the implementation of a wait queue, where waiters can be enqueued to be notified when an event of interest happens. |