Documentation ¶
Overview ¶
Package netstack provides an implementation of the socket.Socket interface that is backed by a tcpip.Endpoint.
It does not depend on any particular endpoint implementation, and thus can be used to expose certain endpoints to the sentry while leaving others out, for example, TCP endpoints and Unix-domain endpoints.
Lock ordering: netstack => mm: ioSequencePayload copies user memory inside tcpip.Endpoint.Write(). Netstack is allowed to (and does) hold locks during this operation.
Index ¶
- Constants
- Variables
- func AddressAndFamily(sfamily int, addr []byte, strict bool) (tcpip.FullAddress, uint16, *syserr.Error)
- func ConvertAddress(family int, addr tcpip.FullAddress) (linux.SockAddr, uint32)
- func ConvertShutdown(how int) (tcpip.ShutdownFlags, *syserr.Error)
- func GetSockOpt(t *kernel.Task, s socket.Socket, ep commonEndpoint, family int, ...) (interface{}, *syserr.Error)
- func Ioctl(ctx context.Context, ep commonEndpoint, io usermem.IO, ...) (uintptr, error)
- func New(t *kernel.Task, family int, skType linux.SockType, protocol int, ...) (*fs.File, *syserr.Error)
- func SetSockOpt(t *kernel.Task, s socket.Socket, ep commonEndpoint, level int, name int, ...) *syserr.Error
- type SocketOperations
- func (s *SocketOperations) Accept(t *kernel.Task, peerRequested bool, flags int, blocking bool) (int32, linux.SockAddr, uint32, *syserr.Error)
- func (s *SocketOperations) Bind(t *kernel.Task, sockaddr []byte) *syserr.Error
- func (s *SocketOperations) Connect(t *kernel.Task, sockaddr []byte, blocking bool) *syserr.Error
- func (s *SocketOperations) GetPeerName(t *kernel.Task) (linux.SockAddr, uint32, *syserr.Error)
- func (s *SocketOperations) GetSockName(t *kernel.Task) (linux.SockAddr, uint32, *syserr.Error)
- func (s *SocketOperations) GetSockOpt(t *kernel.Task, level, name int, outPtr usermem.Addr, outLen int) (interface{}, *syserr.Error)
- func (s *SocketOperations) Ioctl(ctx context.Context, _ *fs.File, io usermem.IO, args arch.SyscallArguments) (uintptr, error)
- func (s *SocketOperations) Listen(t *kernel.Task, backlog int) *syserr.Error
- func (s *SocketOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, _ int64) (int64, error)
- func (s *SocketOperations) ReadFrom(ctx context.Context, _ *fs.File, r io.Reader, count int64) (int64, error)
- func (s *SocketOperations) Readiness(mask waiter.EventMask) waiter.EventMask
- func (s *SocketOperations) RecvMsg(t *kernel.Task, dst usermem.IOSequence, flags int, haveDeadline bool, ...) (n int, msgFlags int, senderAddr linux.SockAddr, senderAddrLen uint32, ...)
- func (s *SocketOperations) Release()
- func (s *SocketOperations) SendMsg(t *kernel.Task, src usermem.IOSequence, to []byte, flags int, ...) (int, *syserr.Error)
- func (s *SocketOperations) SetSockOpt(t *kernel.Task, level int, name int, optVal []byte) *syserr.Error
- func (s *SocketOperations) Shutdown(t *kernel.Task, how int) *syserr.Error
- func (s *SocketOperations) State() uint32
- func (s *SocketOperations) Type() (family int, skType linux.SockType, protocol int)
- func (s *SocketOperations) Write(ctx context.Context, _ *fs.File, src usermem.IOSequence, _ int64) (int64, error)
- func (s *SocketOperations) WriteTo(ctx context.Context, _ *fs.File, dst io.Writer, count int64, dup bool) (int64, error)
- type Stack
- func (s *Stack) CleanupEndpoints() []stack.TransportEndpoint
- func (s *Stack) FillDefaultIPTables()
- func (s *Stack) IPTables() (iptables.IPTables, error)
- func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr
- func (s *Stack) Interfaces() map[int32]inet.Interface
- func (s *Stack) RegisteredEndpoints() []stack.TransportEndpoint
- func (s *Stack) RestoreCleanupEndpoints(es []stack.TransportEndpoint)
- func (s *Stack) Resume()
- func (s *Stack) RouteTable() []inet.Route
- func (s *Stack) SetTCPReceiveBufferSize(size inet.TCPBufferSize) error
- func (s *Stack) SetTCPSACKEnabled(enabled bool) error
- func (s *Stack) SetTCPSendBufferSize(size 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) TCPSACKEnabled() (bool, error)
- func (s *Stack) TCPSendBufferSize() (inet.TCPBufferSize, error)
Constants ¶
const DefaultTTL = 64
DefaultTTL is linux's default TTL. All network protocols in all stacks used with this package must have this value set as their default TTL.
Variables ¶
var Metrics = tcpip.Stats{ UnknownProtocolRcvdPackets: mustCreateMetric("/netstack/unknown_protocol_received_packets", "Number of packets received by netstack that were for an unknown or unsupported protocol."), MalformedRcvdPackets: mustCreateMetric("/netstack/malformed_received_packets", "Number of packets received by netstack that were deemed malformed."), DroppedPackets: mustCreateMetric("/netstack/dropped_packets", "Number of packets dropped by netstack due to full queues."), ICMP: tcpip.ICMPStats{ V4PacketsSent: tcpip.ICMPv4SentPacketStats{ ICMPv4PacketStats: tcpip.ICMPv4PacketStats{ Echo: mustCreateMetric("/netstack/icmp/v4/packets_sent/echo", "Total number of ICMPv4 echo packets sent by netstack."), EchoReply: mustCreateMetric("/netstack/icmp/v4/packets_sent/echo_reply", "Total number of ICMPv4 echo reply packets sent by netstack."), DstUnreachable: mustCreateMetric("/netstack/icmp/v4/packets_sent/dst_unreachable", "Total number of ICMPv4 destination unreachable packets sent by netstack."), SrcQuench: mustCreateMetric("/netstack/icmp/v4/packets_sent/src_quench", "Total number of ICMPv4 source quench packets sent by netstack."), Redirect: mustCreateMetric("/netstack/icmp/v4/packets_sent/redirect", "Total number of ICMPv4 redirect packets sent by netstack."), TimeExceeded: mustCreateMetric("/netstack/icmp/v4/packets_sent/time_exceeded", "Total number of ICMPv4 time exceeded packets sent by netstack."), ParamProblem: mustCreateMetric("/netstack/icmp/v4/packets_sent/param_problem", "Total number of ICMPv4 parameter problem packets sent by netstack."), Timestamp: mustCreateMetric("/netstack/icmp/v4/packets_sent/timestamp", "Total number of ICMPv4 timestamp packets sent by netstack."), TimestampReply: mustCreateMetric("/netstack/icmp/v4/packets_sent/timestamp_reply", "Total number of ICMPv4 timestamp reply packets sent by netstack."), InfoRequest: mustCreateMetric("/netstack/icmp/v4/packets_sent/info_request", "Total number of ICMPv4 information request packets sent by netstack."), InfoReply: mustCreateMetric("/netstack/icmp/v4/packets_sent/info_reply", "Total number of ICMPv4 information reply packets sent by netstack."), }, Dropped: mustCreateMetric("/netstack/icmp/v4/packets_sent/dropped", "Total number of ICMPv4 packets dropped by netstack due to link layer errors."), }, V4PacketsReceived: tcpip.ICMPv4ReceivedPacketStats{ ICMPv4PacketStats: tcpip.ICMPv4PacketStats{ Echo: mustCreateMetric("/netstack/icmp/v4/packets_received/echo", "Total number of ICMPv4 echo packets received by netstack."), EchoReply: mustCreateMetric("/netstack/icmp/v4/packets_received/echo_reply", "Total number of ICMPv4 echo reply packets received by netstack."), DstUnreachable: mustCreateMetric("/netstack/icmp/v4/packets_received/dst_unreachable", "Total number of ICMPv4 destination unreachable packets received by netstack."), SrcQuench: mustCreateMetric("/netstack/icmp/v4/packets_received/src_quench", "Total number of ICMPv4 source quench packets received by netstack."), Redirect: mustCreateMetric("/netstack/icmp/v4/packets_received/redirect", "Total number of ICMPv4 redirect packets received by netstack."), TimeExceeded: mustCreateMetric("/netstack/icmp/v4/packets_received/time_exceeded", "Total number of ICMPv4 time exceeded packets received by netstack."), ParamProblem: mustCreateMetric("/netstack/icmp/v4/packets_received/param_problem", "Total number of ICMPv4 parameter problem packets received by netstack."), Timestamp: mustCreateMetric("/netstack/icmp/v4/packets_received/timestamp", "Total number of ICMPv4 timestamp packets received by netstack."), TimestampReply: mustCreateMetric("/netstack/icmp/v4/packets_received/timestamp_reply", "Total number of ICMPv4 timestamp reply packets received by netstack."), InfoRequest: mustCreateMetric("/netstack/icmp/v4/packets_received/info_request", "Total number of ICMPv4 information request packets received by netstack."), InfoReply: mustCreateMetric("/netstack/icmp/v4/packets_received/info_reply", "Total number of ICMPv4 information reply packets received by netstack."), }, Invalid: mustCreateMetric("/netstack/icmp/v4/packets_received/invalid", "Total number of ICMPv4 packets received that the transport layer could not parse."), }, V6PacketsSent: tcpip.ICMPv6SentPacketStats{ ICMPv6PacketStats: tcpip.ICMPv6PacketStats{ EchoRequest: mustCreateMetric("/netstack/icmp/v6/packets_sent/echo_request", "Total number of ICMPv6 echo request packets sent by netstack."), EchoReply: mustCreateMetric("/netstack/icmp/v6/packets_sent/echo_reply", "Total number of ICMPv6 echo reply packets sent by netstack."), DstUnreachable: mustCreateMetric("/netstack/icmp/v6/packets_sent/dst_unreachable", "Total number of ICMPv6 destination unreachable packets sent by netstack."), PacketTooBig: mustCreateMetric("/netstack/icmp/v6/packets_sent/packet_too_big", "Total number of ICMPv6 packet too big packets sent by netstack."), TimeExceeded: mustCreateMetric("/netstack/icmp/v6/packets_sent/time_exceeded", "Total number of ICMPv6 time exceeded packets sent by netstack."), ParamProblem: mustCreateMetric("/netstack/icmp/v6/packets_sent/param_problem", "Total number of ICMPv6 parameter problem packets sent by netstack."), RouterSolicit: mustCreateMetric("/netstack/icmp/v6/packets_sent/router_solicit", "Total number of ICMPv6 router solicit packets sent by netstack."), RouterAdvert: mustCreateMetric("/netstack/icmp/v6/packets_sent/router_advert", "Total number of ICMPv6 router advert packets sent by netstack."), NeighborSolicit: mustCreateMetric("/netstack/icmp/v6/packets_sent/neighbor_solicit", "Total number of ICMPv6 neighbor solicit packets sent by netstack."), NeighborAdvert: mustCreateMetric("/netstack/icmp/v6/packets_sent/neighbor_advert", "Total number of ICMPv6 neighbor advert packets sent by netstack."), RedirectMsg: mustCreateMetric("/netstack/icmp/v6/packets_sent/redirect_msg", "Total number of ICMPv6 redirect message packets sent by netstack."), }, Dropped: mustCreateMetric("/netstack/icmp/v6/packets_sent/dropped", "Total number of ICMPv6 packets dropped by netstack due to link layer errors."), }, V6PacketsReceived: tcpip.ICMPv6ReceivedPacketStats{ ICMPv6PacketStats: tcpip.ICMPv6PacketStats{ EchoRequest: mustCreateMetric("/netstack/icmp/v6/packets_received/echo_request", "Total number of ICMPv6 echo request packets received by netstack."), EchoReply: mustCreateMetric("/netstack/icmp/v6/packets_received/echo_reply", "Total number of ICMPv6 echo reply packets received by netstack."), DstUnreachable: mustCreateMetric("/netstack/icmp/v6/packets_received/dst_unreachable", "Total number of ICMPv6 destination unreachable packets received by netstack."), PacketTooBig: mustCreateMetric("/netstack/icmp/v6/packets_received/packet_too_big", "Total number of ICMPv6 packet too big packets received by netstack."), TimeExceeded: mustCreateMetric("/netstack/icmp/v6/packets_received/time_exceeded", "Total number of ICMPv6 time exceeded packets received by netstack."), ParamProblem: mustCreateMetric("/netstack/icmp/v6/packets_received/param_problem", "Total number of ICMPv6 parameter problem packets received by netstack."), RouterSolicit: mustCreateMetric("/netstack/icmp/v6/packets_received/router_solicit", "Total number of ICMPv6 router solicit packets received by netstack."), RouterAdvert: mustCreateMetric("/netstack/icmp/v6/packets_received/router_advert", "Total number of ICMPv6 router advert packets received by netstack."), NeighborSolicit: mustCreateMetric("/netstack/icmp/v6/packets_received/neighbor_solicit", "Total number of ICMPv6 neighbor solicit packets received by netstack."), NeighborAdvert: mustCreateMetric("/netstack/icmp/v6/packets_received/neighbor_advert", "Total number of ICMPv6 neighbor advert packets received by netstack."), RedirectMsg: mustCreateMetric("/netstack/icmp/v6/packets_received/redirect_msg", "Total number of ICMPv6 redirect message packets received by netstack."), }, Invalid: mustCreateMetric("/netstack/icmp/v6/packets_received/invalid", "Total number of ICMPv6 packets received that the transport layer could not parse."), }, }, IP: tcpip.IPStats{ PacketsReceived: mustCreateMetric("/netstack/ip/packets_received", "Total number of IP packets received from the link layer in nic.DeliverNetworkPacket."), InvalidAddressesReceived: mustCreateMetric("/netstack/ip/invalid_addresses_received", "Total number of IP packets received with an unknown or invalid destination address."), PacketsDelivered: mustCreateMetric("/netstack/ip/packets_delivered", "Total number of incoming IP packets that are successfully delivered to the transport layer via HandlePacket."), PacketsSent: mustCreateMetric("/netstack/ip/packets_sent", "Total number of IP packets sent via WritePacket."), OutgoingPacketErrors: mustCreateMetric("/netstack/ip/outgoing_packet_errors", "Total number of IP packets which failed to write to a link-layer endpoint."), MalformedPacketsReceived: mustCreateMetric("/netstack/ip/malformed_packets_received", "Total number of IP packets which failed IP header validation checks."), MalformedFragmentsReceived: mustCreateMetric("/netstack/ip/malformed_fragments_received", "Total number of IP fragments which failed IP fragment validation checks."), }, TCP: tcpip.TCPStats{ ActiveConnectionOpenings: mustCreateMetric("/netstack/tcp/active_connection_openings", "Number of connections opened successfully via Connect."), PassiveConnectionOpenings: mustCreateMetric("/netstack/tcp/passive_connection_openings", "Number of connections opened successfully via Listen."), CurrentEstablished: mustCreateMetric("/netstack/tcp/current_established", "Number of connections in either ESTABLISHED or CLOSE-WAIT state now."), EstablishedResets: mustCreateMetric("/netstack/tcp/established_resets", "Number of times TCP connections have made a direct transition to the CLOSED state from either the ESTABLISHED state or the CLOSE-WAIT state"), EstablishedClosed: mustCreateMetric("/netstack/tcp/established_closed", "number of times established TCP connections made a transition to CLOSED state."), EstablishedTimedout: mustCreateMetric("/netstack/tcp/established_timedout", "Number of times an established connection was reset because of keep-alive time out."), ListenOverflowSynDrop: mustCreateMetric("/netstack/tcp/listen_overflow_syn_drop", "Number of times the listen queue overflowed and a SYN was dropped."), ListenOverflowAckDrop: mustCreateMetric("/netstack/tcp/listen_overflow_ack_drop", "Number of times the listen queue overflowed and the final ACK in the handshake was dropped."), ListenOverflowSynCookieSent: mustCreateMetric("/netstack/tcp/listen_overflow_syn_cookie_sent", "Number of times a SYN cookie was sent."), ListenOverflowSynCookieRcvd: mustCreateMetric("/netstack/tcp/listen_overflow_syn_cookie_rcvd", "Number of times a SYN cookie was received."), ListenOverflowInvalidSynCookieRcvd: mustCreateMetric("/netstack/tcp/listen_overflow_invalid_syn_cookie_rcvd", "Number of times an invalid SYN cookie was received."), FailedConnectionAttempts: mustCreateMetric("/netstack/tcp/failed_connection_attempts", "Number of calls to Connect or Listen (active and passive openings, respectively) that end in an error."), ValidSegmentsReceived: mustCreateMetric("/netstack/tcp/valid_segments_received", "Number of TCP segments received that the transport layer successfully parsed."), InvalidSegmentsReceived: mustCreateMetric("/netstack/tcp/invalid_segments_received", "Number of TCP segments received that the transport layer could not parse."), SegmentsSent: mustCreateMetric("/netstack/tcp/segments_sent", "Number of TCP segments sent."), SegmentSendErrors: mustCreateMetric("/netstack/tcp/segment_send_errors", "Number of TCP segments failed to be sent."), ResetsSent: mustCreateMetric("/netstack/tcp/resets_sent", "Number of TCP resets sent."), ResetsReceived: mustCreateMetric("/netstack/tcp/resets_received", "Number of TCP resets received."), Retransmits: mustCreateMetric("/netstack/tcp/retransmits", "Number of TCP segments retransmitted."), FastRecovery: mustCreateMetric("/netstack/tcp/fast_recovery", "Number of times fast recovery was used to recover from packet loss."), SACKRecovery: mustCreateMetric("/netstack/tcp/sack_recovery", "Number of times SACK recovery was used to recover from packet loss."), SlowStartRetransmits: mustCreateMetric("/netstack/tcp/slow_start_retransmits", "Number of segments retransmitted in slow start mode."), FastRetransmit: mustCreateMetric("/netstack/tcp/fast_retransmit", "Number of TCP segments which were fast retransmitted."), Timeouts: mustCreateMetric("/netstack/tcp/timeouts", "Number of times RTO expired."), ChecksumErrors: mustCreateMetric("/netstack/tcp/checksum_errors", "Number of segments dropped due to bad checksums."), }, UDP: tcpip.UDPStats{ PacketsReceived: mustCreateMetric("/netstack/udp/packets_received", "Number of UDP datagrams received via HandlePacket."), UnknownPortErrors: mustCreateMetric("/netstack/udp/unknown_port_errors", "Number of incoming UDP datagrams dropped because they did not have a known destination port."), ReceiveBufferErrors: mustCreateMetric("/netstack/udp/receive_buffer_errors", "Number of incoming UDP datagrams dropped due to the receiving buffer being in an invalid state."), MalformedPacketsReceived: mustCreateMetric("/netstack/udp/malformed_packets_received", "Number of incoming UDP datagrams dropped due to the UDP header being in a malformed state."), PacketsSent: mustCreateMetric("/netstack/udp/packets_sent", "Number of UDP datagrams sent."), PacketSendErrors: mustCreateMetric("/netstack/udp/packet_send_errors", "Number of UDP datagrams failed to be sent."), }, }
Metrics contains metrics exported by netstack.
Functions ¶
func AddressAndFamily ¶
func AddressAndFamily(sfamily int, addr []byte, strict bool) (tcpip.FullAddress, uint16, *syserr.Error)
AddressAndFamily reads an sockaddr struct from the given address and converts it to the FullAddress format. It supports AF_UNIX, AF_INET, AF_INET6, and AF_PACKET addresses.
strict indicates whether addresses with the AF_UNSPEC family are accepted of not.
AddressAndFamily returns an address and its family.
func ConvertAddress ¶
ConvertAddress converts the given address to a native format.
func ConvertShutdown ¶
func ConvertShutdown(how int) (tcpip.ShutdownFlags, *syserr.Error)
ConvertShutdown converts Linux shutdown flags into tcpip shutdown flags.
func GetSockOpt ¶
func GetSockOpt(t *kernel.Task, s socket.Socket, ep commonEndpoint, family int, skType linux.SockType, level, name, outLen int) (interface{}, *syserr.Error)
GetSockOpt can be used to implement the linux syscall getsockopt(2) for sockets backed by a commonEndpoint.
func Ioctl ¶
func Ioctl(ctx context.Context, ep commonEndpoint, io usermem.IO, args arch.SyscallArguments) (uintptr, error)
Ioctl performs a socket ioctl.
Types ¶
type SocketOperations ¶
type SocketOperations struct { fsutil.FilePipeSeek `state:"nosave"` fsutil.FileNotDirReaddir `state:"nosave"` fsutil.FileNoopFlush `state:"nosave"` fsutil.FileNoFsync `state:"nosave"` fsutil.FileNoMMap `state:"nosave"` fsutil.FileUseInodeUnstableAttr `state:"nosave"` socket.SendReceiveTimeout *waiter.Queue Endpoint tcpip.Endpoint // contains filtered or unexported fields }
SocketOperations encapsulates all the state needed to represent a network stack endpoint in the kernel context.
+stateify savable
func (*SocketOperations) Accept ¶
func (s *SocketOperations) Accept(t *kernel.Task, peerRequested bool, flags int, blocking bool) (int32, linux.SockAddr, uint32, *syserr.Error)
Accept implements the linux syscall accept(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Bind ¶
Bind implements the linux syscall bind(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Connect ¶
Connect implements the linux syscall connect(2) for sockets backed by tpcip.Endpoint.
func (*SocketOperations) GetPeerName ¶
GetPeerName implements the linux syscall getpeername(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) GetSockName ¶
GetSockName implements the linux syscall getsockname(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) GetSockOpt ¶
func (s *SocketOperations) GetSockOpt(t *kernel.Task, level, name int, outPtr usermem.Addr, outLen int) (interface{}, *syserr.Error)
GetSockOpt implements the linux syscall getsockopt(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Ioctl ¶
func (s *SocketOperations) Ioctl(ctx context.Context, _ *fs.File, io usermem.IO, args arch.SyscallArguments) (uintptr, error)
Ioctl implements fs.FileOperations.Ioctl.
func (*SocketOperations) Listen ¶
Listen implements the linux syscall listen(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Read ¶
func (s *SocketOperations) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, _ int64) (int64, error)
Read implements fs.FileOperations.Read.
func (*SocketOperations) ReadFrom ¶
func (s *SocketOperations) ReadFrom(ctx context.Context, _ *fs.File, r io.Reader, count int64) (int64, error)
ReadFrom implements fs.FileOperations.ReadFrom.
func (*SocketOperations) Readiness ¶
func (s *SocketOperations) Readiness(mask waiter.EventMask) waiter.EventMask
Readiness returns a mask of ready events for socket s.
func (*SocketOperations) RecvMsg ¶
func (s *SocketOperations) RecvMsg(t *kernel.Task, dst usermem.IOSequence, flags int, haveDeadline bool, deadline ktime.Time, senderRequested bool, controlDataLen uint64) (n int, msgFlags int, senderAddr linux.SockAddr, senderAddrLen uint32, controlMessages socket.ControlMessages, err *syserr.Error)
RecvMsg implements the linux syscall recvmsg(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Release ¶
func (s *SocketOperations) Release()
Release implements fs.FileOperations.Release.
func (*SocketOperations) SendMsg ¶
func (s *SocketOperations) SendMsg(t *kernel.Task, src usermem.IOSequence, to []byte, flags int, haveDeadline bool, deadline ktime.Time, controlMessages socket.ControlMessages) (int, *syserr.Error)
SendMsg implements the linux syscall sendmsg(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) SetSockOpt ¶
func (s *SocketOperations) SetSockOpt(t *kernel.Task, level int, name int, optVal []byte) *syserr.Error
SetSockOpt implements the linux syscall setsockopt(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) Shutdown ¶
Shutdown implements the linux syscall shutdown(2) for sockets backed by tcpip.Endpoint.
func (*SocketOperations) State ¶
func (s *SocketOperations) State() uint32
State implements socket.Socket.State. State translates the internal state returned by netstack to values defined by Linux.
func (*SocketOperations) Type ¶
func (s *SocketOperations) Type() (family int, skType linux.SockType, protocol int)
Type implements socket.Socket.Type.
type Stack ¶
Stack implements inet.Stack for netstack/tcpip/stack.Stack.
+stateify savable
func (*Stack) CleanupEndpoints ¶
func (s *Stack) CleanupEndpoints() []stack.TransportEndpoint
CleanupEndpoints implements inet.Stack.CleanupEndpoints.
func (*Stack) FillDefaultIPTables ¶
func (s *Stack) FillDefaultIPTables()
FillDefaultIPTables sets the stack's iptables to the default tables, which allow and do not modify all traffic.
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 (s *Stack) RegisteredEndpoints() []stack.TransportEndpoint
RegisteredEndpoints implements inet.Stack.RegisteredEndpoints.
func (*Stack) RestoreCleanupEndpoints ¶
func (s *Stack) RestoreCleanupEndpoints(es []stack.TransportEndpoint)
RestoreCleanupEndpoints implements inet.Stack.RestoreCleanupEndpoints.
func (*Stack) RouteTable ¶
RouteTable implements inet.Stack.RouteTable.
func (*Stack) SetTCPReceiveBufferSize ¶
func (s *Stack) SetTCPReceiveBufferSize(size inet.TCPBufferSize) error
SetTCPReceiveBufferSize implements inet.Stack.SetTCPReceiveBufferSize.
func (*Stack) SetTCPSACKEnabled ¶
SetTCPSACKEnabled implements inet.Stack.SetTCPSACKEnabled.
func (*Stack) SetTCPSendBufferSize ¶
func (s *Stack) SetTCPSendBufferSize(size inet.TCPBufferSize) error
SetTCPSendBufferSize implements inet.Stack.SetTCPSendBufferSize.
func (*Stack) Statistics ¶
Statistics implements inet.Stack.Statistics.
func (*Stack) SupportsIPv6 ¶
SupportsIPv6 implements Stack.SupportsIPv6.
func (*Stack) TCPReceiveBufferSize ¶
func (s *Stack) TCPReceiveBufferSize() (inet.TCPBufferSize, error)
TCPReceiveBufferSize implements inet.Stack.TCPReceiveBufferSize.
func (*Stack) TCPSACKEnabled ¶
TCPSACKEnabled implements inet.Stack.TCPSACKEnabled.
func (*Stack) TCPSendBufferSize ¶
func (s *Stack) TCPSendBufferSize() (inet.TCPBufferSize, error)
TCPSendBufferSize implements inet.Stack.TCPSendBufferSize.