Documentation ¶
Overview ¶
Package socket contains ControlMessage parsing code from golang.org/x/net/internal/socket. Instead of supporting all possible architectures, we're only supporting linux 32/64 bit.
Index ¶
- func ControlMessageSpace(dataLen int) int
- type ControlMessage
- func (m ControlMessage) Data(dataLen int) []byte
- func (m ControlMessage) Marshal(lvl, typ int, data []byte) (ControlMessage, error)
- func (m ControlMessage) MarshalHeader(lvl, typ, dataLen int) error
- func (m ControlMessage) Next(dataLen int) ControlMessage
- func (m ControlMessage) Parse() ([]ControlMessage, error)
- func (m ControlMessage) ParseHeader() (lvl, typ, dataLen int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlMessageSpace ¶
returns the whole length of control message.
Types ¶
type ControlMessage ¶
type ControlMessage []byte
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.
func NewControlMessage ¶
func NewControlMessage(dataLen []int) ControlMessage
NewControlMessage returns a new stream of control messages.
func (ControlMessage) Data ¶
func (m ControlMessage) Data(dataLen int) []byte
Data returns the data field of the control message at the head.
func (ControlMessage) Marshal ¶
func (m ControlMessage) Marshal(lvl, typ int, data []byte) (ControlMessage, error)
Marshal marshals the control message at the head, and returns the next control message.
func (ControlMessage) MarshalHeader ¶
func (m ControlMessage) MarshalHeader(lvl, typ, dataLen int) error
MarshalHeader marshals the header fields of the control message at the head.
func (ControlMessage) Next ¶
func (m ControlMessage) Next(dataLen int) ControlMessage
Next returns the control message at the next.
func (ControlMessage) Parse ¶
func (m ControlMessage) Parse() ([]ControlMessage, error)
Parse parses as a single or multiple control messages.
func (ControlMessage) ParseHeader ¶
func (m ControlMessage) ParseHeader() (lvl, typ, dataLen int, err error)
ParseHeader parses and returns the header fields of the control message at the head.