Integrate BACKBEAT SDK and resolve KACHING license validation

Major integrations and fixes:
- Added BACKBEAT SDK integration for P2P operation timing
- Implemented beat-aware status tracking for distributed operations
- Added Docker secrets support for secure license management
- Resolved KACHING license validation via HTTPS/TLS
- Updated docker-compose configuration for clean stack deployment
- Disabled rollback policies to prevent deployment failures
- Added license credential storage (CHORUS-DEV-MULTI-001)

Technical improvements:
- BACKBEAT P2P operation tracking with phase management
- Enhanced configuration system with file-based secrets
- Improved error handling for license validation
- Clean separation of KACHING and CHORUS deployment stacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-09-06 07:56:26 +10:00
parent 543ab216f9
commit 9bdcbe0447
4730 changed files with 1480093 additions and 1916 deletions

432
vendor/golang.org/x/net/route/address.go generated vendored Normal file
View File

@@ -0,0 +1,432 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
import (
"runtime"
"syscall"
)
// An Addr represents an address associated with packet routing.
type Addr interface {
// Family returns an address family.
Family() int
}
// A LinkAddr represents a link-layer address.
type LinkAddr struct {
Index int // interface index when attached
Name string // interface name when attached
Addr []byte // link-layer address when attached
}
// Family implements the Family method of Addr interface.
func (a *LinkAddr) Family() int { return syscall.AF_LINK }
func (a *LinkAddr) lenAndSpace() (int, int) {
l := 8 + len(a.Name) + len(a.Addr)
return l, roundup(l)
}
func (a *LinkAddr) marshal(b []byte) (int, error) {
l, ll := a.lenAndSpace()
if len(b) < ll {
return 0, errShortBuffer
}
nlen, alen := len(a.Name), len(a.Addr)
if nlen > 255 || alen > 255 {
return 0, errInvalidAddr
}
b[0] = byte(l)
b[1] = syscall.AF_LINK
if a.Index > 0 {
nativeEndian.PutUint16(b[2:4], uint16(a.Index))
}
data := b[8:]
if nlen > 0 {
b[5] = byte(nlen)
copy(data[:nlen], a.Name)
data = data[nlen:]
}
if alen > 0 {
b[6] = byte(alen)
copy(data[:alen], a.Addr)
data = data[alen:]
}
return ll, nil
}
func parseLinkAddr(b []byte) (Addr, error) {
if len(b) < 8 {
return nil, errInvalidAddr
}
_, a, err := parseKernelLinkAddr(syscall.AF_LINK, b[4:])
if err != nil {
return nil, err
}
a.(*LinkAddr).Index = int(nativeEndian.Uint16(b[2:4]))
return a, nil
}
// parseKernelLinkAddr parses b as a link-layer address in
// conventional BSD kernel form.
func parseKernelLinkAddr(_ int, b []byte) (int, Addr, error) {
// The encoding looks like the following:
// +----------------------------+
// | Type (1 octet) |
// +----------------------------+
// | Name length (1 octet) |
// +----------------------------+
// | Address length (1 octet) |
// +----------------------------+
// | Selector length (1 octet) |
// +----------------------------+
// | Data (variable) |
// +----------------------------+
//
// On some platforms, all-bit-one of length field means "don't
// care".
nlen, alen, slen := int(b[1]), int(b[2]), int(b[3])
if nlen == 0xff {
nlen = 0
}
if alen == 0xff {
alen = 0
}
if slen == 0xff {
slen = 0
}
l := 4 + nlen + alen + slen
if len(b) < l {
return 0, nil, errInvalidAddr
}
data := b[4:]
var name string
var addr []byte
if nlen > 0 {
name = string(data[:nlen])
data = data[nlen:]
}
if alen > 0 {
addr = data[:alen]
data = data[alen:]
}
return l, &LinkAddr{Name: name, Addr: addr}, nil
}
// An Inet4Addr represents an internet address for IPv4.
type Inet4Addr struct {
IP [4]byte // IP address
}
// Family implements the Family method of Addr interface.
func (a *Inet4Addr) Family() int { return syscall.AF_INET }
func (a *Inet4Addr) lenAndSpace() (int, int) {
return sizeofSockaddrInet, roundup(sizeofSockaddrInet)
}
func (a *Inet4Addr) marshal(b []byte) (int, error) {
l, ll := a.lenAndSpace()
if len(b) < ll {
return 0, errShortBuffer
}
b[0] = byte(l)
b[1] = syscall.AF_INET
copy(b[4:8], a.IP[:])
return ll, nil
}
// An Inet6Addr represents an internet address for IPv6.
type Inet6Addr struct {
IP [16]byte // IP address
ZoneID int // zone identifier
}
// Family implements the Family method of Addr interface.
func (a *Inet6Addr) Family() int { return syscall.AF_INET6 }
func (a *Inet6Addr) lenAndSpace() (int, int) {
return sizeofSockaddrInet6, roundup(sizeofSockaddrInet6)
}
func (a *Inet6Addr) marshal(b []byte) (int, error) {
l, ll := a.lenAndSpace()
if len(b) < ll {
return 0, errShortBuffer
}
b[0] = byte(l)
b[1] = syscall.AF_INET6
copy(b[8:24], a.IP[:])
if a.ZoneID > 0 {
nativeEndian.PutUint32(b[24:28], uint32(a.ZoneID))
}
return ll, nil
}
// parseInetAddr parses b as an internet address for IPv4 or IPv6.
func parseInetAddr(af int, b []byte) (Addr, error) {
switch af {
case syscall.AF_INET:
if len(b) < sizeofSockaddrInet {
return nil, errInvalidAddr
}
a := &Inet4Addr{}
copy(a.IP[:], b[4:8])
return a, nil
case syscall.AF_INET6:
if len(b) < sizeofSockaddrInet6 {
return nil, errInvalidAddr
}
a := &Inet6Addr{ZoneID: int(nativeEndian.Uint32(b[24:28]))}
copy(a.IP[:], b[8:24])
if a.IP[0] == 0xfe && a.IP[1]&0xc0 == 0x80 || a.IP[0] == 0xff && (a.IP[1]&0x0f == 0x01 || a.IP[1]&0x0f == 0x02) {
// KAME based IPv6 protocol stack usually
// embeds the interface index in the
// interface-local or link-local address as
// the kernel-internal form.
id := int(bigEndian.Uint16(a.IP[2:4]))
if id != 0 {
a.ZoneID = id
a.IP[2], a.IP[3] = 0, 0
}
}
return a, nil
default:
return nil, errInvalidAddr
}
}
// parseKernelInetAddr parses b as an internet address in conventional
// BSD kernel form.
func parseKernelInetAddr(af int, b []byte) (int, Addr, error) {
// The encoding looks similar to the NLRI encoding.
// +----------------------------+
// | Length (1 octet) |
// +----------------------------+
// | Address prefix (variable) |
// +----------------------------+
//
// The differences between the kernel form and the NLRI
// encoding are:
//
// - The length field of the kernel form indicates the prefix
// length in bytes, not in bits
//
// - In the kernel form, zero value of the length field
// doesn't mean 0.0.0.0/0 or ::/0
//
// - The kernel form appends leading bytes to the prefix field
// to make the <length, prefix> tuple to be conformed with
// the routing message boundary
l := int(b[0])
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
// On Darwin, an address in the kernel form is also
// used as a message filler.
if l == 0 || len(b) > roundup(l) {
l = roundup(l)
}
} else {
l = roundup(l)
}
if len(b) < l {
return 0, nil, errInvalidAddr
}
// Don't reorder case expressions.
// The case expressions for IPv6 must come first.
const (
off4 = 4 // offset of in_addr
off6 = 8 // offset of in6_addr
)
switch {
case b[0] == sizeofSockaddrInet6:
a := &Inet6Addr{}
copy(a.IP[:], b[off6:off6+16])
return int(b[0]), a, nil
case af == syscall.AF_INET6:
a := &Inet6Addr{}
if l-1 < off6 {
copy(a.IP[:], b[1:l])
} else {
copy(a.IP[:], b[l-off6:l])
}
return int(b[0]), a, nil
case b[0] == sizeofSockaddrInet:
a := &Inet4Addr{}
copy(a.IP[:], b[off4:off4+4])
return int(b[0]), a, nil
default: // an old fashion, AF_UNSPEC or unknown means AF_INET
a := &Inet4Addr{}
if l-1 < off4 {
copy(a.IP[:], b[1:l])
} else {
copy(a.IP[:], b[l-off4:l])
}
return int(b[0]), a, nil
}
}
// A DefaultAddr represents an address of various operating
// system-specific features.
type DefaultAddr struct {
af int
Raw []byte // raw format of address
}
// Family implements the Family method of Addr interface.
func (a *DefaultAddr) Family() int { return a.af }
func (a *DefaultAddr) lenAndSpace() (int, int) {
l := len(a.Raw)
return l, roundup(l)
}
func (a *DefaultAddr) marshal(b []byte) (int, error) {
l, ll := a.lenAndSpace()
if len(b) < ll {
return 0, errShortBuffer
}
if l > 255 {
return 0, errInvalidAddr
}
b[1] = byte(l)
copy(b[:l], a.Raw)
return ll, nil
}
func parseDefaultAddr(b []byte) (Addr, error) {
if len(b) < 2 || len(b) < int(b[0]) {
return nil, errInvalidAddr
}
a := &DefaultAddr{af: int(b[1]), Raw: b[:b[0]]}
return a, nil
}
func addrsSpace(as []Addr) int {
var l int
for _, a := range as {
switch a := a.(type) {
case *LinkAddr:
_, ll := a.lenAndSpace()
l += ll
case *Inet4Addr:
_, ll := a.lenAndSpace()
l += ll
case *Inet6Addr:
_, ll := a.lenAndSpace()
l += ll
case *DefaultAddr:
_, ll := a.lenAndSpace()
l += ll
}
}
return l
}
// marshalAddrs marshals as and returns a bitmap indicating which
// address is stored in b.
func marshalAddrs(b []byte, as []Addr) (uint, error) {
var attrs uint
for i, a := range as {
switch a := a.(type) {
case *LinkAddr:
l, err := a.marshal(b)
if err != nil {
return 0, err
}
b = b[l:]
attrs |= 1 << uint(i)
case *Inet4Addr:
l, err := a.marshal(b)
if err != nil {
return 0, err
}
b = b[l:]
attrs |= 1 << uint(i)
case *Inet6Addr:
l, err := a.marshal(b)
if err != nil {
return 0, err
}
b = b[l:]
attrs |= 1 << uint(i)
case *DefaultAddr:
l, err := a.marshal(b)
if err != nil {
return 0, err
}
b = b[l:]
attrs |= 1 << uint(i)
}
}
return attrs, nil
}
func parseAddrs(attrs uint, fn func(int, []byte) (int, Addr, error), b []byte) ([]Addr, error) {
var as [syscall.RTAX_MAX]Addr
af := int(syscall.AF_UNSPEC)
for i := uint(0); i < syscall.RTAX_MAX && len(b) >= roundup(0); i++ {
if attrs&(1<<i) == 0 {
continue
}
if i <= syscall.RTAX_BRD {
switch b[1] {
case syscall.AF_LINK:
a, err := parseLinkAddr(b)
if err != nil {
return nil, err
}
as[i] = a
l := roundup(int(b[0]))
if len(b) < l {
return nil, errMessageTooShort
}
b = b[l:]
case syscall.AF_INET, syscall.AF_INET6:
af = int(b[1])
a, err := parseInetAddr(af, b)
if err != nil {
return nil, err
}
as[i] = a
l := roundup(int(b[0]))
if len(b) < l {
return nil, errMessageTooShort
}
b = b[l:]
default:
l, a, err := fn(af, b)
if err != nil {
return nil, err
}
as[i] = a
ll := roundup(l)
if len(b) < ll {
b = b[l:]
} else {
b = b[ll:]
}
}
} else {
a, err := parseDefaultAddr(b)
if err != nil {
return nil, err
}
as[i] = a
l := roundup(int(b[0]))
if len(b) < l {
return nil, errMessageTooShort
}
b = b[l:]
}
}
// The only remaining bytes in b should be alignment.
// However, under some circumstances DragonFly BSD appears to put
// more addresses in the message than are indicated in the address
// bitmask, so don't check for this.
return as[:], nil
}

90
vendor/golang.org/x/net/route/binary.go generated vendored Normal file
View File

@@ -0,0 +1,90 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
// 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
PutUint16([]byte, uint16)
PutUint32([]byte, uint32)
Uint64([]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
}
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
}

7
vendor/golang.org/x/net/route/empty.s generated vendored Normal file
View File

@@ -0,0 +1,7 @@
// Copyright 2018 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.
//go:build darwin && go1.12
// This exists solely so we can linkname in symbols from syscall.

64
vendor/golang.org/x/net/route/interface.go generated vendored Normal file
View File

@@ -0,0 +1,64 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
// An InterfaceMessage represents an interface message.
type InterfaceMessage struct {
Version int // message version
Type int // message type
Flags int // interface flags
Index int // interface index
Name string // interface name
Addrs []Addr // addresses
extOff int // offset of header extension
raw []byte // raw message
}
// An InterfaceAddrMessage represents an interface address message.
type InterfaceAddrMessage struct {
Version int // message version
Type int // message type
Flags int // interface flags
Index int // interface index
Addrs []Addr // addresses
raw []byte // raw message
}
// Sys implements the Sys method of Message interface.
func (m *InterfaceAddrMessage) Sys() []Sys { return nil }
// An InterfaceMulticastAddrMessage represents an interface multicast
// address message.
type InterfaceMulticastAddrMessage struct {
Version int // message version
Type int // message type
Flags int // interface flags
Index int // interface index
Addrs []Addr // addresses
raw []byte // raw message
}
// Sys implements the Sys method of Message interface.
func (m *InterfaceMulticastAddrMessage) Sys() []Sys { return nil }
// An InterfaceAnnounceMessage represents an interface announcement
// message.
type InterfaceAnnounceMessage struct {
Version int // message version
Type int // message type
Index int // interface index
Name string // interface name
What int // what type of announcement
raw []byte // raw message
}
// Sys implements the Sys method of Message interface.
func (m *InterfaceAnnounceMessage) Sys() []Sys { return nil }

32
vendor/golang.org/x/net/route/interface_announce.go generated vendored Normal file
View File

@@ -0,0 +1,32 @@
// 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.
//go:build dragonfly || freebsd || netbsd
package route
func (w *wireFormat) parseInterfaceAnnounceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &InterfaceAnnounceMessage{
Version: int(b[2]),
Type: int(b[3]),
Index: int(nativeEndian.Uint16(b[4:6])),
What: int(nativeEndian.Uint16(b[22:24])),
raw: b[:l],
}
for i := 0; i < 16; i++ {
if b[6+i] != 0 {
continue
}
m.Name = string(b[6 : 6+i])
break
}
return m, nil
}

69
vendor/golang.org/x/net/route/interface_classic.go generated vendored Normal file
View File

@@ -0,0 +1,69 @@
// 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.
//go:build darwin || dragonfly || netbsd
package route
import (
"runtime"
"syscall"
)
func (w *wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[4:8]))
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
Version: int(b[2]),
Type: int(b[3]),
Addrs: make([]Addr, syscall.RTAX_MAX),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
extOff: w.extOff,
raw: b[:l],
}
a, err := parseLinkAddr(b[w.bodyOff:])
if err != nil {
return nil, err
}
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}
func (w *wireFormat) parseInterfaceAddrMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &InterfaceAddrMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
raw: b[:l],
}
if runtime.GOOS == "netbsd" {
m.Index = int(nativeEndian.Uint16(b[16:18]))
} else {
m.Index = int(nativeEndian.Uint16(b[12:14]))
}
var err error
m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[4:8])), parseKernelInetAddr, b[w.bodyOff:])
if err != nil {
return nil, err
}
return m, nil
}

80
vendor/golang.org/x/net/route/interface_freebsd.go generated vendored Normal file
View File

@@ -0,0 +1,80 @@
// 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.
package route
import "syscall"
func (w *wireFormat) parseInterfaceMessage(typ RIBType, b []byte) (Message, error) {
var extOff, bodyOff int
if typ == syscall.NET_RT_IFLISTL {
if len(b) < 20 {
return nil, errMessageTooShort
}
extOff = int(nativeEndian.Uint16(b[18:20]))
bodyOff = int(nativeEndian.Uint16(b[16:18]))
} else {
extOff = w.extOff
bodyOff = w.bodyOff
}
if len(b) < extOff || len(b) < bodyOff {
return nil, errInvalidMessage
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[4:8]))
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
Addrs: make([]Addr, syscall.RTAX_MAX),
extOff: extOff,
raw: b[:l],
}
a, err := parseLinkAddr(b[bodyOff:])
if err != nil {
return nil, err
}
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}
func (w *wireFormat) parseInterfaceAddrMessage(typ RIBType, b []byte) (Message, error) {
var bodyOff int
if typ == syscall.NET_RT_IFLISTL {
if len(b) < 24 {
return nil, errMessageTooShort
}
bodyOff = int(nativeEndian.Uint16(b[16:18]))
} else {
bodyOff = w.bodyOff
}
if len(b) < bodyOff {
return nil, errInvalidMessage
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &InterfaceAddrMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
raw: b[:l],
}
var err error
m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[4:8])), parseKernelInetAddr, b[bodyOff:])
if err != nil {
return nil, err
}
return m, nil
}

30
vendor/golang.org/x/net/route/interface_multicast.go generated vendored Normal file
View File

@@ -0,0 +1,30 @@
// 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.
//go:build darwin || dragonfly || freebsd
package route
func (w *wireFormat) parseInterfaceMulticastAddrMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &InterfaceMulticastAddrMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[12:14])),
raw: b[:l],
}
var err error
m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[4:8])), parseKernelInetAddr, b[w.bodyOff:])
if err != nil {
return nil, err
}
return m, nil
}

92
vendor/golang.org/x/net/route/interface_openbsd.go generated vendored Normal file
View File

@@ -0,0 +1,92 @@
// 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.
package route
import "syscall"
func (*wireFormat) parseInterfaceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < 32 {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
attrs := uint(nativeEndian.Uint32(b[12:16]))
if attrs&syscall.RTA_IFP == 0 {
return nil, nil
}
m := &InterfaceMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[16:20])),
Index: int(nativeEndian.Uint16(b[6:8])),
Addrs: make([]Addr, syscall.RTAX_MAX),
raw: b[:l],
}
ll := int(nativeEndian.Uint16(b[4:6]))
if len(b) < ll {
return nil, errInvalidMessage
}
a, err := parseLinkAddr(b[ll:])
if err != nil {
return nil, err
}
m.Addrs[syscall.RTAX_IFP] = a
m.Name = a.(*LinkAddr).Name
return m, nil
}
func (*wireFormat) parseInterfaceAddrMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < 24 {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
bodyOff := int(nativeEndian.Uint16(b[4:6]))
if len(b) < bodyOff {
return nil, errInvalidMessage
}
m := &InterfaceAddrMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[12:16])),
Index: int(nativeEndian.Uint16(b[6:8])),
raw: b[:l],
}
var err error
m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[bodyOff:])
if err != nil {
return nil, err
}
return m, nil
}
func (*wireFormat) parseInterfaceAnnounceMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < 26 {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &InterfaceAnnounceMessage{
Version: int(b[2]),
Type: int(b[3]),
Index: int(nativeEndian.Uint16(b[6:8])),
What: int(nativeEndian.Uint16(b[8:10])),
raw: b[:l],
}
for i := 0; i < 16; i++ {
if b[10+i] != 0 {
continue
}
m.Name = string(b[10 : 10+i])
break
}
return m, nil
}

72
vendor/golang.org/x/net/route/message.go generated vendored Normal file
View File

@@ -0,0 +1,72 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
// A Message represents a routing message.
type Message interface {
// Sys returns operating system-specific information.
Sys() []Sys
}
// A Sys reprensents operating system-specific information.
type Sys interface {
// SysType returns a type of operating system-specific
// information.
SysType() SysType
}
// A SysType represents a type of operating system-specific
// information.
type SysType int
const (
SysMetrics SysType = iota
SysStats
)
// ParseRIB parses b as a routing information base and returns a list
// of routing messages.
func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
if !typ.parseable() {
return nil, errUnsupportedMessage
}
var msgs []Message
nmsgs, nskips := 0, 0
for len(b) > 4 {
nmsgs++
l := int(nativeEndian.Uint16(b[:2]))
if l == 0 {
return nil, errInvalidMessage
}
if len(b) < l {
return nil, errMessageTooShort
}
if b[2] != rtmVersion {
b = b[l:]
continue
}
if w, ok := wireFormats[int(b[3])]; !ok {
nskips++
} else {
m, err := w.parse(typ, b[:l])
if err != nil {
return nil, err
}
if m == nil {
nskips++
} else {
msgs = append(msgs, m)
}
}
b = b[l:]
}
// We failed to parse any of the messages - version mismatch?
if nmsgs != len(msgs)+nskips {
return nil, errMessageMismatch
}
return msgs, nil
}

134
vendor/golang.org/x/net/route/route.go generated vendored Normal file
View File

@@ -0,0 +1,134 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
// Package route provides basic functions for the manipulation of
// packet routing facilities on BSD variants.
//
// The package supports any version of Darwin, any version of
// DragonFly BSD, FreeBSD 7 and above, NetBSD 6 and above, and OpenBSD
// 5.6 and above.
package route
import (
"errors"
"os"
"syscall"
)
var (
errUnsupportedMessage = errors.New("unsupported message")
errMessageMismatch = errors.New("message mismatch")
errMessageTooShort = errors.New("message too short")
errInvalidMessage = errors.New("invalid message")
errInvalidAddr = errors.New("invalid address")
errShortBuffer = errors.New("short buffer")
)
// A RouteMessage represents a message conveying an address prefix, a
// nexthop address and an output interface.
//
// Unlike other messages, this message can be used to query adjacency
// information for the given address prefix, to add a new route, and
// to delete or modify the existing route from the routing information
// base inside the kernel by writing and reading route messages on a
// routing socket.
//
// For the manipulation of routing information, the route message must
// contain appropriate fields that include:
//
// Version = <must be specified>
// Type = <must be specified>
// Flags = <must be specified>
// Index = <must be specified if necessary>
// ID = <must be specified>
// Seq = <must be specified>
// Addrs = <must be specified>
//
// The Type field specifies a type of manipulation, the Flags field
// specifies a class of target information and the Addrs field
// specifies target information like the following:
//
// route.RouteMessage{
// Version: RTM_VERSION,
// Type: RTM_GET,
// Flags: RTF_UP | RTF_HOST,
// ID: uintptr(os.Getpid()),
// Seq: 1,
// Addrs: []route.Addrs{
// RTAX_DST: &route.Inet4Addr{ ... },
// RTAX_IFP: &route.LinkAddr{ ... },
// RTAX_BRD: &route.Inet4Addr{ ... },
// },
// }
//
// The values for the above fields depend on the implementation of
// each operating system.
//
// The Err field on a response message contains an error value on the
// requested operation. If non-nil, the requested operation is failed.
type RouteMessage struct {
Version int // message version
Type int // message type
Flags int // route flags
Index int // interface index when attached
ID uintptr // sender's identifier; usually process ID
Seq int // sequence number
Err error // error on requested operation
Addrs []Addr // addresses
extOff int // offset of header extension
raw []byte // raw message
}
// Marshal returns the binary encoding of m.
func (m *RouteMessage) Marshal() ([]byte, error) {
return m.marshal()
}
// A RIBType represents a type of routing information base.
type RIBType int
const (
RIBTypeRoute RIBType = syscall.NET_RT_DUMP
RIBTypeInterface RIBType = syscall.NET_RT_IFLIST
)
// FetchRIB fetches a routing information base from the operating
// system.
//
// The provided af must be an address family.
//
// The provided arg must be a RIBType-specific argument.
// When RIBType is related to routes, arg might be a set of route
// flags. When RIBType is related to network interfaces, arg might be
// an interface index or a set of interface flags. In most cases, zero
// means a wildcard.
func FetchRIB(af int, typ RIBType, arg int) ([]byte, error) {
try := 0
for {
try++
mib := [6]int32{syscall.CTL_NET, syscall.AF_ROUTE, 0, int32(af), int32(typ), int32(arg)}
n := uintptr(0)
if err := sysctl(mib[:], nil, &n, nil, 0); err != nil {
return nil, os.NewSyscallError("sysctl", err)
}
if n == 0 {
return nil, nil
}
b := make([]byte, n)
if err := sysctl(mib[:], &b[0], &n, nil, 0); err != nil {
// If the sysctl failed because the data got larger
// between the two sysctl calls, try a few times
// before failing. (golang.org/issue/45736).
const maxTries = 3
if err == syscall.ENOMEM && try < maxTries {
continue
}
return nil, os.NewSyscallError("sysctl", err)
}
return b[:n], nil
}
}

75
vendor/golang.org/x/net/route/route_classic.go generated vendored Normal file
View File

@@ -0,0 +1,75 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd
package route
import (
"runtime"
"syscall"
)
func (m *RouteMessage) marshal() ([]byte, error) {
w, ok := wireFormats[m.Type]
if !ok {
return nil, errUnsupportedMessage
}
l := w.bodyOff + addrsSpace(m.Addrs)
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
// Fix stray pointer writes on macOS.
// See golang.org/issue/22456.
l += 1024
}
b := make([]byte, l)
nativeEndian.PutUint16(b[:2], uint16(l))
if m.Version == 0 {
b[2] = rtmVersion
} else {
b[2] = byte(m.Version)
}
b[3] = byte(m.Type)
nativeEndian.PutUint32(b[8:12], uint32(m.Flags))
nativeEndian.PutUint16(b[4:6], uint16(m.Index))
nativeEndian.PutUint32(b[16:20], uint32(m.ID))
nativeEndian.PutUint32(b[20:24], uint32(m.Seq))
attrs, err := marshalAddrs(b[w.bodyOff:], m.Addrs)
if err != nil {
return nil, err
}
if attrs > 0 {
nativeEndian.PutUint32(b[12:16], uint32(attrs))
}
return b, nil
}
func (w *wireFormat) parseRouteMessage(typ RIBType, b []byte) (Message, error) {
if len(b) < w.bodyOff {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &RouteMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[8:12])),
Index: int(nativeEndian.Uint16(b[4:6])),
ID: uintptr(nativeEndian.Uint32(b[16:20])),
Seq: int(nativeEndian.Uint32(b[20:24])),
extOff: w.extOff,
raw: b[:l],
}
errno := syscall.Errno(nativeEndian.Uint32(b[28:32]))
if errno != 0 {
m.Err = errno
}
var err error
m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[w.bodyOff:])
if err != nil {
return nil, err
}
return m, nil
}

67
vendor/golang.org/x/net/route/route_openbsd.go generated vendored Normal file
View File

@@ -0,0 +1,67 @@
// 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.
package route
import (
"syscall"
)
func (m *RouteMessage) marshal() ([]byte, error) {
l := sizeofRtMsghdr + addrsSpace(m.Addrs)
b := make([]byte, l)
nativeEndian.PutUint16(b[:2], uint16(l))
if m.Version == 0 {
b[2] = syscall.RTM_VERSION
} else {
b[2] = byte(m.Version)
}
b[3] = byte(m.Type)
nativeEndian.PutUint16(b[4:6], uint16(sizeofRtMsghdr))
nativeEndian.PutUint32(b[16:20], uint32(m.Flags))
nativeEndian.PutUint16(b[6:8], uint16(m.Index))
nativeEndian.PutUint32(b[24:28], uint32(m.ID))
nativeEndian.PutUint32(b[28:32], uint32(m.Seq))
attrs, err := marshalAddrs(b[sizeofRtMsghdr:], m.Addrs)
if err != nil {
return nil, err
}
if attrs > 0 {
nativeEndian.PutUint32(b[12:16], uint32(attrs))
}
return b, nil
}
func (*wireFormat) parseRouteMessage(_ RIBType, b []byte) (Message, error) {
if len(b) < sizeofRtMsghdr {
return nil, errMessageTooShort
}
l := int(nativeEndian.Uint16(b[:2]))
if len(b) < l {
return nil, errInvalidMessage
}
m := &RouteMessage{
Version: int(b[2]),
Type: int(b[3]),
Flags: int(nativeEndian.Uint32(b[16:20])),
Index: int(nativeEndian.Uint16(b[6:8])),
ID: uintptr(nativeEndian.Uint32(b[24:28])),
Seq: int(nativeEndian.Uint32(b[28:32])),
raw: b[:l],
}
ll := int(nativeEndian.Uint16(b[4:6]))
if len(b) < ll {
return nil, errInvalidMessage
}
errno := syscall.Errno(nativeEndian.Uint32(b[32:36]))
if errno != 0 {
m.Err = errno
}
as, err := parseAddrs(uint(nativeEndian.Uint32(b[12:16])), parseKernelInetAddr, b[ll:])
if err != nil {
return nil, err
}
m.Addrs = as
return m, nil
}

45
vendor/golang.org/x/net/route/sys.go generated vendored Normal file
View File

@@ -0,0 +1,45 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
import (
"syscall"
"unsafe"
)
var (
nativeEndian binaryByteOrder
kernelAlign int
rtmVersion byte
wireFormats map[int]*wireFormat
)
func init() {
i := uint32(1)
b := (*[4]byte)(unsafe.Pointer(&i))
if b[0] == 1 {
nativeEndian = littleEndian
} else {
nativeEndian = bigEndian
}
// might get overridden in probeRoutingStack
rtmVersion = syscall.RTM_VERSION
kernelAlign, wireFormats = probeRoutingStack()
}
func roundup(l int) int {
if l == 0 {
return kernelAlign
}
return (l + kernelAlign - 1) &^ (kernelAlign - 1)
}
type wireFormat struct {
extOff int // offset of header extension
bodyOff int // offset of message body
parse func(RIBType, []byte) (Message, error)
}

89
vendor/golang.org/x/net/route/sys_darwin.go generated vendored Normal file
View File

@@ -0,0 +1,89 @@
// 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.
package route
import "syscall"
func (typ RIBType) parseable() bool {
switch typ {
case syscall.NET_RT_STAT, syscall.NET_RT_TRASH:
return false
default:
return true
}
}
// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *RouteMessage) Sys() []Sys {
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint32(m.raw[m.extOff+4 : m.extOff+8])),
},
}
}
// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *InterfaceMessage) Sys() []Sys {
return []Sys{
&InterfaceMetrics{
Type: int(m.raw[m.extOff]),
MTU: int(nativeEndian.Uint32(m.raw[m.extOff+8 : m.extOff+12])),
},
}
}
func probeRoutingStack() (int, map[int]*wireFormat) {
rtm := &wireFormat{extOff: 36, bodyOff: sizeofRtMsghdrDarwin15}
rtm.parse = rtm.parseRouteMessage
rtm2 := &wireFormat{extOff: 36, bodyOff: sizeofRtMsghdr2Darwin15}
rtm2.parse = rtm2.parseRouteMessage
ifm := &wireFormat{extOff: 16, bodyOff: sizeofIfMsghdrDarwin15}
ifm.parse = ifm.parseInterfaceMessage
ifm2 := &wireFormat{extOff: 32, bodyOff: sizeofIfMsghdr2Darwin15}
ifm2.parse = ifm2.parseInterfaceMessage
ifam := &wireFormat{extOff: sizeofIfaMsghdrDarwin15, bodyOff: sizeofIfaMsghdrDarwin15}
ifam.parse = ifam.parseInterfaceAddrMessage
ifmam := &wireFormat{extOff: sizeofIfmaMsghdrDarwin15, bodyOff: sizeofIfmaMsghdrDarwin15}
ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
ifmam2 := &wireFormat{extOff: sizeofIfmaMsghdr2Darwin15, bodyOff: sizeofIfmaMsghdr2Darwin15}
ifmam2.parse = ifmam2.parseInterfaceMulticastAddrMessage
// Darwin kernels require 32-bit aligned access to routing facilities.
return 4, map[int]*wireFormat{
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFINFO2: ifm2,
syscall.RTM_NEWMADDR2: ifmam2,
syscall.RTM_GET2: rtm2,
}
}

88
vendor/golang.org/x/net/route/sys_dragonfly.go generated vendored Normal file
View File

@@ -0,0 +1,88 @@
// 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.
package route
import (
"syscall"
"unsafe"
)
func (typ RIBType) parseable() bool { return true }
// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *RouteMessage) Sys() []Sys {
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint64(m.raw[m.extOff+8 : m.extOff+16])),
},
}
}
// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *InterfaceMessage) Sys() []Sys {
return []Sys{
&InterfaceMetrics{
Type: int(m.raw[m.extOff]),
MTU: int(nativeEndian.Uint32(m.raw[m.extOff+8 : m.extOff+12])),
},
}
}
func probeRoutingStack() (int, map[int]*wireFormat) {
var p uintptr
rtm := &wireFormat{extOff: 40, bodyOff: sizeofRtMsghdrDragonFlyBSD4}
rtm.parse = rtm.parseRouteMessage
ifm := &wireFormat{extOff: 16, bodyOff: sizeofIfMsghdrDragonFlyBSD4}
ifm.parse = ifm.parseInterfaceMessage
ifam := &wireFormat{extOff: sizeofIfaMsghdrDragonFlyBSD4, bodyOff: sizeofIfaMsghdrDragonFlyBSD4}
ifam.parse = ifam.parseInterfaceAddrMessage
ifmam := &wireFormat{extOff: sizeofIfmaMsghdrDragonFlyBSD4, bodyOff: sizeofIfmaMsghdrDragonFlyBSD4}
ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
ifanm := &wireFormat{extOff: sizeofIfAnnouncemsghdrDragonFlyBSD4, bodyOff: sizeofIfAnnouncemsghdrDragonFlyBSD4}
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
rel, _ := syscall.SysctlUint32("kern.osreldate")
if rel >= 500705 {
// https://github.com/DragonFlyBSD/DragonFlyBSD/commit/43a373152df2d405c9940983e584e6a25e76632d
// but only the size of struct ifa_msghdr actually changed
rtmVersion = 7
ifam.bodyOff = sizeofIfaMsghdrDragonFlyBSD58
}
return int(unsafe.Sizeof(p)), map[int]*wireFormat{
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFANNOUNCE: ifanm,
}
}

160
vendor/golang.org/x/net/route/sys_freebsd.go generated vendored Normal file
View File

@@ -0,0 +1,160 @@
// 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.
package route
import (
"syscall"
"unsafe"
)
func (typ RIBType) parseable() bool { return true }
// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *RouteMessage) Sys() []Sys {
if kernelAlign == 8 {
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint64(m.raw[m.extOff+8 : m.extOff+16])),
},
}
}
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint32(m.raw[m.extOff+4 : m.extOff+8])),
},
}
}
// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *InterfaceMessage) Sys() []Sys {
return []Sys{
&InterfaceMetrics{
Type: int(m.raw[m.extOff]),
MTU: int(nativeEndian.Uint32(m.raw[m.extOff+8 : m.extOff+12])),
},
}
}
var compatFreeBSD32 bool // 386 emulation on amd64
func probeRoutingStack() (int, map[int]*wireFormat) {
var p uintptr
wordSize := int(unsafe.Sizeof(p))
align := wordSize
// In the case of kern.supported_archs="amd64 i386", we need
// to know the underlying kernel's architecture because the
// alignment for routing facilities are set at the build time
// of the kernel.
conf, _ := syscall.Sysctl("kern.conftxt")
for i, j := 0, 0; j < len(conf); j++ {
if conf[j] != '\n' {
continue
}
s := conf[i:j]
i = j + 1
if len(s) > len("machine") && s[:len("machine")] == "machine" {
s = s[len("machine"):]
for k := 0; k < len(s); k++ {
if s[k] == ' ' || s[k] == '\t' {
s = s[1:]
}
break
}
if s == "amd64" {
align = 8
}
break
}
}
if align != wordSize {
compatFreeBSD32 = true // 386 emulation on amd64
}
var rtm, ifm, ifam, ifmam, ifanm *wireFormat
if compatFreeBSD32 {
rtm = &wireFormat{extOff: sizeofRtMsghdrFreeBSD10Emu - sizeofRtMetricsFreeBSD10Emu, bodyOff: sizeofRtMsghdrFreeBSD10Emu}
ifm = &wireFormat{extOff: 16}
ifam = &wireFormat{extOff: sizeofIfaMsghdrFreeBSD10Emu, bodyOff: sizeofIfaMsghdrFreeBSD10Emu}
ifmam = &wireFormat{extOff: sizeofIfmaMsghdrFreeBSD10Emu, bodyOff: sizeofIfmaMsghdrFreeBSD10Emu}
ifanm = &wireFormat{extOff: sizeofIfAnnouncemsghdrFreeBSD10Emu, bodyOff: sizeofIfAnnouncemsghdrFreeBSD10Emu}
} else {
rtm = &wireFormat{extOff: sizeofRtMsghdrFreeBSD10 - sizeofRtMetricsFreeBSD10, bodyOff: sizeofRtMsghdrFreeBSD10}
ifm = &wireFormat{extOff: 16}
ifam = &wireFormat{extOff: sizeofIfaMsghdrFreeBSD10, bodyOff: sizeofIfaMsghdrFreeBSD10}
ifmam = &wireFormat{extOff: sizeofIfmaMsghdrFreeBSD10, bodyOff: sizeofIfmaMsghdrFreeBSD10}
ifanm = &wireFormat{extOff: sizeofIfAnnouncemsghdrFreeBSD10, bodyOff: sizeofIfAnnouncemsghdrFreeBSD10}
}
rel, _ := syscall.SysctlUint32("kern.osreldate")
switch {
case rel < 800000:
if compatFreeBSD32 {
ifm.bodyOff = sizeofIfMsghdrFreeBSD7Emu
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD7
}
case 800000 <= rel && rel < 900000:
if compatFreeBSD32 {
ifm.bodyOff = sizeofIfMsghdrFreeBSD8Emu
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD8
}
case 900000 <= rel && rel < 1000000:
if compatFreeBSD32 {
ifm.bodyOff = sizeofIfMsghdrFreeBSD9Emu
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD9
}
case 1000000 <= rel && rel < 1100000:
if compatFreeBSD32 {
ifm.bodyOff = sizeofIfMsghdrFreeBSD10Emu
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD10
}
default:
if compatFreeBSD32 {
ifm.bodyOff = sizeofIfMsghdrFreeBSD11Emu
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD11
}
}
rtm.parse = rtm.parseRouteMessage
ifm.parse = ifm.parseInterfaceMessage
ifam.parse = ifam.parseInterfaceAddrMessage
ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
return align, map[int]*wireFormat{
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_NEWMADDR: ifmam,
syscall.RTM_DELMADDR: ifmam,
syscall.RTM_IFANNOUNCE: ifanm,
}
}

73
vendor/golang.org/x/net/route/sys_netbsd.go generated vendored Normal file
View File

@@ -0,0 +1,73 @@
// 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.
package route
import "syscall"
func (typ RIBType) parseable() bool { return true }
// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *RouteMessage) Sys() []Sys {
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint64(m.raw[m.extOff+8 : m.extOff+16])),
},
}
}
// RouteMetrics represents route metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *InterfaceMessage) Sys() []Sys {
return []Sys{
&InterfaceMetrics{
Type: int(m.raw[m.extOff]),
MTU: int(nativeEndian.Uint32(m.raw[m.extOff+8 : m.extOff+12])),
},
}
}
func probeRoutingStack() (int, map[int]*wireFormat) {
rtm := &wireFormat{extOff: 40, bodyOff: sizeofRtMsghdrNetBSD7}
rtm.parse = rtm.parseRouteMessage
ifm := &wireFormat{extOff: 16, bodyOff: sizeofIfMsghdrNetBSD7}
ifm.parse = ifm.parseInterfaceMessage
ifam := &wireFormat{extOff: sizeofIfaMsghdrNetBSD7, bodyOff: sizeofIfaMsghdrNetBSD7}
ifam.parse = ifam.parseInterfaceAddrMessage
ifanm := &wireFormat{extOff: sizeofIfAnnouncemsghdrNetBSD7, bodyOff: sizeofIfAnnouncemsghdrNetBSD7}
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
// NetBSD 6 and above kernels require 64-bit aligned access to
// routing facilities.
return 8, map[int]*wireFormat{
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_LOCK: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFANNOUNCE: ifanm,
syscall.RTM_IFINFO: ifm,
}
}

82
vendor/golang.org/x/net/route/sys_openbsd.go generated vendored Normal file
View File

@@ -0,0 +1,82 @@
// 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.
package route
import (
"syscall"
"unsafe"
)
func (typ RIBType) parseable() bool {
switch typ {
case syscall.NET_RT_STATS, syscall.NET_RT_TABLE:
return false
default:
return true
}
}
// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (rmx *RouteMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *RouteMessage) Sys() []Sys {
return []Sys{
&RouteMetrics{
PathMTU: int(nativeEndian.Uint32(m.raw[60:64])),
},
}
}
// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
// SysType implements the SysType method of Sys interface.
func (imx *InterfaceMetrics) SysType() SysType { return SysMetrics }
// Sys implements the Sys method of Message interface.
func (m *InterfaceMessage) Sys() []Sys {
return []Sys{
&InterfaceMetrics{
Type: int(m.raw[24]),
MTU: int(nativeEndian.Uint32(m.raw[28:32])),
},
}
}
func probeRoutingStack() (int, map[int]*wireFormat) {
var p uintptr
rtm := &wireFormat{extOff: -1, bodyOff: -1}
rtm.parse = rtm.parseRouteMessage
ifm := &wireFormat{extOff: -1, bodyOff: -1}
ifm.parse = ifm.parseInterfaceMessage
ifam := &wireFormat{extOff: -1, bodyOff: -1}
ifam.parse = ifam.parseInterfaceAddrMessage
ifanm := &wireFormat{extOff: -1, bodyOff: -1}
ifanm.parse = ifanm.parseInterfaceAnnounceMessage
return int(unsafe.Sizeof(p)), map[int]*wireFormat{
syscall.RTM_ADD: rtm,
syscall.RTM_DELETE: rtm,
syscall.RTM_CHANGE: rtm,
syscall.RTM_GET: rtm,
syscall.RTM_LOSING: rtm,
syscall.RTM_REDIRECT: rtm,
syscall.RTM_MISS: rtm,
syscall.RTM_RESOLVE: rtm,
syscall.RTM_NEWADDR: ifam,
syscall.RTM_DELADDR: ifam,
syscall.RTM_IFINFO: ifm,
syscall.RTM_IFANNOUNCE: ifanm,
syscall.RTM_DESYNC: rtm,
}
}

12
vendor/golang.org/x/net/route/syscall.go generated vendored Normal file
View File

@@ -0,0 +1,12 @@
// 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.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package route
import _ "unsafe" // for linkname
//go:linkname sysctl syscall.sysctl
func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error

22
vendor/golang.org/x/net/route/zsys_darwin.go generated vendored Normal file
View File

@@ -0,0 +1,22 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_darwin.go
package route
const (
sizeofIfMsghdrDarwin15 = 0x70
sizeofIfaMsghdrDarwin15 = 0x14
sizeofIfmaMsghdrDarwin15 = 0x10
sizeofIfMsghdr2Darwin15 = 0xa0
sizeofIfmaMsghdr2Darwin15 = 0x14
sizeofIfDataDarwin15 = 0x60
sizeofIfData64Darwin15 = 0x80
sizeofRtMsghdrDarwin15 = 0x5c
sizeofRtMsghdr2Darwin15 = 0x5c
sizeofRtMetricsDarwin15 = 0x38
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

20
vendor/golang.org/x/net/route/zsys_dragonfly.go generated vendored Normal file
View File

@@ -0,0 +1,20 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_dragonfly.go
package route
const (
sizeofIfMsghdrDragonFlyBSD4 = 0xb0
sizeofIfaMsghdrDragonFlyBSD4 = 0x14
sizeofIfmaMsghdrDragonFlyBSD4 = 0x10
sizeofIfAnnouncemsghdrDragonFlyBSD4 = 0x18
sizeofIfaMsghdrDragonFlyBSD58 = 0x18
sizeofRtMsghdrDragonFlyBSD4 = 0x98
sizeofRtMetricsDragonFlyBSD4 = 0x70
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

55
vendor/golang.org/x/net/route/zsys_freebsd_386.go generated vendored Normal file
View File

@@ -0,0 +1,55 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_freebsd.go
package route
const (
sizeofIfMsghdrlFreeBSD10 = 0x68
sizeofIfaMsghdrFreeBSD10 = 0x14
sizeofIfaMsghdrlFreeBSD10 = 0x6c
sizeofIfmaMsghdrFreeBSD10 = 0x10
sizeofIfAnnouncemsghdrFreeBSD10 = 0x18
sizeofRtMsghdrFreeBSD10 = 0x5c
sizeofRtMetricsFreeBSD10 = 0x38
sizeofIfMsghdrFreeBSD7 = 0x60
sizeofIfMsghdrFreeBSD8 = 0x60
sizeofIfMsghdrFreeBSD9 = 0x60
sizeofIfMsghdrFreeBSD10 = 0x64
sizeofIfMsghdrFreeBSD11 = 0xa8
sizeofIfDataFreeBSD7 = 0x50
sizeofIfDataFreeBSD8 = 0x50
sizeofIfDataFreeBSD9 = 0x50
sizeofIfDataFreeBSD10 = 0x54
sizeofIfDataFreeBSD11 = 0x98
// MODIFIED BY HAND FOR 386 EMULATION ON AMD64
// 386 EMULATION USES THE UNDERLYING RAW DATA LAYOUT
sizeofIfMsghdrlFreeBSD10Emu = 0xb0
sizeofIfaMsghdrFreeBSD10Emu = 0x14
sizeofIfaMsghdrlFreeBSD10Emu = 0xb0
sizeofIfmaMsghdrFreeBSD10Emu = 0x10
sizeofIfAnnouncemsghdrFreeBSD10Emu = 0x18
sizeofRtMsghdrFreeBSD10Emu = 0x98
sizeofRtMetricsFreeBSD10Emu = 0x70
sizeofIfMsghdrFreeBSD7Emu = 0xa8
sizeofIfMsghdrFreeBSD8Emu = 0xa8
sizeofIfMsghdrFreeBSD9Emu = 0xa8
sizeofIfMsghdrFreeBSD10Emu = 0xa8
sizeofIfMsghdrFreeBSD11Emu = 0xa8
sizeofIfDataFreeBSD7Emu = 0x98
sizeofIfDataFreeBSD8Emu = 0x98
sizeofIfDataFreeBSD9Emu = 0x98
sizeofIfDataFreeBSD10Emu = 0x98
sizeofIfDataFreeBSD11Emu = 0x98
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

52
vendor/golang.org/x/net/route/zsys_freebsd_amd64.go generated vendored Normal file
View File

@@ -0,0 +1,52 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_freebsd.go
package route
const (
sizeofIfMsghdrlFreeBSD10 = 0xb0
sizeofIfaMsghdrFreeBSD10 = 0x14
sizeofIfaMsghdrlFreeBSD10 = 0xb0
sizeofIfmaMsghdrFreeBSD10 = 0x10
sizeofIfAnnouncemsghdrFreeBSD10 = 0x18
sizeofRtMsghdrFreeBSD10 = 0x98
sizeofRtMetricsFreeBSD10 = 0x70
sizeofIfMsghdrFreeBSD7 = 0xa8
sizeofIfMsghdrFreeBSD8 = 0xa8
sizeofIfMsghdrFreeBSD9 = 0xa8
sizeofIfMsghdrFreeBSD10 = 0xa8
sizeofIfMsghdrFreeBSD11 = 0xa8
sizeofIfDataFreeBSD7 = 0x98
sizeofIfDataFreeBSD8 = 0x98
sizeofIfDataFreeBSD9 = 0x98
sizeofIfDataFreeBSD10 = 0x98
sizeofIfDataFreeBSD11 = 0x98
sizeofIfMsghdrlFreeBSD10Emu = 0xb0
sizeofIfaMsghdrFreeBSD10Emu = 0x14
sizeofIfaMsghdrlFreeBSD10Emu = 0xb0
sizeofIfmaMsghdrFreeBSD10Emu = 0x10
sizeofIfAnnouncemsghdrFreeBSD10Emu = 0x18
sizeofRtMsghdrFreeBSD10Emu = 0x98
sizeofRtMetricsFreeBSD10Emu = 0x70
sizeofIfMsghdrFreeBSD7Emu = 0xa8
sizeofIfMsghdrFreeBSD8Emu = 0xa8
sizeofIfMsghdrFreeBSD9Emu = 0xa8
sizeofIfMsghdrFreeBSD10Emu = 0xa8
sizeofIfMsghdrFreeBSD11Emu = 0xa8
sizeofIfDataFreeBSD7Emu = 0x98
sizeofIfDataFreeBSD8Emu = 0x98
sizeofIfDataFreeBSD9Emu = 0x98
sizeofIfDataFreeBSD10Emu = 0x98
sizeofIfDataFreeBSD11Emu = 0x98
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

52
vendor/golang.org/x/net/route/zsys_freebsd_arm.go generated vendored Normal file
View File

@@ -0,0 +1,52 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_freebsd.go
package route
const (
sizeofIfMsghdrlFreeBSD10 = 0x68
sizeofIfaMsghdrFreeBSD10 = 0x14
sizeofIfaMsghdrlFreeBSD10 = 0x6c
sizeofIfmaMsghdrFreeBSD10 = 0x10
sizeofIfAnnouncemsghdrFreeBSD10 = 0x18
sizeofRtMsghdrFreeBSD10 = 0x5c
sizeofRtMetricsFreeBSD10 = 0x38
sizeofIfMsghdrFreeBSD7 = 0x70
sizeofIfMsghdrFreeBSD8 = 0x70
sizeofIfMsghdrFreeBSD9 = 0x70
sizeofIfMsghdrFreeBSD10 = 0x70
sizeofIfMsghdrFreeBSD11 = 0xa8
sizeofIfDataFreeBSD7 = 0x60
sizeofIfDataFreeBSD8 = 0x60
sizeofIfDataFreeBSD9 = 0x60
sizeofIfDataFreeBSD10 = 0x60
sizeofIfDataFreeBSD11 = 0x98
sizeofIfMsghdrlFreeBSD10Emu = 0x68
sizeofIfaMsghdrFreeBSD10Emu = 0x14
sizeofIfaMsghdrlFreeBSD10Emu = 0x6c
sizeofIfmaMsghdrFreeBSD10Emu = 0x10
sizeofIfAnnouncemsghdrFreeBSD10Emu = 0x18
sizeofRtMsghdrFreeBSD10Emu = 0x5c
sizeofRtMetricsFreeBSD10Emu = 0x38
sizeofIfMsghdrFreeBSD7Emu = 0x70
sizeofIfMsghdrFreeBSD8Emu = 0x70
sizeofIfMsghdrFreeBSD9Emu = 0x70
sizeofIfMsghdrFreeBSD10Emu = 0x70
sizeofIfMsghdrFreeBSD11Emu = 0xa8
sizeofIfDataFreeBSD7Emu = 0x60
sizeofIfDataFreeBSD8Emu = 0x60
sizeofIfDataFreeBSD9Emu = 0x60
sizeofIfDataFreeBSD10Emu = 0x60
sizeofIfDataFreeBSD11Emu = 0x98
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

52
vendor/golang.org/x/net/route/zsys_freebsd_arm64.go generated vendored Normal file
View File

@@ -0,0 +1,52 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_freebsd.go
package route
const (
sizeofIfMsghdrlFreeBSD10 = 0xb0
sizeofIfaMsghdrFreeBSD10 = 0x14
sizeofIfaMsghdrlFreeBSD10 = 0xb0
sizeofIfmaMsghdrFreeBSD10 = 0x10
sizeofIfAnnouncemsghdrFreeBSD10 = 0x18
sizeofRtMsghdrFreeBSD10 = 0x98
sizeofRtMetricsFreeBSD10 = 0x70
sizeofIfMsghdrFreeBSD7 = 0xa8
sizeofIfMsghdrFreeBSD8 = 0xa8
sizeofIfMsghdrFreeBSD9 = 0xa8
sizeofIfMsghdrFreeBSD10 = 0xa8
sizeofIfMsghdrFreeBSD11 = 0xa8
sizeofIfDataFreeBSD7 = 0x98
sizeofIfDataFreeBSD8 = 0x98
sizeofIfDataFreeBSD9 = 0x98
sizeofIfDataFreeBSD10 = 0x98
sizeofIfDataFreeBSD11 = 0x98
sizeofIfMsghdrlFreeBSD10Emu = 0xb0
sizeofIfaMsghdrFreeBSD10Emu = 0x14
sizeofIfaMsghdrlFreeBSD10Emu = 0xb0
sizeofIfmaMsghdrFreeBSD10Emu = 0x10
sizeofIfAnnouncemsghdrFreeBSD10Emu = 0x18
sizeofRtMsghdrFreeBSD10Emu = 0x98
sizeofRtMetricsFreeBSD10Emu = 0x70
sizeofIfMsghdrFreeBSD7Emu = 0xa8
sizeofIfMsghdrFreeBSD8Emu = 0xa8
sizeofIfMsghdrFreeBSD9Emu = 0xa8
sizeofIfMsghdrFreeBSD10Emu = 0xa8
sizeofIfMsghdrFreeBSD11Emu = 0xa8
sizeofIfDataFreeBSD7Emu = 0x98
sizeofIfDataFreeBSD8Emu = 0x98
sizeofIfDataFreeBSD9Emu = 0x98
sizeofIfDataFreeBSD10Emu = 0x98
sizeofIfDataFreeBSD11Emu = 0x98
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

52
vendor/golang.org/x/net/route/zsys_freebsd_riscv64.go generated vendored Normal file
View File

@@ -0,0 +1,52 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_freebsd.go
package route
const (
sizeofIfMsghdrlFreeBSD10 = 0xb0
sizeofIfaMsghdrFreeBSD10 = 0x14
sizeofIfaMsghdrlFreeBSD10 = 0xb0
sizeofIfmaMsghdrFreeBSD10 = 0x10
sizeofIfAnnouncemsghdrFreeBSD10 = 0x18
sizeofRtMsghdrFreeBSD10 = 0x98
sizeofRtMetricsFreeBSD10 = 0x70
sizeofIfMsghdrFreeBSD7 = 0xa8
sizeofIfMsghdrFreeBSD8 = 0xa8
sizeofIfMsghdrFreeBSD9 = 0xa8
sizeofIfMsghdrFreeBSD10 = 0xa8
sizeofIfMsghdrFreeBSD11 = 0xa8
sizeofIfDataFreeBSD7 = 0x98
sizeofIfDataFreeBSD8 = 0x98
sizeofIfDataFreeBSD9 = 0x98
sizeofIfDataFreeBSD10 = 0x98
sizeofIfDataFreeBSD11 = 0x98
sizeofIfMsghdrlFreeBSD10Emu = 0xb0
sizeofIfaMsghdrFreeBSD10Emu = 0x14
sizeofIfaMsghdrlFreeBSD10Emu = 0xb0
sizeofIfmaMsghdrFreeBSD10Emu = 0x10
sizeofIfAnnouncemsghdrFreeBSD10Emu = 0x18
sizeofRtMsghdrFreeBSD10Emu = 0x98
sizeofRtMetricsFreeBSD10Emu = 0x70
sizeofIfMsghdrFreeBSD7Emu = 0xa8
sizeofIfMsghdrFreeBSD8Emu = 0xa8
sizeofIfMsghdrFreeBSD9Emu = 0xa8
sizeofIfMsghdrFreeBSD10Emu = 0xa8
sizeofIfMsghdrFreeBSD11Emu = 0xa8
sizeofIfDataFreeBSD7Emu = 0x98
sizeofIfDataFreeBSD8Emu = 0x98
sizeofIfDataFreeBSD9Emu = 0x98
sizeofIfDataFreeBSD10Emu = 0x98
sizeofIfDataFreeBSD11Emu = 0x98
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

17
vendor/golang.org/x/net/route/zsys_netbsd.go generated vendored Normal file
View File

@@ -0,0 +1,17 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_netbsd.go
package route
const (
sizeofIfMsghdrNetBSD7 = 0x98
sizeofIfaMsghdrNetBSD7 = 0x18
sizeofIfAnnouncemsghdrNetBSD7 = 0x18
sizeofRtMsghdrNetBSD7 = 0x78
sizeofRtMetricsNetBSD7 = 0x50
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)

12
vendor/golang.org/x/net/route/zsys_openbsd.go generated vendored Normal file
View File

@@ -0,0 +1,12 @@
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs defs_openbsd.go
package route
const (
sizeofRtMsghdr = 0x60
sizeofSockaddrStorage = 0x100
sizeofSockaddrInet = 0x10
sizeofSockaddrInet6 = 0x1c
)