Update deps

This commit is contained in:
Frank Denis 2019-11-05 01:32:38 +01:00
parent b76db70a6c
commit e6a4a4ffda
10 changed files with 4850 additions and 18 deletions

8
go.mod
View File

@ -6,7 +6,7 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/VividCortex/ewma v1.1.1
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
github.com/facebookgo/pidfile v0.0.0-20150612191647-f242e2999868
@ -17,12 +17,12 @@ require (
github.com/jedisct1/go-dnsstamps v0.0.0-20191014084838-3e6e00f2b602
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e
github.com/jedisct1/xsecretbox v0.0.0-20190909160646-b731c21297f9
github.com/k-sone/critbitgo v1.3.0
github.com/k-sone/critbitgo v1.4.0
github.com/kardianos/service v1.0.0
github.com/miekg/dns v1.1.22
golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v2 v2.2.2 // indirect
)

16
go.sum
View File

@ -8,8 +8,8 @@ github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyY
github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 h1:3T8ZyTDp5QxTx3NU48JVb2u+75xc040fofcBaN+6jPA=
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185/go.mod h1:cFRxtTwTOJkz2x3rQUNCYKWC93yP1VKjR8NUhqFxZNU=
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A=
@ -35,8 +35,8 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e h1:UvSe12bq+U
github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU=
github.com/jedisct1/xsecretbox v0.0.0-20190909160646-b731c21297f9 h1:nGfB2s9K0GyHuNkJmXkIjP+m7je6Q6gjirr+weAEtDo=
github.com/jedisct1/xsecretbox v0.0.0-20190909160646-b731c21297f9/go.mod h1:MipBKo+gZlzpd1JXA1OliuwvtQizlFeu4aMAyTLh8bo=
github.com/k-sone/critbitgo v1.3.0 h1:e9OeQIJUtklj0WnAXsonS2JlMRk0nRN4wKiexmJsXTI=
github.com/k-sone/critbitgo v1.3.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s=
github.com/k-sone/critbitgo v1.4.0 h1:l71cTyBGeh6X5ATh6Fibgw3+rtNT80BA0uNNWgkPrbE=
github.com/k-sone/critbitgo v1.4.0/go.mod h1:7E6pyoyADnFxlUBEKcnfS49b7SUAQGMK+OAp/UQvo0s=
github.com/kardianos/service v1.0.0 h1:HgQS3mFfOlyntWX8Oke98JcJLqt1DBcHR4kxShpYef0=
github.com/kardianos/service v1.0.0/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
github.com/miekg/dns v1.1.22 h1:Jm64b3bO9kP43ddLjL2EY3Io6bmy1qGb9Xxz6TqS6rc=
@ -50,8 +50,8 @@ golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf/go.mod h1:LzIPMQfyMNhhGPh
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-20191028085509-fe3aa8a45271 h1:N66aaryRB3Ax92gH0v3hp1QYZ3zWWCCUR/j8Ifh45Ss=
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 h1:DPz9iiH3YoKiKhX/ijjoZvT0VFwK2c6CWYWQ7Zyr8TU=
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -61,8 +61,8 @@ golang.org/x/sys v0.0.0-20190909082730-f460065e899a h1:mIzbOulag9/gXacgxKlFVwpCO
golang.org/x/sys v0.0.0-20190909082730-f460065e899a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c h1:S/FtSvpNLtFBgjTqcKsRpsa6aVsI6iztaz1bQd9BJwE=
golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 h1:ZJUmhYTp8GbGC0ViZRc2U+MIYQ8xx9MscsdXnclfIhw=
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=

View File

@ -1,3 +1,10 @@
## 1.4.0 (2019/11/02)
- Add Net.WalkPrefix [#10](https://github.com/k-sone/critbitgo/pull/10)
- Add Net.WalkMatch [#11](https://github.com/k-sone/critbitgo/pull/11)
- Fix Allprefixed [#12](https://github.com/k-sone/critbitgo/pull/12)
- Make Walk API handle empty trie [#13](https://github.com/k-sone/critbitgo/pull/13)
## 1.3.0 (2019/09/30)
- Add Net.Walk [#9](https://github.com/k-sone/critbitgo/pull/9)

View File

@ -244,7 +244,7 @@ func (t *Trie) Allprefixed(prefix []byte, handle func(key []byte, value interfac
}
// check prefix
if !bytes.Contains(p.external.key, prefix) {
if !bytes.HasPrefix(p.external.key, prefix) {
return true
}
}
@ -297,6 +297,9 @@ func longestPrefix(n *node, key []byte) ([]byte, interface{}, bool) {
// Iterating elements from a given start key.
// handle is called with arguments key and value (if handle returns `false`, the iteration is aborted)
func (t *Trie) Walk(start []byte, handle func(key []byte, value interface{}) bool) bool {
if t.size == 0 {
return true
}
var seek bool
if start != nil {
seek = true

View File

@ -203,6 +203,74 @@ func (n *Net) Walk(r *net.IPNet, handle func(*net.IPNet, interface{}) bool) {
})
}
// WalkPrefix interates routes that have a given prefix.
// handle is called with arguments route and value (if handle returns `false`, the iteration is aborted)
func (n *Net) WalkPrefix(r *net.IPNet, handle func(*net.IPNet, interface{}) bool) {
var prefix []byte
var div int
var bit uint
if r != nil {
if ip, _, err := netValidateIPNet(r); err == nil {
prefix = netIPNetToKey(ip, r.Mask)
mask := prefix[len(prefix)-1]
div = int(mask >> 3)
if mod := uint(mask & 0x07); mod != 0 {
bit = 8 - mod
}
}
}
wrapper := func(key []byte, value interface{}) bool {
if bit != 0 {
if prefix[div]>>bit != key[div]>>bit {
return false
}
}
return handle(netKeyToIPNet(key), value)
}
n.trie.Allprefixed(prefix[0:div], wrapper)
}
func walkMatch(p *node, key []byte, handle func(*net.IPNet, interface{}) bool) bool {
if p.internal != nil {
if !walkMatch(&p.internal.child[0], key, handle) {
return false
}
if p.internal.offset >= len(key)-1 || key[p.internal.offset]&p.internal.bit > 0 {
return walkMatch(&p.internal.child[1], key, handle)
}
return true
}
mask := p.external.key[len(p.external.key)-1]
if key[len(key)-1] < mask {
return true
}
div := int(mask >> 3)
for i := 0; i < div; i++ {
if p.external.key[i] != key[i] {
return true
}
}
if mod := uint(mask & 0x07); mod > 0 {
bit := 8 - mod
if p.external.key[div] != key[div]&(0xff>>bit<<bit) {
return true
}
}
return handle(netKeyToIPNet(p.external.key), p.external.value)
}
// WalkMatch interates routes that match a given route.
// handle is called with arguments route and value (if handle returns `false`, the iteration is aborted)
func (n *Net) WalkMatch(r *net.IPNet, handle func(*net.IPNet, interface{}) bool) {
if n.trie.size > 0 {
walkMatch(&n.trie.root, netIPNetToKey(r.IP, r.Mask), handle)
}
}
// Deletes all routes.
func (n *Net) Clear() {
n.trie.Clear()

View File

@ -1,6 +1,6 @@
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
// +build go1.13
// +build go1.13,!go1.14
package idna

4733
vendor/golang.org/x/net/idna/tables12.00.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -314,6 +314,9 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys rtlGetVersion(info *OsVersionInfoEx) (ret error) = ntdll.RtlGetVersion
//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers
// Process Status API (PSAPI)
//sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses
// syscall interface implementation for other packages
// GetCurrentProcess returns the handle for the current process.

View File

@ -44,6 +44,7 @@ var (
moduser32 = NewLazySystemDLL("user32.dll")
modole32 = NewLazySystemDLL("ole32.dll")
modntdll = NewLazySystemDLL("ntdll.dll")
modpsapi = NewLazySystemDLL("psapi.dll")
modws2_32 = NewLazySystemDLL("ws2_32.dll")
moddnsapi = NewLazySystemDLL("dnsapi.dll")
modiphlpapi = NewLazySystemDLL("iphlpapi.dll")
@ -247,6 +248,7 @@ var (
procCoTaskMemFree = modole32.NewProc("CoTaskMemFree")
procRtlGetVersion = modntdll.NewProc("RtlGetVersion")
procRtlGetNtVersionNumbers = modntdll.NewProc("RtlGetNtVersionNumbers")
procEnumProcesses = modpsapi.NewProc("EnumProcesses")
procWSAStartup = modws2_32.NewProc("WSAStartup")
procWSACleanup = modws2_32.NewProc("WSACleanup")
procWSAIoctl = modws2_32.NewProc("WSAIoctl")
@ -2758,6 +2760,22 @@ func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNum
return
}
func EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) {
var _p0 *uint32
if len(processIds) > 0 {
_p0 = &processIds[0]
}
r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(processIds)), uintptr(unsafe.Pointer(bytesReturned)))
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
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 {

8
vendor/modules.txt vendored
View File

@ -9,7 +9,7 @@ github.com/aead/poly1305
# github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412
github.com/agl/ed25519
github.com/agl/ed25519/edwards25519
# github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
# github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/coreos/go-systemd/activation
github.com/coreos/go-systemd/daemon
# github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185
@ -35,7 +35,7 @@ github.com/jedisct1/go-dnsstamps
github.com/jedisct1/go-minisign
# github.com/jedisct1/xsecretbox v0.0.0-20190909160646-b731c21297f9
github.com/jedisct1/xsecretbox
# github.com/k-sone/critbitgo v1.3.0
# github.com/k-sone/critbitgo v1.4.0
github.com/k-sone/critbitgo
# github.com/kardianos/service v1.0.0
github.com/kardianos/service
@ -50,7 +50,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-20191028085509-fe3aa8a45271
# golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9
golang.org/x/net/bpf
golang.org/x/net/http/httpguts
golang.org/x/net/http2
@ -62,7 +62,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-20191029155521-f43be2a4598c
# golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6
golang.org/x/sys/cpu
golang.org/x/sys/unix
golang.org/x/sys/windows