package socket

Import Path
	golang.org/x/net/internal/socket (on go.dev)

Dependency Relation
	imports 11 packages, and imported by 2 packages


Package-Level Type Names (total 4)
/* sort by: | */
A Conn represents a raw connection. RecvMsg wraps recvmsg system call. The provided flags is a set of platform-dependent flags, such as syscall.MSG_PEEK. RecvMsgs wraps recvmmsg system call. It returns the number of processed messages. The provided flags is a set of platform-dependent flags, such as syscall.MSG_PEEK. Only Linux supports this. SendMsg wraps sendmsg system call. The provided flags is a set of platform-dependent flags, such as syscall.MSG_DONTROUTE. SendMsgs wraps sendmmsg system call. It returns the number of processed messages. The provided flags is a set of platform-dependent flags, such as syscall.MSG_DONTROUTE. Only Linux supports this. func NewConn(c net.Conn) (*Conn, error) func (*Option).Get(c *Conn, b []byte) (int, error) func (*Option).GetInt(c *Conn) (int, error) func (*Option).Set(c *Conn, b []byte) error func (*Option).SetInt(c *Conn, v int) error
A ControlMessage represents the head message in a stream of control messages. A control message comprises of a header, data and a few padding fields to conform to the interface to the kernel. See RFC 3542 for further information. Data returns the data field of the control message at the head on m. Marshal marshals the control message at the head on m, and returns the next control message. MarshalHeader marshals the header fields of the control message at the head on m. Next returns the control message at the next on m. Next works only for standard control messages. Parse parses m as a single or multiple control messages. Parse works for both standard and compatible messages. ParseHeader parses and returns the header fields of the control message at the head on m. func NewControlMessage(dataLen []int) ControlMessage func ControlMessage.Marshal(lvl, typ int, data []byte) (ControlMessage, error) func ControlMessage.Next(dataLen int) ControlMessage func ControlMessage.Parse() ([]ControlMessage, error)
A Message represents an IO message. Addr specifies a destination address when writing. It can be nil when the underlying protocol of the raw connection uses connection-oriented communication. After a successful read, it may contain the source address on the received packet. When writing, the Buffers field must contain at least one byte to write. When reading, the Buffers field will always contain a byte to read. // protocol-specific information on the received message // # of bytes read or written from/to Buffers // # of bytes read or written from/to OOB OOB contains protocol-specific control or miscellaneous ancillary data known as out-of-band data. func (*Conn).RecvMsg(m *Message, flags int) error func (*Conn).RecvMsgs(ms []Message, flags int) (int, error) func (*Conn).SendMsg(m *Message, flags int) error func (*Conn).SendMsgs(ms []Message, flags int) (int, error)
An Option represents a sticky socket option. // length of value in bytes; must be equal or greater than 1 // level // name; must be equal or greater than 1 Get reads a value for the option from the kernel. It returns the number of bytes written into b. GetInt returns an integer value for the option. The Len field of Option must be either 1 or 4. Set writes the option and value to the kernel. SetInt writes the option and value to the kernel. The Len field of Option must be either 1 or 4.
Package-Level Functions (total 3)
ControlMessageSpace returns the whole length of control message.
NewConn returns a new raw connection.
NewControlMessage returns a new stream of control messages.
Package-Level Variables (only one)
NativeEndian is the machine native endian implementation of ByteOrder.