hostinet

package
v0.0.0-...-ff2c174 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0, MIT Imports: 39 Imported by: 0

Documentation

Overview

Package hostinet implements AF_INET and AF_INET6 sockets using the host's network stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHostInterfaces

func ExtractHostInterfaces(links []syscall.NetlinkMessage, addrs []syscall.NetlinkMessage, interfaces map[int32]inet.Interface, interfaceAddrs map[int32][]inet.InterfaceAddr) error

ExtractHostInterfaces will populate an interface map and interfaceAddrs map with the results of the equivalent netlink messages.

func ExtractHostRoutes

func ExtractHostRoutes(routeMsgs []syscall.NetlinkMessage) ([]inet.Route, error)

ExtractHostRoutes populates the given routes slice with the data from the host route table.

Types

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Stack implements inet.Stack for host sockets.

func NewStack

func NewStack() *Stack

NewStack returns an empty Stack containing no configuration.

func (*Stack) AddInterfaceAddr

func (s *Stack) AddInterfaceAddr(int32, inet.InterfaceAddr) error

AddInterfaceAddr implements inet.Stack.AddInterfaceAddr.

func (*Stack) CleanupEndpoints

func (s *Stack) CleanupEndpoints() []stack.TransportEndpoint

CleanupEndpoints implements inet.Stack.CleanupEndpoints.

func (*Stack) Configure

func (s *Stack) Configure() error

Configure sets up the stack using the current state of the host network.

func (*Stack) Forwarding

func (s *Stack) Forwarding(protocol tcpip.NetworkProtocolNumber) bool

Forwarding implements inet.Stack.Forwarding.

func (*Stack) InterfaceAddrs

func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr

InterfaceAddrs implements inet.Stack.InterfaceAddrs.

func (*Stack) Interfaces

func (s *Stack) Interfaces() map[int32]inet.Interface

Interfaces implements inet.Stack.Interfaces.

func (*Stack) PortRange

func (*Stack) PortRange() (uint16, uint16)

PortRange implements inet.Stack.PortRange.

func (*Stack) RegisteredEndpoints

func (s *Stack) RegisteredEndpoints() []stack.TransportEndpoint

RegisteredEndpoints implements inet.Stack.RegisteredEndpoints.

func (*Stack) RemoveInterfaceAddr

func (s *Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error

RemoveInterfaceAddr implements inet.Stack.RemoveInterfaceAddr.

func (*Stack) RestoreCleanupEndpoints

func (s *Stack) RestoreCleanupEndpoints([]stack.TransportEndpoint)

RestoreCleanupEndpoints implements inet.Stack.RestoreCleanupEndpoints.

func (*Stack) Resume

func (s *Stack) Resume()

Resume implements inet.Stack.Resume.

func (*Stack) RouteTable

func (s *Stack) RouteTable() []inet.Route

RouteTable implements inet.Stack.RouteTable.

func (*Stack) SetForwarding

func (s *Stack) SetForwarding(tcpip.NetworkProtocolNumber, bool) error

SetForwarding implements inet.Stack.SetForwarding.

func (*Stack) SetPortRange

func (*Stack) SetPortRange(start uint16, end uint16) error

SetPortRange implements inet.Stack.SetPortRange.

func (*Stack) SetTCPReceiveBufferSize

func (s *Stack) SetTCPReceiveBufferSize(size inet.TCPBufferSize) error

SetTCPReceiveBufferSize implements inet.Stack.SetTCPReceiveBufferSize.

func (*Stack) SetTCPRecovery

func (s *Stack) SetTCPRecovery(inet.TCPLossRecovery) error

SetTCPRecovery implements inet.Stack.SetTCPRecovery.

func (*Stack) SetTCPSACKEnabled

func (s *Stack) SetTCPSACKEnabled(bool) error

SetTCPSACKEnabled implements inet.Stack.SetTCPSACKEnabled.

func (*Stack) SetTCPSendBufferSize

func (s *Stack) SetTCPSendBufferSize(size inet.TCPBufferSize) error

SetTCPSendBufferSize implements inet.Stack.SetTCPSendBufferSize.

func (*Stack) Statistics

func (s *Stack) Statistics(stat interface{}, arg string) error

Statistics implements inet.Stack.Statistics.

func (*Stack) SupportsIPv6

func (s *Stack) SupportsIPv6() bool

SupportsIPv6 implements inet.Stack.SupportsIPv6.

func (*Stack) TCPReceiveBufferSize

func (s *Stack) TCPReceiveBufferSize() (inet.TCPBufferSize, error)

TCPReceiveBufferSize implements inet.Stack.TCPReceiveBufferSize.

func (*Stack) TCPRecovery

func (s *Stack) TCPRecovery() (inet.TCPLossRecovery, error)

TCPRecovery implements inet.Stack.TCPRecovery.

func (*Stack) TCPSACKEnabled

func (s *Stack) TCPSACKEnabled() (bool, error)

TCPSACKEnabled implements inet.Stack.TCPSACKEnabled.

func (*Stack) TCPSendBufferSize

func (s *Stack) TCPSendBufferSize() (inet.TCPBufferSize, error)

TCPSendBufferSize implements inet.Stack.TCPSendBufferSize.

Jump to

Keyboard shortcuts

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