Documentation ¶
Overview ¶
Package hostinet implements AF_INET and AF_INET6 sockets using the host's network stack.
Index ¶
- func ExtractHostInterfaces(links []syscall.NetlinkMessage, addrs []syscall.NetlinkMessage, ...) error
- func ExtractHostRoutes(routeMsgs []syscall.NetlinkMessage) ([]inet.Route, error)
- type Stack
- func (*Stack) AddInterfaceAddr(int32, inet.InterfaceAddr) error
- func (*Stack) CleanupEndpoints() []stack.TransportEndpoint
- func (s *Stack) Configure() error
- func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr
- func (s *Stack) Interfaces() map[int32]inet.Interface
- func (*Stack) PortRange() (uint16, uint16)
- func (*Stack) RegisteredEndpoints() []stack.TransportEndpoint
- func (*Stack) RemoveInterface(int32) error
- func (*Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error
- func (*Stack) RestoreCleanupEndpoints([]stack.TransportEndpoint)
- func (*Stack) Resume()
- func (s *Stack) RouteTable() []inet.Route
- func (*Stack) SetForwarding(tcpip.NetworkProtocolNumber, bool) error
- func (*Stack) SetPortRange(uint16, uint16) error
- func (*Stack) SetTCPReceiveBufferSize(inet.TCPBufferSize) error
- func (*Stack) SetTCPRecovery(inet.TCPLossRecovery) error
- func (*Stack) SetTCPSACKEnabled(bool) error
- func (*Stack) SetTCPSendBufferSize(inet.TCPBufferSize) error
- func (s *Stack) Statistics(stat interface{}, arg string) error
- func (s *Stack) SupportsIPv6() bool
- func (s *Stack) TCPReceiveBufferSize() (inet.TCPBufferSize, error)
- func (s *Stack) TCPRecovery() (inet.TCPLossRecovery, error)
- func (s *Stack) TCPSACKEnabled() (bool, error)
- func (s *Stack) TCPSendBufferSize() (inet.TCPBufferSize, error)
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 (*Stack) AddInterfaceAddr ¶
func (*Stack) AddInterfaceAddr(int32, inet.InterfaceAddr) error
AddInterfaceAddr implements inet.Stack.AddInterfaceAddr.
func (*Stack) CleanupEndpoints ¶
func (*Stack) CleanupEndpoints() []stack.TransportEndpoint
CleanupEndpoints implements inet.Stack.CleanupEndpoints.
func (*Stack) InterfaceAddrs ¶
func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr
InterfaceAddrs implements inet.Stack.InterfaceAddrs.
func (*Stack) Interfaces ¶
Interfaces implements inet.Stack.Interfaces.
func (*Stack) RegisteredEndpoints ¶
func (*Stack) RegisteredEndpoints() []stack.TransportEndpoint
RegisteredEndpoints implements inet.Stack.RegisteredEndpoints.
func (*Stack) RemoveInterface ¶
RemoveInterface implements inet.Stack.RemoveInterface.
func (*Stack) RemoveInterfaceAddr ¶
func (*Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error
RemoveInterfaceAddr implements inet.Stack.RemoveInterfaceAddr.
func (*Stack) RestoreCleanupEndpoints ¶
func (*Stack) RestoreCleanupEndpoints([]stack.TransportEndpoint)
RestoreCleanupEndpoints implements inet.Stack.RestoreCleanupEndpoints.
func (*Stack) RouteTable ¶
RouteTable implements inet.Stack.RouteTable.
func (*Stack) SetForwarding ¶
func (*Stack) SetForwarding(tcpip.NetworkProtocolNumber, bool) error
SetForwarding implements inet.Stack.SetForwarding.
func (*Stack) SetPortRange ¶
SetPortRange implements inet.Stack.SetPortRange.
func (*Stack) SetTCPReceiveBufferSize ¶
func (*Stack) SetTCPReceiveBufferSize(inet.TCPBufferSize) error
SetTCPReceiveBufferSize implements inet.Stack.SetTCPReceiveBufferSize.
func (*Stack) SetTCPRecovery ¶
func (*Stack) SetTCPRecovery(inet.TCPLossRecovery) error
SetTCPRecovery implements inet.Stack.SetTCPRecovery.
func (*Stack) SetTCPSACKEnabled ¶
SetTCPSACKEnabled implements inet.Stack.SetTCPSACKEnabled.
func (*Stack) SetTCPSendBufferSize ¶
func (*Stack) SetTCPSendBufferSize(inet.TCPBufferSize) error
SetTCPSendBufferSize implements inet.Stack.SetTCPSendBufferSize.
func (*Stack) Statistics ¶
Statistics implements inet.Stack.Statistics.
func (*Stack) SupportsIPv6 ¶
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 ¶
TCPSACKEnabled implements inet.Stack.TCPSACKEnabled.
func (*Stack) TCPSendBufferSize ¶
func (s *Stack) TCPSendBufferSize() (inet.TCPBufferSize, error)
TCPSendBufferSize implements inet.Stack.TCPSendBufferSize.