aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/lif
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-27 20:03:23 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-27 20:03:23 +0200
commit14bb08c1df8db9ec6c8a05520d4eee67971235d9 (patch)
treefc820e59c26ed4c5e87e65737909b47959f0faa5 /vendor/golang.org/x/net/lif
parent54eb169e8fc9bc0357139e7c259e977b184f8fbb (diff)
mod tidy
Diffstat (limited to 'vendor/golang.org/x/net/lif')
-rw-r--r--vendor/golang.org/x/net/lif/address.go105
-rw-r--r--vendor/golang.org/x/net/lif/binary.go115
-rw-r--r--vendor/golang.org/x/net/lif/defs_solaris.go90
-rw-r--r--vendor/golang.org/x/net/lif/lif.go43
-rw-r--r--vendor/golang.org/x/net/lif/link.go126
-rw-r--r--vendor/golang.org/x/net/lif/sys.go21
-rw-r--r--vendor/golang.org/x/net/lif/sys_solaris_amd64.s8
-rw-r--r--vendor/golang.org/x/net/lif/syscall.go28
-rw-r--r--vendor/golang.org/x/net/lif/zsys_solaris_amd64.go103
9 files changed, 0 insertions, 639 deletions
diff --git a/vendor/golang.org/x/net/lif/address.go b/vendor/golang.org/x/net/lif/address.go
deleted file mode 100644
index afb957f..0000000
--- a/vendor/golang.org/x/net/lif/address.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package lif
-
-import (
- "errors"
- "unsafe"
-)
-
-// An Addr represents an address associated with packet routing.
-type Addr interface {
- // Family returns an address family.
- Family() int
-}
-
-// An Inet4Addr represents an internet address for IPv4.
-type Inet4Addr struct {
- IP [4]byte // IP address
- PrefixLen int // address prefix length
-}
-
-// Family implements the Family method of Addr interface.
-func (a *Inet4Addr) Family() int { return sysAF_INET }
-
-// An Inet6Addr represents an internet address for IPv6.
-type Inet6Addr struct {
- IP [16]byte // IP address
- PrefixLen int // address prefix length
- ZoneID int // zone identifier
-}
-
-// Family implements the Family method of Addr interface.
-func (a *Inet6Addr) Family() int { return sysAF_INET6 }
-
-// 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) {
- eps, err := newEndpoints(af)
- if len(eps) == 0 {
- return nil, err
- }
- defer func() {
- for _, ep := range eps {
- ep.close()
- }
- }()
- lls, err := links(eps, name)
- if len(lls) == 0 {
- return nil, err
- }
- var as []Addr
- for _, ll := range lls {
- var lifr lifreq
- for i := 0; i < len(ll.Name); i++ {
- lifr.Name[i] = int8(ll.Name[i])
- }
- for _, ep := range eps {
- ioc := int64(sysSIOCGLIFADDR)
- err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifr))
- if err != nil {
- continue
- }
- sa := (*sockaddrStorage)(unsafe.Pointer(&lifr.Lifru[0]))
- l := int(nativeEndian.Uint32(lifr.Lifru1[:4]))
- if l == 0 {
- continue
- }
- switch sa.Family {
- case sysAF_INET:
- a := &Inet4Addr{PrefixLen: l}
- copy(a.IP[:], lifr.Lifru[4:8])
- as = append(as, a)
- case sysAF_INET6:
- a := &Inet6Addr{PrefixLen: l, ZoneID: int(nativeEndian.Uint32(lifr.Lifru[24:28]))}
- copy(a.IP[:], lifr.Lifru[8:24])
- as = append(as, a)
- }
- }
- }
- return as, nil
-}
-
-func parseLinkAddr(b []byte) ([]byte, error) {
- nlen, alen, slen := int(b[1]), int(b[2]), int(b[3])
- l := 4 + nlen + alen + slen
- if len(b) < l {
- return nil, errors.New("invalid address")
- }
- b = b[4:]
- var addr []byte
- if nlen > 0 {
- b = b[nlen:]
- }
- if alen > 0 {
- addr = make([]byte, alen)
- copy(addr, b[:alen])
- }
- return addr, nil
-}
diff --git a/vendor/golang.org/x/net/lif/binary.go b/vendor/golang.org/x/net/lif/binary.go
deleted file mode 100644
index 738a94f..0000000
--- a/vendor/golang.org/x/net/lif/binary.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package lif
-
-// This file contains duplicates of encoding/binary package.
-//
-// This package is supposed to be used by the net package of standard
-// library. Therefore the package set used in the package must be the
-// same as net package.
-
-var (
- littleEndian binaryLittleEndian
- bigEndian binaryBigEndian
-)
-
-type binaryByteOrder interface {
- Uint16([]byte) uint16
- Uint32([]byte) uint32
- Uint64([]byte) uint64
- PutUint16([]byte, uint16)
- PutUint32([]byte, uint32)
- PutUint64([]byte, uint64)
-}
-
-type binaryLittleEndian struct{}
-
-func (binaryLittleEndian) Uint16(b []byte) uint16 {
- _ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
- return uint16(b[0]) | uint16(b[1])<<8
-}
-
-func (binaryLittleEndian) PutUint16(b []byte, v uint16) {
- _ = b[1] // early bounds check to guarantee safety of writes below
- b[0] = byte(v)
- b[1] = byte(v >> 8)
-}
-
-func (binaryLittleEndian) Uint32(b []byte) uint32 {
- _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
- return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
-}
-
-func (binaryLittleEndian) PutUint32(b []byte, v uint32) {
- _ = b[3] // early bounds check to guarantee safety of writes below
- b[0] = byte(v)
- b[1] = byte(v >> 8)
- b[2] = byte(v >> 16)
- b[3] = byte(v >> 24)
-}
-
-func (binaryLittleEndian) Uint64(b []byte) uint64 {
- _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
- return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
- uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
-}
-
-func (binaryLittleEndian) PutUint64(b []byte, v uint64) {
- _ = b[7] // early bounds check to guarantee safety of writes below
- b[0] = byte(v)
- b[1] = byte(v >> 8)
- b[2] = byte(v >> 16)
- b[3] = byte(v >> 24)
- b[4] = byte(v >> 32)
- b[5] = byte(v >> 40)
- b[6] = byte(v >> 48)
- b[7] = byte(v >> 56)
-}
-
-type binaryBigEndian struct{}
-
-func (binaryBigEndian) Uint16(b []byte) uint16 {
- _ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
- return uint16(b[1]) | uint16(b[0])<<8
-}
-
-func (binaryBigEndian) PutUint16(b []byte, v uint16) {
- _ = b[1] // early bounds check to guarantee safety of writes below
- b[0] = byte(v >> 8)
- b[1] = byte(v)
-}
-
-func (binaryBigEndian) Uint32(b []byte) uint32 {
- _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
- return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24
-}
-
-func (binaryBigEndian) PutUint32(b []byte, v uint32) {
- _ = b[3] // early bounds check to guarantee safety of writes below
- b[0] = byte(v >> 24)
- b[1] = byte(v >> 16)
- b[2] = byte(v >> 8)
- b[3] = byte(v)
-}
-
-func (binaryBigEndian) Uint64(b []byte) uint64 {
- _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
- return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
- uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
-}
-
-func (binaryBigEndian) PutUint64(b []byte, v uint64) {
- _ = b[7] // early bounds check to guarantee safety of writes below
- b[0] = byte(v >> 56)
- b[1] = byte(v >> 48)
- b[2] = byte(v >> 40)
- b[3] = byte(v >> 32)
- b[4] = byte(v >> 24)
- b[5] = byte(v >> 16)
- b[6] = byte(v >> 8)
- b[7] = byte(v)
-}
diff --git a/vendor/golang.org/x/net/lif/defs_solaris.go b/vendor/golang.org/x/net/lif/defs_solaris.go
deleted file mode 100644
index 02c1998..0000000
--- a/vendor/golang.org/x/net/lif/defs_solaris.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package lif
-
-/*
-#include <sys/socket.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-#include <net/if_types.h>
-*/
-import "C"
-
-const (
- sysAF_UNSPEC = C.AF_UNSPEC
- sysAF_INET = C.AF_INET
- sysAF_INET6 = C.AF_INET6
-
- sysSOCK_DGRAM = C.SOCK_DGRAM
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-const (
- sysLIFC_NOXMIT = C.LIFC_NOXMIT
- sysLIFC_EXTERNAL_SOURCE = C.LIFC_EXTERNAL_SOURCE
- sysLIFC_TEMPORARY = C.LIFC_TEMPORARY
- sysLIFC_ALLZONES = C.LIFC_ALLZONES
- sysLIFC_UNDER_IPMP = C.LIFC_UNDER_IPMP
- sysLIFC_ENABLED = C.LIFC_ENABLED
-
- sysSIOCGLIFADDR = C.SIOCGLIFADDR
- sysSIOCGLIFDSTADDR = C.SIOCGLIFDSTADDR
- sysSIOCGLIFFLAGS = C.SIOCGLIFFLAGS
- sysSIOCGLIFMTU = C.SIOCGLIFMTU
- sysSIOCGLIFNETMASK = C.SIOCGLIFNETMASK
- sysSIOCGLIFMETRIC = C.SIOCGLIFMETRIC
- sysSIOCGLIFNUM = C.SIOCGLIFNUM
- sysSIOCGLIFINDEX = C.SIOCGLIFINDEX
- sysSIOCGLIFSUBNET = C.SIOCGLIFSUBNET
- sysSIOCGLIFLNKINFO = C.SIOCGLIFLNKINFO
- sysSIOCGLIFCONF = C.SIOCGLIFCONF
- sysSIOCGLIFHWADDR = C.SIOCGLIFHWADDR
-)
-
-const (
- sysIFF_UP = C.IFF_UP
- sysIFF_BROADCAST = C.IFF_BROADCAST
- sysIFF_DEBUG = C.IFF_DEBUG
- sysIFF_LOOPBACK = C.IFF_LOOPBACK
- sysIFF_POINTOPOINT = C.IFF_POINTOPOINT
- sysIFF_NOTRAILERS = C.IFF_NOTRAILERS
- sysIFF_RUNNING = C.IFF_RUNNING
- sysIFF_NOARP = C.IFF_NOARP
- sysIFF_PROMISC = C.IFF_PROMISC
- sysIFF_ALLMULTI = C.IFF_ALLMULTI
- sysIFF_INTELLIGENT = C.IFF_INTELLIGENT
- sysIFF_MULTICAST = C.IFF_MULTICAST
- sysIFF_MULTI_BCAST = C.IFF_MULTI_BCAST
- sysIFF_UNNUMBERED = C.IFF_UNNUMBERED
- sysIFF_PRIVATE = C.IFF_PRIVATE
-)
-
-const (
- sizeofLifnum = C.sizeof_struct_lifnum
- sizeofLifreq = C.sizeof_struct_lifreq
- sizeofLifconf = C.sizeof_struct_lifconf
- sizeofLifIfinfoReq = C.sizeof_struct_lif_ifinfo_req
-)
-
-type lifnum C.struct_lifnum
-
-type lifreq C.struct_lifreq
-
-type lifconf C.struct_lifconf
-
-type lifIfinfoReq C.struct_lif_ifinfo_req
-
-const (
- sysIFT_IPV4 = C.IFT_IPV4
- sysIFT_IPV6 = C.IFT_IPV6
- sysIFT_6TO4 = C.IFT_6TO4
-)
diff --git a/vendor/golang.org/x/net/lif/lif.go b/vendor/golang.org/x/net/lif/lif.go
deleted file mode 100644
index 6e81f81..0000000
--- a/vendor/golang.org/x/net/lif/lif.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-// Package lif provides basic functions for the manipulation of
-// logical network interfaces and interface addresses on Solaris.
-//
-// The package supports Solaris 11 or above.
-package lif
-
-import "syscall"
-
-type endpoint struct {
- af int
- s uintptr
-}
-
-func (ep *endpoint) close() error {
- return syscall.Close(int(ep.s))
-}
-
-func newEndpoints(af int) ([]endpoint, error) {
- var lastErr error
- var eps []endpoint
- afs := []int{sysAF_INET, sysAF_INET6}
- if af != sysAF_UNSPEC {
- afs = []int{af}
- }
- for _, af := range afs {
- s, err := syscall.Socket(af, sysSOCK_DGRAM, 0)
- if err != nil {
- lastErr = err
- continue
- }
- eps = append(eps, endpoint{af: af, s: uintptr(s)})
- }
- if len(eps) == 0 {
- return nil, lastErr
- }
- return eps, nil
-}
diff --git a/vendor/golang.org/x/net/lif/link.go b/vendor/golang.org/x/net/lif/link.go
deleted file mode 100644
index 913a53e..0000000
--- a/vendor/golang.org/x/net/lif/link.go
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package lif
-
-import "unsafe"
-
-// A Link represents logical data link information.
-//
-// It also represents base information for logical network interface.
-// On Solaris, each logical network interface represents network layer
-// adjacency information and the interface has a only single network
-// address or address pair for tunneling. It's usual that multiple
-// logical network interfaces share the same logical data link.
-type Link struct {
- Name string // name, equivalent to IP interface name
- Index int // index, equivalent to IP interface index
- Type int // type
- Flags int // flags
- MTU int // maximum transmission unit, basically link MTU but may differ between IP address families
- Addr []byte // address
-}
-
-func (ll *Link) fetch(s uintptr) {
- var lifr lifreq
- for i := 0; i < len(ll.Name); i++ {
- lifr.Name[i] = int8(ll.Name[i])
- }
- ioc := int64(sysSIOCGLIFINDEX)
- if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
- ll.Index = int(nativeEndian.Uint32(lifr.Lifru[:4]))
- }
- ioc = int64(sysSIOCGLIFFLAGS)
- if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
- ll.Flags = int(nativeEndian.Uint64(lifr.Lifru[:8]))
- }
- ioc = int64(sysSIOCGLIFMTU)
- if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
- ll.MTU = int(nativeEndian.Uint32(lifr.Lifru[:4]))
- }
- switch ll.Type {
- case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
- default:
- ioc = int64(sysSIOCGLIFHWADDR)
- if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
- ll.Addr, _ = parseLinkAddr(lifr.Lifru[4:])
- }
- }
-}
-
-// Links returns a list of logical data links.
-//
-// 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 Links(af int, name string) ([]Link, error) {
- eps, err := newEndpoints(af)
- if len(eps) == 0 {
- return nil, err
- }
- defer func() {
- for _, ep := range eps {
- ep.close()
- }
- }()
- return links(eps, name)
-}
-
-func links(eps []endpoint, name string) ([]Link, error) {
- var lls []Link
- lifn := lifnum{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
- lifc := lifconf{Flags: sysLIFC_NOXMIT | sysLIFC_TEMPORARY | sysLIFC_ALLZONES | sysLIFC_UNDER_IPMP}
- for _, ep := range eps {
- lifn.Family = uint16(ep.af)
- ioc := int64(sysSIOCGLIFNUM)
- if err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifn)); err != nil {
- continue
- }
- if lifn.Count == 0 {
- continue
- }
- b := make([]byte, lifn.Count*sizeofLifreq)
- lifc.Family = uint16(ep.af)
- lifc.Len = lifn.Count * sizeofLifreq
- if len(lifc.Lifcu) == 8 {
- nativeEndian.PutUint64(lifc.Lifcu[:], uint64(uintptr(unsafe.Pointer(&b[0]))))
- } else {
- nativeEndian.PutUint32(lifc.Lifcu[:], uint32(uintptr(unsafe.Pointer(&b[0]))))
- }
- ioc = int64(sysSIOCGLIFCONF)
- if err := ioctl(ep.s, uintptr(ioc), unsafe.Pointer(&lifc)); err != nil {
- continue
- }
- nb := make([]byte, 32) // see LIFNAMSIZ in net/if.h
- for i := 0; i < int(lifn.Count); i++ {
- lifr := (*lifreq)(unsafe.Pointer(&b[i*sizeofLifreq]))
- for i := 0; i < 32; i++ {
- if lifr.Name[i] == 0 {
- nb = nb[:i]
- break
- }
- nb[i] = byte(lifr.Name[i])
- }
- llname := string(nb)
- nb = nb[:32]
- if isDupLink(lls, llname) || name != "" && name != llname {
- continue
- }
- ll := Link{Name: llname, Type: int(lifr.Type)}
- ll.fetch(ep.s)
- lls = append(lls, ll)
- }
- }
- return lls, nil
-}
-
-func isDupLink(lls []Link, name string) bool {
- for _, ll := range lls {
- if ll.Name == name {
- return true
- }
- }
- return false
-}
diff --git a/vendor/golang.org/x/net/lif/sys.go b/vendor/golang.org/x/net/lif/sys.go
deleted file mode 100644
index c896041..0000000
--- a/vendor/golang.org/x/net/lif/sys.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package lif
-
-import "unsafe"
-
-var nativeEndian binaryByteOrder
-
-func init() {
- i := uint32(1)
- b := (*[4]byte)(unsafe.Pointer(&i))
- if b[0] == 1 {
- nativeEndian = littleEndian
- } else {
- nativeEndian = bigEndian
- }
-}
diff --git a/vendor/golang.org/x/net/lif/sys_solaris_amd64.s b/vendor/golang.org/x/net/lif/sys_solaris_amd64.s
deleted file mode 100644
index 39d76af..0000000
--- a/vendor/golang.org/x/net/lif/sys_solaris_amd64.s
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "textflag.h"
-
-TEXT ·sysvicall6(SB),NOSPLIT,$0-88
- JMP syscall·sysvicall6(SB)
diff --git a/vendor/golang.org/x/net/lif/syscall.go b/vendor/golang.org/x/net/lif/syscall.go
deleted file mode 100644
index aadab2e..0000000
--- a/vendor/golang.org/x/net/lif/syscall.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build solaris
-
-package lif
-
-import (
- "syscall"
- "unsafe"
-)
-
-//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
-
-//go:linkname procIoctl libc_ioctl
-
-var procIoctl uintptr
-
-func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno)
-
-func ioctl(s, ioc uintptr, arg unsafe.Pointer) error {
- _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procIoctl)), 3, s, ioc, uintptr(arg), 0, 0, 0)
- if errno != 0 {
- return error(errno)
- }
- return nil
-}
diff --git a/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go b/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go
deleted file mode 100644
index b5e999b..0000000
--- a/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Created by cgo -godefs - DO NOT EDIT
-// cgo -godefs defs_solaris.go
-
-package lif
-
-const (
- sysAF_UNSPEC = 0x0
- sysAF_INET = 0x2
- sysAF_INET6 = 0x1a
-
- sysSOCK_DGRAM = 0x1
-)
-
-type sockaddrStorage struct {
- Family uint16
- X_ss_pad1 [6]int8
- X_ss_align float64
- X_ss_pad2 [240]int8
-}
-
-const (
- sysLIFC_NOXMIT = 0x1
- sysLIFC_EXTERNAL_SOURCE = 0x2
- sysLIFC_TEMPORARY = 0x4
- sysLIFC_ALLZONES = 0x8
- sysLIFC_UNDER_IPMP = 0x10
- sysLIFC_ENABLED = 0x20
-
- sysSIOCGLIFADDR = -0x3f87968f
- sysSIOCGLIFDSTADDR = -0x3f87968d
- sysSIOCGLIFFLAGS = -0x3f87968b
- sysSIOCGLIFMTU = -0x3f879686
- sysSIOCGLIFNETMASK = -0x3f879683
- sysSIOCGLIFMETRIC = -0x3f879681
- sysSIOCGLIFNUM = -0x3ff3967e
- sysSIOCGLIFINDEX = -0x3f87967b
- sysSIOCGLIFSUBNET = -0x3f879676
- sysSIOCGLIFLNKINFO = -0x3f879674
- sysSIOCGLIFCONF = -0x3fef965b
- sysSIOCGLIFHWADDR = -0x3f879640
-)
-
-const (
- sysIFF_UP = 0x1
- sysIFF_BROADCAST = 0x2
- sysIFF_DEBUG = 0x4
- sysIFF_LOOPBACK = 0x8
- sysIFF_POINTOPOINT = 0x10
- sysIFF_NOTRAILERS = 0x20
- sysIFF_RUNNING = 0x40
- sysIFF_NOARP = 0x80
- sysIFF_PROMISC = 0x100
- sysIFF_ALLMULTI = 0x200
- sysIFF_INTELLIGENT = 0x400
- sysIFF_MULTICAST = 0x800
- sysIFF_MULTI_BCAST = 0x1000
- sysIFF_UNNUMBERED = 0x2000
- sysIFF_PRIVATE = 0x8000
-)
-
-const (
- sizeofLifnum = 0xc
- sizeofLifreq = 0x178
- sizeofLifconf = 0x18
- sizeofLifIfinfoReq = 0x10
-)
-
-type lifnum struct {
- Family uint16
- Pad_cgo_0 [2]byte
- Flags int32
- Count int32
-}
-
-type lifreq struct {
- Name [32]int8
- Lifru1 [4]byte
- Type uint32
- Lifru [336]byte
-}
-
-type lifconf struct {
- Family uint16
- Pad_cgo_0 [2]byte
- Flags int32
- Len int32
- Pad_cgo_1 [4]byte
- Lifcu [8]byte
-}
-
-type lifIfinfoReq struct {
- Maxhops uint8
- Pad_cgo_0 [3]byte
- Reachtime uint32
- Reachretrans uint32
- Maxmtu uint32
-}
-
-const (
- sysIFT_IPV4 = 0xc8
- sysIFT_IPV6 = 0xc9
- sysIFT_6TO4 = 0xca
-)