Update miekg/dns

This commit is contained in:
Frank Denis 2021-02-24 15:38:04 +01:00
parent 34909babfb
commit 1ae2281588
39 changed files with 274 additions and 29 deletions

8
go.mod
View File

@ -1,6 +1,6 @@
module github.com/DNSCrypt/dnscrypt-proxy
go 1.16
go 1.17
require (
github.com/BurntSushi/toml v0.3.1
@ -17,11 +17,11 @@ require (
github.com/jedisct1/xsecretbox v0.0.0-20210102102453-4ecb2081017a
github.com/k-sone/critbitgo v1.4.0
github.com/kardianos/service v1.2.0
github.com/miekg/dns v1.1.38
github.com/miekg/dns v1.1.39
github.com/powerman/check v1.3.1
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
golang.org/x/sys v0.0.0-20210223212115-eede4237b368
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.4.0 // indirect
)

12
go.sum
View File

@ -64,8 +64,8 @@ github.com/k-sone/critbitgo v1.4.0 h1:l71cTyBGeh6X5ATh6Fibgw3+rtNT80BA0uNNWgkPrb
github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s=
github.com/kardianos/service v1.2.0 h1:bGuZ/epo3vrt8IPC7mnKQolqFeYJb7Cs8Rk4PSOBB/g=
github.com/kardianos/service v1.2.0/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
github.com/miekg/dns v1.1.38 h1:MtIY+fmHUVVgv1AXzmKMWcwdCYxTRPG1EDjpqF4RCEw=
github.com/miekg/dns v1.1.38/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.39 h1:6dRfDGnHiXOMmTZkwWANy7bBXXlKls5Qu+pn+Ue0TLo=
github.com/miekg/dns v1.1.39/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@ -95,8 +95,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d h1:1aflnvSoWWLI2k/dMUAl5lvU1YO4Mb4hz0gh+1rjcxU=
golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM=
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -112,8 +112,8 @@ golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 h1:SgQ6LNaYJU0JIuEHv9+s6EbhSCwYeAf5Yvj6lpYlqAE=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210223212115-eede4237b368 h1:fDE3p0qf2V1co1vfj3/o87Ps8Hq6QTGNxJ5Xe7xSp80=
golang.org/x/sys v0.0.0-20210223212115-eede4237b368/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

View File

@ -71,6 +71,8 @@ A not-so-up-to-date-list-that-may-be-actually-current:
* https://github.com/fortio/dnsping
* https://github.com/Luzilla/dnsbl_exporter
* https://github.com/bodgit/tsig
* https://github.com/v2fly/v2ray-core (test only)
Send pull request if you want to be listed here.
@ -167,6 +169,8 @@ Example programs can be found in the `github.com/miekg/exdns` repository.
* 7873 - Domain Name System (DNS) Cookies
* 8080 - EdDSA for DNSSEC
* 8499 - DNS Terminology
* 8659 - DNS Certification Authority Authorization (CAA) Resource Record
* 8976 - Message Digest for DNS Zones (ZONEMD RR)
## Loosely Based Upon

View File

@ -340,11 +340,10 @@ func (co *Conn) Write(p []byte) (int, error) {
return co.Conn.Write(p)
}
l := make([]byte, 2)
binary.BigEndian.PutUint16(l, uint16(len(p)))
n, err := (&net.Buffers{l, p}).WriteTo(co.Conn)
return int(n), err
msg := make([]byte, 2+len(p))
binary.BigEndian.PutUint16(msg, uint16(len(p)))
copy(msg[2:], p)
return co.Conn.Write(msg)
}
// Return the appropriate timeout for a specific request

View File

@ -8,6 +8,11 @@ package dns
// record adding as many records as possible without exceeding the
// requested buffer size.
//
// If the message fits within the requested size without compression,
// Truncate will set the message's Compress attribute to false. It is
// the caller's responsibility to set it back to true if they wish to
// compress the payload regardless of size.
//
// The TC bit will be set if any records were excluded from the message.
// If the TC bit is already set on the message it will be retained.
// TC indicates that the client should retry over TCP.

View File

@ -752,11 +752,10 @@ func (w *response) Write(m []byte) (int, error) {
return 0, &Error{err: "message too large"}
}
l := make([]byte, 2)
binary.BigEndian.PutUint16(l, uint16(len(m)))
n, err := (&net.Buffers{l, m}).WriteTo(w.tcp)
return int(n), err
msg := make([]byte, 2+len(m))
binary.BigEndian.PutUint16(msg, uint16(len(m)))
copy(msg[2:], m)
return w.tcp.Write(msg)
default:
panic("dns: internal error: udp and tcp both nil")
}

View File

@ -3,7 +3,7 @@ package dns
import "fmt"
// Version is current version of this library.
var Version = v{1, 1, 38}
var Version = v{1, 1, 39}
// v holds the version of this library.
type v struct {

View File

@ -9,7 +9,6 @@ package socket
import (
"os"
"runtime"
"syscall"
)
@ -26,7 +25,7 @@ func (c *Conn) recvMsg(m *Message, flags int) error {
var n int
fn := func(s uintptr) bool {
n, operr = recvmsg(s, &h, flags)
if operr == syscall.EAGAIN || (runtime.GOOS == "zos" && operr == syscall.EWOULDBLOCK) {
if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK {
return false
}
return true
@ -63,7 +62,7 @@ func (c *Conn) sendMsg(m *Message, flags int) error {
var n int
fn := func(s uintptr) bool {
n, operr = sendmsg(s, &h, flags)
if operr == syscall.EAGAIN || (runtime.GOOS == "zos" && operr == syscall.EWOULDBLOCK) {
if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK {
return false
}
return true

View File

@ -115,6 +115,7 @@ includes_FreeBSD='
#include <sys/sched.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/sockio.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
@ -214,6 +215,7 @@ struct ltchars {
#include <linux/fsverity.h>
#include <linux/genetlink.h>
#include <linux/hdreg.h>
#include <linux/hidraw.h>
#include <linux/icmpv6.h>
#include <linux/if.h>
#include <linux/if_addr.h>
@ -224,6 +226,7 @@ struct ltchars {
#include <linux/if_tun.h>
#include <linux/if_packet.h>
#include <linux/if_xdp.h>
#include <linux/input.h>
#include <linux/kexec.h>
#include <linux/keyctl.h>
#include <linux/loop.h>
@ -300,6 +303,17 @@ struct ltchars {
// Including linux/l2tp.h here causes conflicts between linux/in.h
// and netinet/in.h included via net/route.h above.
#define IPPROTO_L2TP 115
// Copied from linux/hid.h.
// Keep in sync with the size of the referenced fields.
#define _HIDIOCGRAWNAME_LEN 128 // sizeof_field(struct hid_device, name)
#define _HIDIOCGRAWPHYS_LEN 64 // sizeof_field(struct hid_device, phys)
#define _HIDIOCGRAWUNIQ_LEN 64 // sizeof_field(struct hid_device, uniq)
#define _HIDIOCGRAWNAME HIDIOCGRAWNAME(_HIDIOCGRAWNAME_LEN)
#define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN)
#define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN)
'
includes_NetBSD='
@ -447,6 +461,8 @@ ccflags="$@"
$2 !~ /^EPROC_/ &&
$2 !~ /^EQUIV_/ &&
$2 !~ /^EXPR_/ &&
$2 !~ /^EVIOC/ &&
$2 !~ /^EV_/ &&
$2 ~ /^E[A-Z0-9_]+$/ ||
$2 ~ /^B[0-9_]+$/ ||
$2 ~ /^(OLD|NEW)DEV$/ ||
@ -481,7 +497,7 @@ ccflags="$@"
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ ||
$2 ~ /^TP_STATUS_/ ||
$2 ~ /^FALLOC_/ ||
$2 == "ICMPV6_FILTER" ||
@ -571,6 +587,9 @@ ccflags="$@"
$2 ~ /^W[A-Z0-9]+$/ ||
$2 ~/^PPPIOC/ ||
$2 ~ /^FAN_|FANOTIFY_/ ||
$2 == "HID_MAX_DESCRIPTOR_SIZE" ||
$2 ~ /^_?HIDIOC/ ||
$2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ ||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
$2 ~ /^__WCOREFLAG$/ {next}
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}

View File

@ -382,7 +382,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively.
func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
x := new(Xucred)
vallen := _Socklen(unsafe.Sizeof(Xucred{}))
vallen := _Socklen(SizeofXucred)
err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen)
return x, err
}

View File

@ -126,6 +126,15 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
}
// GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct.
// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively.
func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
x := new(Xucred)
vallen := _Socklen(SizeofXucred)
err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen)
return x, err
}
func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny

View File

@ -153,6 +153,36 @@ func IoctlWatchdogKeepalive(fd int) error {
return ioctl(fd, WDIOC_KEEPALIVE, 0)
}
func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value)))
runtime.KeepAlive(value)
return err
}
func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
var value HIDRawDevInfo
err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value)))
return &value, err
}
func IoctlHIDGetRawName(fd int) (string, error) {
var value [_HIDIOCGRAWNAME_LEN]byte
err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0])))
return ByteSliceToString(value[:]), err
}
func IoctlHIDGetRawPhys(fd int) (string, error) {
var value [_HIDIOCGRAWPHYS_LEN]byte
err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0])))
return ByteSliceToString(value[:]), err
}
func IoctlHIDGetRawUniq(fd int) (string, error) {
var value [_HIDIOCGRAWUNIQ_LEN]byte
err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0])))
return ByteSliceToString(value[:]), err
}
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
func Link(oldpath string, newpath string) (err error) {

View File

@ -998,6 +998,11 @@ const (
KERN_OSRELEASE = 0x2
KERN_OSTYPE = 0x1
KERN_VERSION = 0x4
LOCAL_CONNWAIT = 0x4
LOCAL_CREDS = 0x2
LOCAL_CREDS_PERSISTENT = 0x3
LOCAL_PEERCRED = 0x1
LOCAL_VENDOR = 0x80000000
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
@ -1376,6 +1381,7 @@ const (
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_LOCAL = 0x0
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2

View File

@ -998,6 +998,11 @@ const (
KERN_OSRELEASE = 0x2
KERN_OSTYPE = 0x1
KERN_VERSION = 0x4
LOCAL_CONNWAIT = 0x4
LOCAL_CREDS = 0x2
LOCAL_CREDS_PERSISTENT = 0x3
LOCAL_PEERCRED = 0x1
LOCAL_VENDOR = 0x80000000
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
@ -1377,6 +1382,7 @@ const (
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_LOCAL = 0x0
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2

View File

@ -981,6 +981,11 @@ const (
KERN_OSRELEASE = 0x2
KERN_OSTYPE = 0x1
KERN_VERSION = 0x4
LOCAL_CONNWAIT = 0x4
LOCAL_CREDS = 0x2
LOCAL_CREDS_PERSISTENT = 0x3
LOCAL_PEERCRED = 0x1
LOCAL_VENDOR = 0x80000000
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
@ -1342,6 +1347,7 @@ const (
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_LOCAL = 0x0
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2

View File

@ -998,6 +998,11 @@ const (
KERN_OSRELEASE = 0x2
KERN_OSTYPE = 0x1
KERN_VERSION = 0x4
LOCAL_CONNWAIT = 0x4
LOCAL_CREDS = 0x2
LOCAL_CREDS_PERSISTENT = 0x3
LOCAL_PEERCRED = 0x1
LOCAL_VENDOR = 0x80000000
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
@ -1377,6 +1382,7 @@ const (
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_LOCAL = 0x0
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2

View File

@ -245,6 +245,10 @@ const (
BS0 = 0x0
BTRFS_SUPER_MAGIC = 0x9123683e
BTRFS_TEST_MAGIC = 0x73727279
BUS_BLUETOOTH = 0x5
BUS_HIL = 0x4
BUS_USB = 0x3
BUS_VIRTUAL = 0x6
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@ -964,6 +968,7 @@ const (
HDIO_SET_XFER = 0x306
HDIO_TRISTATE_HWIF = 0x31b
HDIO_UNREGISTER_HWIF = 0x32a
HID_MAX_DESCRIPTOR_SIZE = 0x1000
HOSTFS_SUPER_MAGIC = 0xc0ffee
HPFS_SUPER_MAGIC = 0xf995e849
HUGETLBFS_MAGIC = 0x958458f6
@ -2736,6 +2741,9 @@ const (
Z3FOLD_MAGIC = 0x33
ZONEFS_MAGIC = 0x5a4f4653
ZSMALLOC_MAGIC = 0x58295829
_HIDIOCGRAWNAME_LEN = 0x80
_HIDIOCGRAWPHYS_LEN = 0x40
_HIDIOCGRAWUNIQ_LEN = 0x40
)
// Errors

View File

@ -94,6 +94,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -486,6 +489,9 @@ const (
X86_FXSR_MAGIC = 0x0
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -94,6 +94,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -486,6 +489,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -492,6 +495,9 @@ const (
WORDSIZE = 0x20
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -96,6 +96,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -483,6 +486,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x18
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x100
@ -488,6 +491,9 @@ const (
WORDSIZE = 0x20
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x18
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x100
@ -488,6 +491,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x18
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x100
@ -488,6 +491,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x18
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x100
@ -488,6 +491,9 @@ const (
WORDSIZE = 0x20
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x4000
ICANON = 0x100
IEXTEN = 0x400
@ -548,6 +551,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4000
XTABS = 0xc00
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x4000
ICANON = 0x100
IEXTEN = 0x400
@ -548,6 +551,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4000
XTABS = 0xc00
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -473,6 +476,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -93,6 +93,9 @@ const (
F_SETOWN = 0x8
F_UNLCK = 0x2
F_WRLCK = 0x1
HIDIOCGRAWINFO = 0x80084803
HIDIOCGRDESC = 0x90044802
HIDIOCGRDESCSIZE = 0x80044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -546,6 +549,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x80804804
_HIDIOCGRAWPHYS = 0x80404805
_HIDIOCGRAWUNIQ = 0x80404808
)
// Errors

View File

@ -97,6 +97,9 @@ const (
F_SETOWN = 0x6
F_UNLCK = 0x3
F_WRLCK = 0x2
HIDIOCGRAWINFO = 0x40084803
HIDIOCGRDESC = 0x50044802
HIDIOCGRDESCSIZE = 0x40044801
HUPCL = 0x400
ICANON = 0x2
IEXTEN = 0x8000
@ -536,6 +539,9 @@ const (
WORDSIZE = 0x40
XCASE = 0x4
XTABS = 0x1800
_HIDIOCGRAWNAME = 0x40804804
_HIDIOCGRAWPHYS = 0x40404805
_HIDIOCGRAWUNIQ = 0x40404808
__TIOCFLUSH = 0x80047410
)

View File

@ -251,6 +251,14 @@ type RawSockaddrAny struct {
type _Socklen uint32
type Xucred struct {
Version uint32
Uid uint32
Ngroups int16
Groups [16]uint32
_ *byte
}
type Linger struct {
Onoff int32
Linger int32
@ -313,6 +321,7 @@ const (
SizeofSockaddrAny = 0x6c
SizeofSockaddrUnix = 0x6a
SizeofSockaddrDatalink = 0x36
SizeofXucred = 0x50
SizeofLinger = 0x8
SizeofIovec = 0x8
SizeofIPMreq = 0x8

View File

@ -247,6 +247,14 @@ type RawSockaddrAny struct {
type _Socklen uint32
type Xucred struct {
Version uint32
Uid uint32
Ngroups int16
Groups [16]uint32
_ *byte
}
type Linger struct {
Onoff int32
Linger int32
@ -309,6 +317,7 @@ const (
SizeofSockaddrAny = 0x6c
SizeofSockaddrUnix = 0x6a
SizeofSockaddrDatalink = 0x36
SizeofXucred = 0x58
SizeofLinger = 0x8
SizeofIovec = 0x10
SizeofIPMreq = 0x8

View File

@ -249,6 +249,14 @@ type RawSockaddrAny struct {
type _Socklen uint32
type Xucred struct {
Version uint32
Uid uint32
Ngroups int16
Groups [16]uint32
_ *byte
}
type Linger struct {
Onoff int32
Linger int32
@ -311,6 +319,7 @@ const (
SizeofSockaddrAny = 0x6c
SizeofSockaddrUnix = 0x6a
SizeofSockaddrDatalink = 0x36
SizeofXucred = 0x50
SizeofLinger = 0x8
SizeofIovec = 0x8
SizeofIPMreq = 0x8

View File

@ -247,6 +247,14 @@ type RawSockaddrAny struct {
type _Socklen uint32
type Xucred struct {
Version uint32
Uid uint32
Ngroups int16
Groups [16]uint32
_ *byte
}
type Linger struct {
Onoff int32
Linger int32
@ -309,6 +317,7 @@ const (
SizeofSockaddrAny = 0x6c
SizeofSockaddrUnix = 0x6a
SizeofSockaddrDatalink = 0x36
SizeofXucred = 0x58
SizeofLinger = 0x8
SizeofIovec = 0x10
SizeofIPMreq = 0x8

View File

@ -3682,3 +3682,15 @@ const (
ETHTOOL_A_TUNNEL_INFO_UDP_PORTS = 0x2
ETHTOOL_A_TUNNEL_INFO_MAX = 0x2
)
type (
HIDRawReportDescriptor struct {
Size uint32
Value [4096]uint8
}
HIDRawDevInfo struct {
Bustype uint32
Vendor int16
Product int16
}
)

View File

@ -773,6 +773,7 @@ const socket_error = uintptr(^uint32(0))
//sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASend
//sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom
//sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo
//sys WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.WSASocketW
//sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname
//sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname
//sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs

View File

@ -1039,6 +1039,18 @@ type WSAMsg struct {
Flags uint32
}
// Flags for WSASocket
const (
WSA_FLAG_OVERLAPPED = 0x01
WSA_FLAG_MULTIPOINT_C_ROOT = 0x02
WSA_FLAG_MULTIPOINT_C_LEAF = 0x04
WSA_FLAG_MULTIPOINT_D_ROOT = 0x08
WSA_FLAG_MULTIPOINT_D_LEAF = 0x10
WSA_FLAG_ACCESS_SYSTEM_SECURITY = 0x40
WSA_FLAG_NO_HANDLE_INHERIT = 0x80
WSA_FLAG_REGISTERED_IO = 0x100
)
// Invented values to support what package os expects.
const (
S_IFMT = 0x1f000

View File

@ -370,6 +370,7 @@ var (
procWSARecvFrom = modws2_32.NewProc("WSARecvFrom")
procWSASend = modws2_32.NewProc("WSASend")
procWSASendTo = modws2_32.NewProc("WSASendTo")
procWSASocketW = modws2_32.NewProc("WSASocketW")
procWSAStartup = modws2_32.NewProc("WSAStartup")
procbind = modws2_32.NewProc("bind")
procclosesocket = modws2_32.NewProc("closesocket")
@ -3155,6 +3156,15 @@ func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32
return
}
func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) {
r0, _, e1 := syscall.Syscall6(procWSASocketW.Addr(), 6, uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags))
handle = Handle(r0)
if handle == InvalidHandle {
err = errnoErr(e1)
}
return
}
func WSAStartup(verreq uint32, data *WSAData) (sockerr error) {
r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0)
if r0 != 0 {

6
vendor/modules.txt vendored
View File

@ -57,7 +57,7 @@ github.com/k-sone/critbitgo
# github.com/kardianos/service v1.2.0
## explicit
github.com/kardianos/service
# github.com/miekg/dns v1.1.38
# github.com/miekg/dns v1.1.39
## explicit
github.com/miekg/dns
# github.com/pkg/errors v0.9.1
@ -81,7 +81,7 @@ golang.org/x/crypto/nacl/box
golang.org/x/crypto/nacl/secretbox
golang.org/x/crypto/poly1305
golang.org/x/crypto/salsa20/salsa
# golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d
# golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
## explicit
golang.org/x/net/bpf
golang.org/x/net/http/httpguts
@ -94,7 +94,7 @@ golang.org/x/net/internal/socks
golang.org/x/net/ipv4
golang.org/x/net/ipv6
golang.org/x/net/proxy
# golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43
# golang.org/x/sys v0.0.0-20210223212115-eede4237b368
## explicit
golang.org/x/sys/cpu
golang.org/x/sys/internal/unsafeheader