socket

package
v0.0.0-...-9d117f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControlMessageSpace

func ControlMessageSpace(dataLen int) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL