package
0.0.0-20240720002214-37b2b8227b91
Repository: https://github.com/progrium/go-netstack.git
Documentation: pkg.go.dev

# Packages

Package control provides internal representations of socket control messages.
Package hostinet implements AF_INET and AF_INET6 sockets using the host's network stack.
Package netfilter helps the sentry interact with netstack's netfilter capabilities.
Package netlink provides core functionality for netlink sockets.
Package netstack provides an implementation of the socket.Socket interface that is backed by a tcpip.Endpoint.
Package unix provides an implementation of the socket.Socket interface for the AF_UNIX protocol family.

# Functions

AddressAndFamily reads an sockaddr struct from the given address and converts it to the FullAddress format.
BytesToIPAddress converts an IPv4 or IPv6 address from the user to the netstack representation taking any addresses into account.
ConvertAddress converts the given address to a native format.
Htons converts a 16-bit number from host byte order to network byte order.
IsICMP returns true if the socket is an ICMP socket.
IsRaw returns true if the socket is a raw socket.
IsTCP returns true if the socket is a TCP socket.
IsUDP returns true if the socket is a UDP socket.
New creates a new socket with the given family, type and protocol.
NewIPControlMessages converts the tcpip.ReceivableControlMessages (which does not have Linux specific format) to Linux format.
Ntohs converts a 16-bit number from network byte order to host byte order.
Pair creates a new connected socket pair with the given family, type and protocol.
RegisterProvider registers the provider of a given address family so that sockets of that type can be created via socket() and/or socketpair() syscalls.
UnmarshalSockAddr unmarshals memory representing a struct sockaddr to one of the ABI socket address types.

# Structs

ControlMessages represents the union of unix control messages and tcpip control messages.
IPControlMessages contains socket control messages for IP sockets.
SendReceiveTimeout stores timeouts for send and receive calls.

# Interfaces

Provider is the interface implemented by providers of sockets for specific address families (e.g., AF_INET).
Socket is an interface containing socket syscalls used by the syscall layer to redirect them to the appropriate implementation.