lif

Imports

Imports #

"syscall"
"syscall"
"unsafe"
"unsafe"
"syscall"
"unsafe"
"errors"
"syscall"
"unsafe"

Constants & Variables

bigEndian var #

var bigEndian binaryBigEndian

littleEndian var #

var littleEndian binaryLittleEndian

nativeEndian var #

var nativeEndian binaryByteOrder

procIoctl var #

var procIoctl uintptr

sizeofLifIfinfoReq const #

const sizeofLifIfinfoReq = 0x10

sizeofLifconf const #

const sizeofLifconf = 0x18

sizeofLifnum const #

const sizeofLifnum = 0xc

sizeofLifreq const #

const sizeofLifreq = 0x178

sysLIFC_ALLZONES const #

const sysLIFC_ALLZONES = 0x8

sysLIFC_ENABLED const #

const sysLIFC_ENABLED = 0x20

sysLIFC_EXTERNAL_SOURCE const #

const sysLIFC_EXTERNAL_SOURCE = 0x2

sysLIFC_NOXMIT const #

const sysLIFC_NOXMIT = 0x1

sysLIFC_TEMPORARY const #

const sysLIFC_TEMPORARY = 0x4

sysLIFC_UNDER_IPMP const #

const sysLIFC_UNDER_IPMP = 0x10

Interfaces

Addr interface #

An Addr represents an address associated with packet routing.

type Addr interface {
Family() int
}

binaryByteOrder interface #

type binaryByteOrder interface {
Uint16([]byte) uint16
Uint32([]byte) uint32
Uint64([]byte) uint64
PutUint16([]byte, uint16)
PutUint32([]byte, uint32)
PutUint64([]byte, uint64)
}

Structs

Inet4Addr struct #

An Inet4Addr represents an internet address for IPv4.

type Inet4Addr struct {
IP [4]byte
PrefixLen int
}

Inet6Addr struct #

An Inet6Addr represents an internet address for IPv6.

type Inet6Addr struct {
IP [16]byte
PrefixLen int
ZoneID int
}

binaryBigEndian struct #

type binaryBigEndian struct {

}

binaryLittleEndian struct #

type binaryLittleEndian struct {

}

endpoint struct #

type endpoint struct {
af int
s uintptr
}

lifIfinfoReq struct #

type lifIfinfoReq struct {
Maxhops uint8
Pad_cgo_0 [3]byte
Reachtime uint32
Reachretrans uint32
Maxmtu uint32
}

lifconf struct #

type lifconf struct {
Family uint16
Pad_cgo_0 [2]byte
Flags int32
Len int32
Pad_cgo_1 [4]byte
Lifcu [8]byte
}

lifnum struct #

type lifnum struct {
Family uint16
Pad_cgo_0 [2]byte
Flags int32
Count int32
}

lifreq struct #

type lifreq struct {
Name [32]int8
Lifru1 [4]byte
Type uint32
Lifru [336]byte
}

sockaddrStorage struct #

type sockaddrStorage struct {
Family uint16
X_ss_pad1 [6]int8
X_ss_align float64
X_ss_pad2 [240]int8
}

Functions

Addrs function #

Addrs returns a list of interface addresses. The provided af must be an address family and name must be a data link name. The zero value of af or name means a wildcard.

func Addrs(af int, name string) ([]Addr, error)

Family method #

Family implements the Family method of Addr interface.

func (a *Inet6Addr) Family() int

Family method #

Family implements the Family method of Addr interface.

func (a *Inet4Addr) Family() int

PutUint16 method #

func (binaryLittleEndian) PutUint16(b []byte, v uint16)

PutUint16 method #

func (binaryBigEndian) PutUint16(b []byte, v uint16)

PutUint32 method #

func (binaryLittleEndian) PutUint32(b []byte, v uint32)

PutUint32 method #

func (binaryBigEndian) PutUint32(b []byte, v uint32)

PutUint64 method #

func (binaryLittleEndian) PutUint64(b []byte, v uint64)

PutUint64 method #

func (binaryBigEndian) PutUint64(b []byte, v uint64)

Uint16 method #

func (binaryLittleEndian) Uint16(b []byte) uint16

Uint16 method #

func (binaryBigEndian) Uint16(b []byte) uint16

Uint32 method #

func (binaryBigEndian) Uint32(b []byte) uint32

Uint32 method #

func (binaryLittleEndian) Uint32(b []byte) uint32

Uint64 method #

func (binaryBigEndian) Uint64(b []byte) uint64

Uint64 method #

func (binaryLittleEndian) Uint64(b []byte) uint64

close method #

func (ep *endpoint) close() error

fetch method #

func (ll *Link) fetch(s uintptr)

init function #

func init()

ioctl function #

func ioctl(s uintptr, ioc uintptr, arg unsafe.Pointer) error

newEndpoints function #

func newEndpoints(af int) ([]endpoint, error)

parseLinkAddr function #

func parseLinkAddr(b []byte) ([]byte, error)

sysvicall6 function #

func sysvicall6(trap uintptr, nargs uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (uintptr, uintptr, syscall.Errno)

Generated with Arrow