backend/tardigrade: Upgrade to uplink v1.1.1

This fixes issue #4370 by restoring the correct error response.
This commit is contained in:
Caleb Case 2020-06-18 16:20:56 -04:00 committed by Nick Craig-Wood
parent a55d882b7b
commit e780cda1d4
125 changed files with 14632 additions and 92919 deletions

4
go.mod
View File

@ -61,13 +61,13 @@ require (
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
golang.org/x/text v0.3.2
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/api v0.21.1-0.20200411000818-c8cf5cff125e
google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 // indirect
gopkg.in/yaml.v2 v2.2.8
storj.io/uplink v1.0.7
storj.io/uplink v1.1.1
)
go 1.14

20
go.sum
View File

@ -206,8 +206,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jlaffaye/ftp v0.0.0-20190624084859-c1312a7102bf/go.mod h1:lli8NYPQOFy3O++YmYbqVgOcQ1JPCwdOy+5zSjKJ9qY=
github.com/jlaffaye/ftp v0.0.0-20191218041957-e1b8fdd0dcc3 h1:QyB6CQGLB65Al72mAIbqrkGRk56JdGMHgBziM3F0FCw=
github.com/jlaffaye/ftp v0.0.0-20191218041957-e1b8fdd0dcc3/go.mod h1:PwUeyujmhaGohgOf0kJKxPfk3HcRv8QD/wAUN44go4k=
github.com/jlaffaye/ftp v0.0.0-20200422224957-b9f3ade29122 h1:dzYWuozdWNaY7mTQh5ZdmoJt2BUMavwhiux0AfGwg90=
github.com/jlaffaye/ftp v0.0.0-20200422224957-b9f3ade29122/go.mod h1:PwUeyujmhaGohgOf0kJKxPfk3HcRv8QD/wAUN44go4k=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
@ -356,8 +354,6 @@ github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:X
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1 h1:xHQewZjohU9/wUsyC99navCjQDNHtTgUOM/J1jAbzfw=
github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1/go.mod h1:7NL9UAYQnRM5iKHUCld3tf02fKb5Dft+41+VckASUy0=
github.com/spacemonkeygo/monkit/v3 v3.0.4/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drXFybgGmbc27tuwes=
github.com/spacemonkeygo/monkit/v3 v3.0.5/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drXFybgGmbc27tuwes=
github.com/spacemonkeygo/monkit/v3 v3.0.7-0.20200515175308-072401d8c752 h1:WcQDknqg0qajLNYKv3mXgbkWlYs5rPgZehGJFWePHVI=
@ -394,8 +390,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ=
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b h1:dLkqBELopfQNhe8S9ucnSf+HhiUCgK/hPIjVG0f9GlY=
github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b/go.mod h1:5oyMAv4hrBEKqBwORFsiqIrCNCmL2qcZLQTdJLYeYIc=
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 h1:zMsHhfK9+Wdl1F7sIKLyx3wrOFofpb3rWFbA4HgcK5k=
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3/go.mod h1:R0Gbuw7ElaGSLOZUSwBm/GgVwMd30jWxBDdAyMOeTuc=
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
@ -537,8 +533,8 @@ golang.org/x/sys v0.0.0-20200107144601-ef85f5a75ddf/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -657,9 +653,9 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
storj.io/common v0.0.0-20200529121635-ef4a5bc8ec88 h1:8Gy0vjF4Kj1n94n6mQrDU8T50W/rpwMI03udkATCUN0=
storj.io/common v0.0.0-20200529121635-ef4a5bc8ec88/go.mod h1:6S6Ub92/BB+ofU7hbyPcm96b4Q1ayyN0HLog+3u+wGc=
storj.io/common v0.0.0-20200611114417-9a3d012fdb62 h1:y8vGNQ0HjtD79G8MfCwbs6hct40tSBoDaOnsxWOZpU4=
storj.io/common v0.0.0-20200611114417-9a3d012fdb62/go.mod h1:6S6Ub92/BB+ofU7hbyPcm96b4Q1ayyN0HLog+3u+wGc=
storj.io/drpc v0.0.12 h1:4ei1M4cnWlYxcQheX0Dg4+c12zCD+oJqfweVQVWarsA=
storj.io/drpc v0.0.12/go.mod h1:82nfl+6YwRwF6UG31cEWWUqv/FaKvP5SGqUvoqTxCMA=
storj.io/uplink v1.0.7 h1:vI0csamiYsN2vTj17x4QUUQ8xyyFVQvNzxJjUsSEi7U=
storj.io/uplink v1.0.7/go.mod h1:PiLAqaFPUgsOs4u0xfVtm1jkWSQwdQmXv7KQUJUL/MU=
storj.io/uplink v1.1.1 h1:oa5uoDtZDT58e3vy9yp24HKU1EaLs4TRM75DS+ICtqs=
storj.io/uplink v1.1.1/go.mod h1:UkdYN/dfSgv+d8fBUoZTrX2oLdj9gzX6Q7tp3CojgKA=

View File

@ -1,6 +0,0 @@
language: go
go:
- 1.7
- 1.8
- tip

View File

@ -1,191 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,19 +0,0 @@
# errors [![Build Status](https://api.travis-ci.org/spacemonkeygo/errors.svg?branch=master)](https://travis-ci.org/spacemonkeygo/errors)
Please see http://godoc.org/github.com/spacemonkeygo/errors for info
### License
Copyright (C) 2014 Space Monkey, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,24 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package errors
// Config is a configuration struct meant to be used with
// github.com/spacemonkeygo/flagfile/utils.Setup
// but can be set independently.
var Config = struct {
Stacklogsize int `default:"4096" usage:"the max stack trace byte length to log"`
}{
Stacklogsize: 4096,
}

View File

@ -1,30 +0,0 @@
// Copyright (C) 2016 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build go1.7
// TODO: remove this build restriction once appengine supports 1.7
// +build !appengine
package errors
import (
"context"
)
var (
contextCanceled = context.Canceled
contextDeadlineExceeded = context.DeadlineExceeded
)

View File

@ -1,32 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package errors
import (
"sync/atomic"
)
var (
lastId int32 = 0
)
// DataKey's job is to make sure that keys in each error instances namespace
// are lexically scoped, thus helping developers not step on each others' toes
// between large packages. You can only store data on an error using a DataKey,
// and you can only make DataKeys with GenSym().
type DataKey struct{ id int32 }
// GenSym generates a brand new, never-before-seen DataKey
func GenSym() DataKey { return DataKey{id: atomic.AddInt32(&lastId, 1)} }

View File

@ -1,205 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Package errors is a flexible error support library for Go
Motivation
Go's standard library is intentionally sparse on providing error utilities, and
developers coming from other programming languages may miss some features they
took for granted [1]. This package is an attempt at providing those features in
an idiomatic Go way.
The main features this package provides (in addition to miscellaneous
utilities) are:
* Error hierarchies
* Stack traces
* Arbitrary error values
Error hierarchies
While Go has very deliberately not implemented class hierarchies, a quick
perusal of Go's net and os packages should indicate that sometimes error
hierarchies are useful. Go programmers should be familiar with the net.Error
interface (and the types that fulfill it) as well as the os helper functions
such as os.IsNotExist, os.IsPermission, etc.
Unfortunately, to implement something similar, a developer will have to
implement a struct that matches the error interface as well as any testing
methods or any more detailed interfaces they may choose to export. It's not
hard, but it is friction, and developers tend to use fmt.Errorf instead due
to ease of use, thus missing out on useful features that functions like
os.IsNotExist and friends provide.
The errors package provides reusable components for building similar
features while reducing friction as much as possible. With the errors package,
the os error handling routines can be mimicked as follows:
package osmimic
import (
"github.com/spacemonkeygo/errors"
)
var (
OSError = errors.NewClass("OS Error")
NotExist = OSError.NewClass("Not Exist")
)
func Open(path string) (*File, error) {
// actually do something here
return nil, NotExist.New("path %#v doesn't exist", path)
}
func MyMethod() error {
fh, err := Open(mypath)
if err != nil {
if NotExist.Contains(err) {
// file doesn't exist, do stuff
}
return err
}
// do stuff
}
Stack traces
It doesn't take long during Go development before you may find yourself
wondering where an error came from. In other languages, as soon as an error is
raised, a stack trace is captured and is displayed as part of the language's
error handling. Go error types are simply basic values and no such magic
happens to tell you what line or what stack an error came from.
The errors package fixes this by optionally (but by default) capturing the
stack trace as part of your error. This behavior can be turned off and on for
specific error classes and comes in two flavors. You can have the stack trace
be appended to the error's Error() message, or you can have the stack trace
be logged immediately, every time an error of that type is instantiated.
Every error and error class supports hierarchical settings, in the sense that
if a setting was not explicitly set on that error or error class, setting
resolution traverses the error class hierarchy until it finds a valid setting,
or returns the default.
See CaptureStack()/NoCaptureStack() and LogOnCreation()/NoLogOnCreation() for
how to control this feature.
Arbitrary error values
These hierarchical settings (for whether or not errors captured or logged stack
traces) were so useful, we generalized the system to allow users to extend
the errors system with their own values. A user can tag a specific error with
some value given a statically defined key, or tag a whole error class subtree.
Arbitrary error values can easily handle situtations like net.Error's
Temporary() field, where some errors are temporary and others aren't. This can
be mimicked as follows:
package netmimic
import (
"github.com/spacemonkeygo/errors"
)
var (
NetError = errors.NewClass("Net Error")
OpError = NetError.NewClass("Op Error")
tempErrorKey = errors.GenSym()
)
func SetIsTemporary() errors.ErrorOption {
return errors.SetData(tempErrorKey, true)
}
func IsTemporary(err error) bool {
v, ok := errors.GetData(err, tempErrorKey).(bool)
if !ok {
return false
}
return v
}
func NetworkOp() error {
// actually do something here
return OpError.NewWith("failed operation", SetIsTemporary())
}
func Example() error {
for {
err := NetworkOp()
if err != nil {
if IsTemporary(err) {
// probably should do exponential backoff
continue
}
return err
}
}
}
HTTP handling
Another great example of arbitrary error value functionality is the errhttp
subpackage. See the errhttp source for more examples of how to use
SetData/GetData.
The errhttp package really helped clean up our error code. Take a look to
see if it can help your error handling with HTTP stacks too.
http://godoc.org/github.com/spacemonkeygo/errors/errhttp
Exit recording
So you have stack traces, which tells you how the error was generated, but
perhaps you're interested in keeping track of how the error was handled?
Every time you call errors.Record(err), it adds the current line information
to the error's output. As an example:
func MyFunction() error {
err := Something()
if err != nil {
if IsTemporary(err) {
// manage the temporary error
return errors.Record(err)
} else {
// manage the permanent error
return errors.Record(err)
}
}
}
errors.Record will help you keep track of which error handling branch your
code took.
ErrorGroup
There's a few different types of ErrorGroup utilities in this package, but they
all work the same way. Make sure to check out the ErrorGroup example.
CatchPanic
CatchPanic helps you easily manage functions that you think might panic, and
instead return errors. CatchPanic works by taking a pointer to your named error
return value. Check out the CatchPanic example for more.
Footnotes
[1] This errors package started while porting a large Python codebase to Go.
https://www.spacemonkey.com/blog/posts/go-space-monkey
*/
package errors

View File

@ -1,648 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package errors
import (
"errors"
"fmt"
"io"
"net"
"os"
"path/filepath"
"runtime"
"strings"
)
var (
logOnCreation = GenSym()
captureStack = GenSym()
disableInheritance = GenSym()
)
// ErrorClass is the basic hierarchical error type. An ErrorClass generates
// actual errors, but the error class controls properties of the errors it
// generates, such as where those errors are in the hierarchy, whether or not
// they capture the stack on instantiation, and so forth.
type ErrorClass struct {
parent *ErrorClass
name string
data map[DataKey]interface{}
}
var (
// HierarchicalError is the base class for all hierarchical errors generated
// through this class.
HierarchicalError = &ErrorClass{
parent: nil,
name: "Error",
data: map[DataKey]interface{}{captureStack: true}}
// SystemError is the base error class for errors not generated through this
// errors library. It is not expected that anyone would ever generate new
// errors from a SystemError type or make subclasses.
SystemError = &ErrorClass{
parent: nil,
name: "System Error",
data: map[DataKey]interface{}{}}
)
// An ErrorOption is something that controls behavior of specific error
// instances. They can be set on ErrorClasses or errors individually.
type ErrorOption func(map[DataKey]interface{})
// SetData will take the given value and store it with the error or error class
// and its descendents associated with the given DataKey. Be sure to check out
// the example. value can be nil to disable values for subhierarchies.
func SetData(key DataKey, value interface{}) ErrorOption {
return func(m map[DataKey]interface{}) {
m[key] = value
}
}
// LogOnCreation tells the error class and its descendents to log the stack
// whenever an error of this class is created.
func LogOnCreation() ErrorOption {
return SetData(logOnCreation, true)
}
// CaptureStack tells the error class and its descendents to capture the stack
// whenever an error of this class is created, and output it as part of the
// error's Error() method. This is the default.
func CaptureStack() ErrorOption {
return SetData(captureStack, true)
}
// NoLogOnCreation is the opposite of LogOnCreation and applies to the error,
// class, and its descendents. This is the default.
func NoLogOnCreation() ErrorOption {
return SetData(logOnCreation, false)
}
// NoCaptureStack is the opposite of CaptureStack and applies to the error,
// class, and its descendents.
func NoCaptureStack() ErrorOption {
return SetData(captureStack, false)
}
// If DisableInheritance is provided, the error or error class will belong to
// its ancestors, but will not inherit their settings and options. Use with
// caution, and may disappear in future releases.
func DisableInheritance() ErrorOption {
return SetData(disableInheritance, true)
}
func boolWrapper(val interface{}, default_value bool) bool {
rv, ok := val.(bool)
if ok {
return rv
}
return default_value
}
// NewClass creates an error class with the provided name and options. Classes
// generated from this method and not *ErrorClass.NewClass will descend from
// the root HierarchicalError base class.
func NewClass(name string, options ...ErrorOption) *ErrorClass {
return HierarchicalError.NewClass(name, options...)
}
// New is for compatibility with the default Go errors package. It simply
// creates an error from the HierarchicalError root class.
func New(text string) error {
// NewWith doesn't take a format string, even though we have no options.
return HierarchicalError.NewWith(text)
}
// NewClass creates an error class with the provided name and options. The new
// class will descend from the receiver.
func (parent *ErrorClass) NewClass(name string,
options ...ErrorOption) *ErrorClass {
ec := &ErrorClass{
parent: parent,
name: name,
data: make(map[DataKey]interface{})}
for _, option := range options {
option(ec.data)
}
if !boolWrapper(ec.data[disableInheritance], false) {
// hoist options for speed
for key, val := range parent.data {
_, exists := ec.data[key]
if !exists {
ec.data[key] = val
}
}
return ec
} else {
delete(ec.data, disableInheritance)
}
return ec
}
// MustAddData allows adding data key value pairs to error classes after they
// are created. This is useful for allowing external packages add namespaced
// values to errors defined outside of their package. It will panic if the
// key is already set in the error class.
func (e *ErrorClass) MustAddData(key DataKey, value interface{}) {
if _, ex := e.data[key]; ex {
panic("key already exists")
}
e.data[key] = value
}
// GetData will return any data set on the error class for the given key. It
// returns nil if there is no data set for that key.
func (e *ErrorClass) GetData(key DataKey) interface{} {
return e.data[key]
}
// Parent returns this error class' direct ancestor.
func (e *ErrorClass) Parent() *ErrorClass {
return e.parent
}
// String returns this error class' name
func (e *ErrorClass) String() string {
if e == nil {
return "nil"
}
return e.name
}
// Is returns true if the receiver class is or is a descendent of parent.
func (e *ErrorClass) Is(parent *ErrorClass) bool {
for check := e; check != nil; check = check.parent {
if check == parent {
return true
}
}
return false
}
// frame logs the pc at some point during execution.
type frame struct {
pc uintptr
}
// String returns a human readable form of the frame.
func (e frame) String() string {
if e.pc == 0 {
return "unknown.unknown:0"
}
f := runtime.FuncForPC(e.pc)
if f == nil {
return "unknown.unknown:0"
}
file, line := f.FileLine(e.pc)
return fmt.Sprintf("%s:%s:%d", f.Name(), filepath.Base(file), line)
}
// callerState records the pc into an frame for two callers up.
func callerState(depth int) frame {
pc, _, _, ok := runtime.Caller(depth)
if !ok {
return frame{pc: 0}
}
return frame{pc: pc}
}
// record will record the pc at the given depth into the error if it is
// capable of recording it.
func record(err error, depth int) error {
if err == nil {
return nil
}
cast, ok := err.(*Error)
if !ok {
return err
}
cast.exits = append(cast.exits, callerState(depth))
return cast
}
// Record will record the current pc on the given error if possible, adding
// to the error's recorded exits list. Returns the given error argument.
func Record(err error) error {
return record(err, 3)
}
// RecordBefore will record the pc depth frames above the current stack frame
// on the given error if possible, adding to the error's recorded exits list.
// Record(err) is equivalent to RecordBefore(err, 0). Returns the given error
// argument.
func RecordBefore(err error, depth int) error {
return record(err, 3+depth)
}
// Error is the type that represents a specific error instance. It is not
// expected that you will work with *Error classes directly. Instead, you
// should use the 'error' interface and errors package methods that operate
// on errors instances.
type Error struct {
err error
class *ErrorClass
stacks [][]frame
exits []frame
data map[DataKey]interface{}
}
// GetData returns the value associated with the given DataKey on this error
// or any of its ancestors. Please see the example for SetData
func (e *Error) GetData(key DataKey) interface{} {
if e.data != nil {
val, ok := e.data[key]
if ok {
return val
}
if boolWrapper(e.data[disableInheritance], false) {
return nil
}
}
return e.class.data[key]
}
// GetData returns the value associated with the given DataKey on this error
// or any of its ancestors. Please see the example for SetData
func GetData(err error, key DataKey) interface{} {
cast, ok := err.(*Error)
if ok {
return cast.GetData(key)
}
return nil
}
func (e *ErrorClass) wrap(err error, classes []*ErrorClass,
options []ErrorOption) error {
if err == nil {
return nil
}
if ec, ok := err.(*Error); ok {
if ec.Is(e) {
if len(options) == 0 {
return ec
}
// if we have options, we have to wrap it cause we don't want to
// mutate the existing error.
} else {
for _, class := range classes {
if ec.Is(class) {
return err
}
}
}
}
rv := &Error{err: err, class: e}
if len(options) > 0 {
rv.data = make(map[DataKey]interface{})
for _, option := range options {
option(rv.data)
}
}
if boolWrapper(rv.GetData(captureStack), false) {
rv.stacks = [][]frame{getStack(3)}
}
if boolWrapper(rv.GetData(logOnCreation), false) {
LogWithStack(rv.Error())
}
return rv
}
func getStack(depth int) (stack []frame) {
var pcs [256]uintptr
amount := runtime.Callers(depth+1, pcs[:])
stack = make([]frame, amount)
for i := 0; i < amount; i++ {
stack[i] = frame{pcs[i]}
}
return stack
}
// AttachStack adds another stack to the current error's stack trace if it
// exists
func AttachStack(err error) {
if err == nil {
return
}
cast, ok := err.(*Error)
if !ok {
return
}
if len(cast.stacks) < 1 {
// only record stacks if this error was supposed to
return
}
cast.stacks = append(cast.stacks, getStack(2))
}
// WrapUnless wraps the given error in the receiver error class unless the
// error is already an instance of one of the provided error classes.
func (e *ErrorClass) WrapUnless(err error, classes ...*ErrorClass) error {
return e.wrap(err, classes, nil)
}
// Wrap wraps the given error in the receiver error class with the provided
// error-specific options.
func (e *ErrorClass) Wrap(err error, options ...ErrorOption) error {
return e.wrap(err, nil, options)
}
// New makes a new error type. It takes a format string.
func (e *ErrorClass) New(format string, args ...interface{}) error {
return e.wrap(fmt.Errorf(format, args...), nil, nil)
}
// NewWith makes a new error type with the provided error-specific options.
func (e *ErrorClass) NewWith(message string, options ...ErrorOption) error {
return e.wrap(errors.New(message), nil, options)
}
// Error conforms to the error interface. Error will return the backtrace if
// it was captured and any recorded exits.
func (e *Error) Error() string {
message := strings.TrimRight(e.err.Error(), "\n ")
if strings.Contains(message, "\n") {
message = fmt.Sprintf("%s:\n %s", e.class.String(),
strings.Replace(message, "\n", "\n ", -1))
} else {
message = fmt.Sprintf("%s: %s", e.class.String(), message)
}
if stack := e.Stack(); stack != "" {
message = fmt.Sprintf(
"%s\n\"%s\" backtrace:\n%s", message, e.class, stack)
}
if exits := e.Exits(); exits != "" {
message = fmt.Sprintf(
"%s\n\"%s\" exits:\n%s", message, e.class, exits)
}
return message
}
// Message returns just the error message without the backtrace or exits.
func (e *Error) Message() string {
message := strings.TrimRight(GetMessage(e.err), "\n ")
if strings.Contains(message, "\n") {
return fmt.Sprintf("%s:\n %s", e.class.String(),
strings.Replace(message, "\n", "\n ", -1))
}
return fmt.Sprintf("%s: %s", e.class.String(), message)
}
// WrappedErr returns the wrapped error, if the current error is simply
// wrapping some previously returned error or system error. You probably want
// the package-level WrappedErr
func (e *Error) WrappedErr() error {
return e.err
}
// WrappedErr returns the wrapped error, if the current error is simply
// wrapping some previously returned error or system error. If the error isn't
// hierarchical it is just returned.
func WrappedErr(err error) error {
cast, ok := err.(*Error)
if !ok {
return err
}
return cast.WrappedErr()
}
// Class will return the appropriate error class for the given error. You
// probably want the package-level GetClass.
func (e *Error) Class() *ErrorClass {
return e.class
}
// Name returns the name of the error: in this case the name of the class the
// error belongs to.
func (e *Error) Name() (string, bool) {
return e.class.name, true
}
// GetClass will return the appropriate error class for the given error.
// If the error is not nil, GetClass always returns a hierarchical error class,
// and even attempts to determine a class for common system error types.
func GetClass(err error) *ErrorClass {
if err == nil {
return nil
}
cast, ok := err.(*Error)
if !ok {
return findSystemErrorClass(err)
}
return cast.class
}
// Stack will return the stack associated with the error if one is found. You
// probably want the package-level GetStack.
func (e *Error) Stack() string {
if len(e.stacks) > 0 {
var frames []string
for _, stack := range e.stacks {
if frames == nil {
frames = make([]string, 0, len(stack))
} else {
frames = append(frames, "----- attached stack -----")
}
for _, f := range stack {
frames = append(frames, f.String())
}
}
return strings.Join(frames, "\n")
}
return ""
}
// GetStack will return the stack associated with the error if one is found.
func GetStack(err error) string {
if err == nil {
return ""
}
cast, ok := err.(*Error)
if !ok {
return ""
}
return cast.Stack()
}
// Exits will return the exits recorded on the error if any are found. You
// probably want the package-level GetExits.
func (e *Error) Exits() string {
if len(e.exits) > 0 {
exits := make([]string, len(e.exits))
for i, ex := range e.exits {
exits[i] = ex.String()
}
return strings.Join(exits, "\n")
}
return ""
}
// GetExits will return the exits recorded on the error if any are found.
func GetExits(err error) string {
if err == nil {
return ""
}
cast, ok := err.(*Error)
if !ok {
return ""
}
return cast.Exits()
}
// GetMessage returns just the error message without the backtrace or exits.
func GetMessage(err error) string {
if err == nil {
return ""
}
cast, ok := err.(*Error)
if !ok {
return err.Error()
}
return cast.Message()
}
// EquivalenceOption values control behavior of determining whether or not an
// error belongs to a specific class.
type EquivalenceOption int
const (
// If IncludeWrapped is used, wrapped errors are also used for determining
// class membership.
IncludeWrapped EquivalenceOption = 1
)
func combineEquivOpts(opts []EquivalenceOption) (rv EquivalenceOption) {
for _, opt := range opts {
rv |= opt
}
return rv
}
// Is returns whether or not an error belongs to a specific class. Typically
// you should use Contains instead.
func (e *Error) Is(ec *ErrorClass, opts ...EquivalenceOption) bool {
return ec.Contains(e, opts...)
}
// Contains returns whether or not the receiver error class contains the given
// error instance.
func (e *ErrorClass) Contains(err error, opts ...EquivalenceOption) bool {
if err == nil {
return false
}
cast, ok := err.(*Error)
if !ok {
return findSystemErrorClass(err).Is(e)
}
if cast.class.Is(e) {
return true
}
if combineEquivOpts(opts)&IncludeWrapped == 0 {
return false
}
return e.Contains(cast.err, opts...)
}
var (
// Useful error classes
NotImplementedError = NewClass("Not Implemented Error", LogOnCreation())
ProgrammerError = NewClass("Programmer Error", LogOnCreation())
PanicError = NewClass("Panic Error", LogOnCreation())
// The following SystemError descendants are provided such that the GetClass
// method has something to return for standard library error types not
// defined through this class.
//
// It is not expected that anyone would create instances of these classes.
//
// from os
SyscallError = SystemError.NewClass("Syscall Error")
// from syscall
ErrnoError = SystemError.NewClass("Errno Error")
// from net
NetworkError = SystemError.NewClass("Network Error")
UnknownNetworkError = NetworkError.NewClass("Unknown Network Error")
AddrError = NetworkError.NewClass("Addr Error")
InvalidAddrError = AddrError.NewClass("Invalid Addr Error")
NetOpError = NetworkError.NewClass("Network Op Error")
NetParseError = NetworkError.NewClass("Network Parse Error")
DNSError = NetworkError.NewClass("DNS Error")
DNSConfigError = DNSError.NewClass("DNS Config Error")
// from io
IOError = SystemError.NewClass("IO Error")
EOF = IOError.NewClass("EOF")
ClosedPipeError = IOError.NewClass("Closed Pipe Error")
NoProgressError = IOError.NewClass("No Progress Error")
ShortBufferError = IOError.NewClass("Short Buffer Error")
ShortWriteError = IOError.NewClass("Short Write Error")
UnexpectedEOFError = IOError.NewClass("Unexpected EOF Error")
// from context
ContextError = SystemError.NewClass("Context Error")
ContextCanceled = ContextError.NewClass("Canceled")
ContextTimeout = ContextError.NewClass("Timeout")
)
func findSystemErrorClass(err error) *ErrorClass {
switch err {
case io.EOF:
return EOF
case io.ErrUnexpectedEOF:
return UnexpectedEOFError
case io.ErrClosedPipe:
return ClosedPipeError
case io.ErrNoProgress:
return NoProgressError
case io.ErrShortBuffer:
return ShortBufferError
case io.ErrShortWrite:
return ShortWriteError
case contextCanceled:
return ContextCanceled
case contextDeadlineExceeded:
return ContextTimeout
default:
break
}
if isErrnoError(err) {
return ErrnoError
}
switch err.(type) {
case *os.SyscallError:
return SyscallError
case net.UnknownNetworkError:
return UnknownNetworkError
case *net.AddrError:
return AddrError
case net.InvalidAddrError:
return InvalidAddrError
case *net.OpError:
return NetOpError
case *net.ParseError:
return NetParseError
case *net.DNSError:
return DNSError
case *net.DNSConfigError:
return DNSConfigError
case net.Error:
return NetworkError
default:
return SystemError
}
}

View File

@ -1,26 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !appengine
package errors
import (
"syscall"
)
func isErrnoError(err error) bool {
_, ok := err.(syscall.Errno)
return ok
}

View File

@ -1,21 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build appengine
package errors
func isErrnoError(err error) bool {
return false
}

View File

@ -1,155 +0,0 @@
// Copyright (C) 2014 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package errors
import (
"fmt"
"log"
"runtime"
"strings"
)
var (
// Change this method if you want errors to log somehow else
LogMethod = log.Printf
ErrorGroupError = NewClass("Error Group Error")
)
// LogWithStack will log the given messages with the current stack
func LogWithStack(messages ...interface{}) {
buf := make([]byte, Config.Stacklogsize)
buf = buf[:runtime.Stack(buf, false)]
LogMethod("%s\n%s", fmt.Sprintln(messages...), buf)
}
// CatchPanic can be used to catch panics and turn them into errors. See the
// example.
func CatchPanic(err_ref *error) {
r := recover()
if r == nil {
return
}
err, ok := r.(error)
if ok {
*err_ref = PanicError.Wrap(err)
return
}
*err_ref = PanicError.New("%v", r)
}
// ErrorGroup is a type for collecting errors from a bunch of independent
// tasks. ErrorGroups are not threadsafe. See the example for usage.
type ErrorGroup struct {
Errors []error
limit int
excess int
}
// NewErrorGroup makes a new ErrorGroup
func NewErrorGroup() *ErrorGroup { return &ErrorGroup{} }
// NewBoundedErrorGroup makes a new ErrorGroup that will not track more than
// limit errors. Once the limit is reached, the ErrorGroup will track
// additional errors as excess.
func NewBoundedErrorGroup(limit int) *ErrorGroup {
return &ErrorGroup{
limit: limit,
}
}
// Add is called with errors. nil errors are ignored.
func (e *ErrorGroup) Add(err error) {
if err == nil {
return
}
if e.limit > 0 && len(e.Errors) == e.limit {
e.excess++
} else {
e.Errors = append(e.Errors, err)
}
}
// Finalize will collate all the found errors. If no errors were found, it will
// return nil. If one error was found, it will be returned directly. Otherwise
// an ErrorGroupError will be returned.
func (e *ErrorGroup) Finalize() error {
if len(e.Errors) == 0 {
return nil
}
if len(e.Errors) == 1 && e.excess == 0 {
return e.Errors[0]
}
msgs := make([]string, 0, len(e.Errors))
for _, err := range e.Errors {
msgs = append(msgs, err.Error())
}
if e.excess > 0 {
msgs = append(msgs, fmt.Sprintf("... and %d more.", e.excess))
e.excess = 0
}
e.Errors = nil
return ErrorGroupError.New(strings.Join(msgs, "\n"))
}
// LoggingErrorGroup is similar to ErrorGroup except that instead of collecting
// all of the errors, it logs the errors immediately and just counts how many
// non-nil errors have been seen. See the ErrorGroup example for usage.
type LoggingErrorGroup struct {
name string
total int
failed int
}
// NewLoggingErrorGroup returns a new LoggingErrorGroup with the given name.
func NewLoggingErrorGroup(name string) *LoggingErrorGroup {
return &LoggingErrorGroup{name: name}
}
// Add will handle a given error. If the error is non-nil, total and failed
// are both incremented and the error is logged. If the error is nil, only
// total is incremented.
func (e *LoggingErrorGroup) Add(err error) {
e.total++
if err != nil {
LogMethod("%s: %s", e.name, err)
e.failed++
}
}
// Finalize returns no error if no failures were observed, otherwise it will
// return an ErrorGroupError with statistics about the observed errors.
func (e *LoggingErrorGroup) Finalize() (err error) {
if e.failed > 0 {
err = ErrorGroupError.New("%s: %d of %d failed.", e.name, e.failed,
e.total)
}
e.total = 0
e.failed = 0
return err
}
type Finalizer interface {
Finalize() error
}
// Finalize takes a group of ErrorGroups and joins them together into one error
func Finalize(finalizers ...Finalizer) error {
var errs ErrorGroup
for _, finalizer := range finalizers {
errs.Add(finalizer.Finalize())
}
return errs.Finalize()
}

View File

@ -1,26 +0,0 @@
// Copyright (C) 2016 Space Monkey, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !go1.7
package errors
import (
"golang.org/x/net/context"
)
var (
contextCanceled = context.Canceled
contextDeadlineExceeded = context.DeadlineExceeded
)

View File

@ -23,6 +23,7 @@
package infectious
import (
"errors"
"sort"
)
@ -50,7 +51,7 @@ func (f *FEC) Decode(dst []byte, shares []Share) ([]byte, error) {
}
if len(shares) == 0 {
return nil, Error.New("must specify at least one share")
return nil, errors.New("must specify at least one share")
}
piece_len := len(shares[0].Data)
result_len := piece_len * f.k
@ -78,7 +79,7 @@ func (f *FEC) decode(shares []Share, output func(Share)) error {
// mutating the underlying byte slices and reordering the shares
func (fc *FEC) Correct(shares []Share) error {
if len(shares) < fc.k {
return Error.New("must specify at least the number of required shares")
return errors.New("must specify at least the number of required shares")
}
sort.Sort(byNumber(shares))
@ -124,7 +125,7 @@ func (fc *FEC) berlekampWelch(shares []Share, index int) ([]byte, error) {
q := e + k // def of Q polynomial
if e <= 0 {
return nil, NotEnoughShares.New("")
return nil, NotEnoughShares
}
const interp_base = gfVal(2)
@ -194,7 +195,7 @@ func (fc *FEC) berlekampWelch(shares []Share, index int) ([]byte, error) {
}
if !rem.isZero() {
return nil, TooManyErrors.New("")
return nil, TooManyErrors
}
out := make([]byte, fc.n)

View File

@ -36,13 +36,15 @@
package infectious
import (
"github.com/spacemonkeygo/errors"
"errors"
"golang.org/x/sys/cpu"
)
var Error = errors.NewClass("infectious")
var NotEnoughShares = Error.NewClass("not enough shares")
var TooManyErrors = Error.NewClass("too many errors")
var hasAVX2 = cpu.X86.HasAVX2
var hasSSSE3 = cpu.X86.HasSSSE3
var (
NotEnoughShares = errors.New("not enough shares")
TooManyErrors = errors.New("too many errors to reconstruct")
)

View File

@ -33,7 +33,11 @@
package infectious
import "sort"
import (
"errors"
"fmt"
"sort"
)
// FEC represents operations performed on a Reed-Solomon-based
// forward error correction code. Make sure to construct using NewFEC.
@ -50,7 +54,7 @@ type FEC struct {
// exist, corrupted data can be detected and recovered from.
func NewFEC(k, n int) (*FEC, error) {
if k <= 0 || n <= 0 || k > 256 || n > 256 || k > n {
return nil, Error.New("requires 1 <= k <= n <= 256")
return nil, errors.New("requires 1 <= k <= n <= 256")
}
enc_matrix := make([]byte, n*k)
@ -127,7 +131,7 @@ func (f *FEC) Encode(input []byte, output func(Share)) error {
enc_matrix := f.enc_matrix
if size%k != 0 {
return Error.New("input length must be a multiple of %d", k)
return fmt.Errorf("input length must be a multiple of %d", k)
}
block_size := size / k
@ -173,21 +177,21 @@ func (f *FEC) EncodeSingle(input, output []byte, num int) error {
enc_matrix := f.enc_matrix
if num < 0 {
return Error.New("num must be non-negative")
return errors.New("num must be non-negative")
}
if num >= n {
return Error.New("num must be less than %d", n)
return fmt.Errorf("num must be less than %d", n)
}
if size%k != 0 {
return Error.New("input length must be a multiple of %d", k)
return fmt.Errorf("input length must be a multiple of %d", k)
}
block_size := size / k
if len(output) != block_size {
return Error.New("output length must be %d", block_size)
return fmt.Errorf("output length must be %d", block_size)
}
if num < k {
@ -246,7 +250,7 @@ func (f *FEC) Rebuild(shares []Share, output func(Share)) error {
enc_matrix := f.enc_matrix
if len(shares) < k {
return NotEnoughShares.New("")
return NotEnoughShares
}
share_size := len(shares[0].Data)
@ -275,7 +279,7 @@ func (f *FEC) Rebuild(shares []Share, output func(Share)) error {
}
if share_id >= n {
return Error.New("invalid share id: %d", share_id)
return fmt.Errorf("invalid share id: %d", share_id)
}
if share_id < k {

View File

@ -23,6 +23,7 @@
package infectious
import (
"errors"
"fmt"
"strings"
"unsafe"
@ -53,7 +54,7 @@ func (a gfVal) mul(b gfVal) gfVal {
func (a gfVal) div(b gfVal) (gfVal, error) {
if b == 0 {
return 0, Error.New("divide by zero")
return 0, errors.New("divide by zero")
}
if a == 0 {
return 0, nil
@ -71,7 +72,7 @@ func (a gfVal) isZero() bool {
func (a gfVal) inv() (gfVal, error) {
if a == 0 {
return 0, Error.New("invert zero")
return 0, errors.New("invert zero")
}
return gfVal(gf_exp[255-gf_log[a]]), nil
}
@ -173,7 +174,7 @@ func (p gfPoly) div(b gfPoly) (q, r gfPoly, err error) {
b = b[1:]
}
if len(b) == 0 {
return nil, nil, Error.New("divide by zero")
return nil, nil, errors.New("divide by zero")
}
// sanitize the base poly as well
@ -221,7 +222,7 @@ func (p gfPoly) div(b gfPoly) (q, r gfPoly, err error) {
p = p.add(padded)
if !p[0].isZero() {
return nil, nil, Error.New("alg error: %x", p)
return nil, nil, fmt.Errorf("alg error: %x", p)
}
p = p[1:]
}

5
vendor/github.com/vivint/infectious/go.mod generated vendored Normal file
View File

@ -0,0 +1,5 @@
module github.com/vivint/infectious
go 1.12
require golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd

2
vendor/github.com/vivint/infectious/go.sum generated vendored Normal file
View File

@ -0,0 +1,2 @@
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

View File

@ -33,7 +33,10 @@
package infectious
import "bytes"
import (
"bytes"
"errors"
)
type pivotSearcher struct {
k int
@ -66,7 +69,7 @@ func (p *pivotSearcher) search(col int, matrix []byte) (int, int, error) {
}
}
return 0, 0, Error.New("pivot not found")
return 0, 0, errors.New("pivot not found")
}
func swap(a, b *byte) {
@ -100,7 +103,7 @@ func invertMatrix(matrix []byte, k int) error {
c := pivot_row[icol]
if c == 0 {
return Error.New("singular matrix")
return errors.New("singular matrix")
}
if c != 1 {

9
vendor/golang.org/x/sys/cpu/cpu.go generated vendored
View File

@ -114,6 +114,15 @@ var ARM struct {
_ CacheLinePad
}
// MIPS64X contains the supported CPU features of the current mips64/mips64le
// platforms. If the current platform is not mips64/mips64le or the current
// operating system is not Linux then all feature flags are false.
var MIPS64X struct {
_ CacheLinePad
HasMSA bool // MIPS SIMD architecture
_ CacheLinePad
}
// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms.
// If the current platform is not ppc64/ppc64le then all feature flags are false.
//

22
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go generated vendored Normal file
View File

@ -0,0 +1,22 @@
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build mips64 mips64le
package cpu
// HWCAP bits. These are exposed by the Linux kernel 5.4.
const (
// CPU features
hwcap_MIPS_MSA = 1 << 1
)
func doinit() {
// HWCAP feature bits
MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA)
}
func isSet(hwc uint, value uint) bool {
return hwc&value != 0
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux,!arm,!arm64,!ppc64,!ppc64le,!s390x
// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
package cpu

View File

@ -149,6 +149,17 @@ To add a constant, add the header that includes it to the appropriate variable.
Then, edit the regex (if necessary) to match the desired constant. Avoid making
the regex too broad to avoid matching unintended constants.
### mkmerge.go
This program is used to extract duplicate const, func, and type declarations
from the generated architecture-specific files listed below, and merge these
into a common file for each OS.
The merge is performed in the following steps:
1. Construct the set of common code that is idential in all architecture-specific files.
2. Write this common code to the merged file.
3. Remove the common code from all architecture-specific files.
## Generated files

View File

@ -8,6 +8,7 @@
package unix
const (
DLT_HHDLC = 0x79
IFF_SMART = 0x20
IFT_1822 = 0x2
IFT_A12MPPSWITCH = 0x82
@ -210,13 +211,18 @@ const (
IFT_XETHER = 0x1a
IPPROTO_MAXID = 0x34
IPV6_FAITH = 0x1d
IPV6_MIN_MEMBERSHIPS = 0x1f
IP_FAITH = 0x16
IP_MAX_SOURCE_FILTER = 0x400
IP_MIN_MEMBERSHIPS = 0x1f
MAP_NORESERVE = 0x40
MAP_RENAME = 0x20
NET_RT_MAXID = 0x6
RTF_PRCLONING = 0x10000
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
RT_CACHING_CONTEXT = 0x1
RT_NORTREF = 0x2
SIOCADDRT = 0x8030720a
SIOCALIFADDR = 0x8118691b
SIOCDELRT = 0x8030720b

View File

@ -8,6 +8,7 @@
package unix
const (
DLT_HHDLC = 0x79
IFF_SMART = 0x20
IFT_1822 = 0x2
IFT_A12MPPSWITCH = 0x82
@ -210,13 +211,18 @@ const (
IFT_XETHER = 0x1a
IPPROTO_MAXID = 0x34
IPV6_FAITH = 0x1d
IPV6_MIN_MEMBERSHIPS = 0x1f
IP_FAITH = 0x16
IP_MAX_SOURCE_FILTER = 0x400
IP_MIN_MEMBERSHIPS = 0x1f
MAP_NORESERVE = 0x40
MAP_RENAME = 0x20
NET_RT_MAXID = 0x6
RTF_PRCLONING = 0x10000
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
RT_CACHING_CONTEXT = 0x1
RT_NORTREF = 0x2
SIOCADDRT = 0x8040720a
SIOCALIFADDR = 0x8118691b
SIOCDELRT = 0x8040720b

17
vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go generated vendored Normal file
View File

@ -0,0 +1,17 @@
// Copyright 2020 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.
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
// them here for backwards compatibility.
package unix
const (
DLT_HHDLC = 0x79
IPV6_MIN_MEMBERSHIPS = 0x1f
IP_MAX_SOURCE_FILTER = 0x400
IP_MIN_MEMBERSHIPS = 0x1f
RT_CACHING_CONTEXT = 0x1
RT_NORTREF = 0x2
)

View File

@ -124,7 +124,7 @@ freebsd_arm)
freebsd_arm64)
mkerrors="$mkerrors -m64"
mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
netbsd_386)
mkerrors="$mkerrors -m32"
@ -190,6 +190,12 @@ solaris_amd64)
mksysnum=
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
illumos_amd64)
mksyscall="go run mksyscall_solaris.go"
mkerrors=
mksysnum=
mktypes=
;;
*)
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
exit 1
@ -217,6 +223,11 @@ esac
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
# 1.13 and later, syscalls via libSystem (including syscallPtr)
echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go";
elif [ "$GOOS" == "illumos" ]; then
# illumos code generation requires a --illumos switch
echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go";
# illumos implies solaris, so solaris code generation is also required
echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go";
else
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
fi

View File

@ -105,6 +105,7 @@ includes_FreeBSD='
#include <sys/capsicum.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/disk.h>
#include <sys/event.h>
#include <sys/select.h>
#include <sys/socket.h>
@ -280,6 +281,11 @@ struct ltchars {
// for the tipc_subscr timeout __u32 field.
#undef TIPC_WAIT_FOREVER
#define TIPC_WAIT_FOREVER 0xffffffff
// Copied from linux/l2tp.h
// 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
'
includes_NetBSD='
@ -488,6 +494,7 @@ ccflags="$@"
$2 !~ "RTF_BITS" &&
$2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ ||
$2 ~ /^BIOC/ ||
$2 ~ /^DIOC/ ||
$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||

View File

@ -521,10 +521,6 @@ func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) {
return ptrace(PTRACE_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0)
}
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
}
func PtraceGetRegs(pid int, regsout *Reg) (err error) {
return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0)
}

View File

@ -55,6 +55,10 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
}
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)

View File

@ -55,6 +55,10 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
}
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)

57
vendor/golang.org/x/sys/unix/syscall_illumos.go generated vendored Normal file
View File

@ -0,0 +1,57 @@
// Copyright 2009 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.
// illumos system calls not present on Solaris.
// +build amd64,illumos
package unix
import "unsafe"
func bytes2iovec(bs [][]byte) []Iovec {
iovecs := make([]Iovec, len(bs))
for i, b := range bs {
iovecs[i].SetLen(len(b))
if len(b) > 0 {
// somehow Iovec.Base on illumos is (*int8), not (*byte)
iovecs[i].Base = (*int8)(unsafe.Pointer(&b[0]))
} else {
iovecs[i].Base = (*int8)(unsafe.Pointer(&_zero))
}
}
return iovecs
}
//sys readv(fd int, iovs []Iovec) (n int, err error)
func Readv(fd int, iovs [][]byte) (n int, err error) {
iovecs := bytes2iovec(iovs)
n, err = readv(fd, iovecs)
return n, err
}
//sys preadv(fd int, iovs []Iovec, off int64) (n int, err error)
func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) {
iovecs := bytes2iovec(iovs)
n, err = preadv(fd, iovecs, off)
return n, err
}
//sys writev(fd int, iovs []Iovec) (n int, err error)
func Writev(fd int, iovs [][]byte) (n int, err error) {
iovecs := bytes2iovec(iovs)
n, err = writev(fd, iovecs)
return n, err
}
//sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error)
func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) {
iovecs := bytes2iovec(iovs)
n, err = pwritev(fd, iovecs, off)
return n, err
}

View File

@ -839,6 +839,40 @@ func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) {
return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil
}
// SockaddrL2TPIP implements the Sockaddr interface for IPPROTO_L2TP/AF_INET sockets.
type SockaddrL2TPIP struct {
Addr [4]byte
ConnId uint32
raw RawSockaddrL2TPIP
}
func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) {
sa.raw.Family = AF_INET
sa.raw.Conn_id = sa.ConnId
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP, nil
}
// SockaddrL2TPIP6 implements the Sockaddr interface for IPPROTO_L2TP/AF_INET6 sockets.
type SockaddrL2TPIP6 struct {
Addr [16]byte
ZoneId uint32
ConnId uint32
raw RawSockaddrL2TPIP6
}
func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) {
sa.raw.Family = AF_INET6
sa.raw.Conn_id = sa.ConnId
sa.raw.Scope_id = sa.ZoneId
for i := 0; i < len(sa.Addr); i++ {
sa.raw.Addr[i] = sa.Addr[i]
}
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP6, nil
}
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_NETLINK:
@ -889,25 +923,58 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
return sa, nil
case AF_INET:
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
sa := new(SockaddrInet4)
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
sa.Port = int(p[0])<<8 + int(p[1])
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
if err != nil {
return nil, err
}
switch proto {
case IPPROTO_L2TP:
pp := (*RawSockaddrL2TPIP)(unsafe.Pointer(rsa))
sa := new(SockaddrL2TPIP)
sa.ConnId = pp.Conn_id
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
return sa, nil
default:
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
sa := new(SockaddrInet4)
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
sa.Port = int(p[0])<<8 + int(p[1])
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
return sa, nil
}
return sa, nil
case AF_INET6:
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
sa := new(SockaddrInet6)
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
sa.Port = int(p[0])<<8 + int(p[1])
sa.ZoneId = pp.Scope_id
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
if err != nil {
return nil, err
}
switch proto {
case IPPROTO_L2TP:
pp := (*RawSockaddrL2TPIP6)(unsafe.Pointer(rsa))
sa := new(SockaddrL2TPIP6)
sa.ConnId = pp.Conn_id
sa.ZoneId = pp.Scope_id
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
return sa, nil
default:
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
sa := new(SockaddrInet6)
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
sa.Port = int(p[0])<<8 + int(p[1])
sa.ZoneId = pp.Scope_id
for i := 0; i < len(sa.Addr); i++ {
sa.Addr[i] = pp.Addr[i]
}
return sa, nil
}
return sa, nil
case AF_VSOCK:
pp := (*RawSockaddrVM)(unsafe.Pointer(rsa))

View File

@ -76,7 +76,7 @@ func SignalName(s syscall.Signal) string {
// The signal name should start with "SIG".
func SignalNum(s string) syscall.Signal {
signalNameMapOnce.Do(func() {
signalNameMap = make(map[string]syscall.Signal)
signalNameMap = make(map[string]syscall.Signal, len(signalList))
for _, signal := range signalList {
signalNameMap[signal.name] = signal.num
}

View File

@ -355,6 +355,22 @@ const (
CTL_KERN = 0x1
CTL_MAXNAME = 0x18
CTL_NET = 0x4
DIOCGATTR = 0xc144648e
DIOCGDELETE = 0x80106488
DIOCGFLUSH = 0x20006487
DIOCGFRONTSTUFF = 0x40086486
DIOCGFWHEADS = 0x40046483
DIOCGFWSECTORS = 0x40046482
DIOCGIDENT = 0x41006489
DIOCGMEDIASIZE = 0x40086481
DIOCGPHYSPATH = 0x4400648d
DIOCGPROVIDERNAME = 0x4400648a
DIOCGSECTORSIZE = 0x40046480
DIOCGSTRIPEOFFSET = 0x4008648c
DIOCGSTRIPESIZE = 0x4008648b
DIOCSKERNELDUMP = 0x804c6490
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
DIOCZONECMD = 0xc06c648f
DLT_A429 = 0xb8
DLT_A653_ICM = 0xb9
DLT_AIRONET_HEADER = 0x78
@ -379,11 +395,14 @@ const (
DLT_CHAOS = 0x5
DLT_CHDLC = 0x68
DLT_CISCO_IOS = 0x76
DLT_CLASS_NETBSD_RAWAF = 0x2240000
DLT_C_HDLC = 0x68
DLT_C_HDLC_WITH_DIR = 0xcd
DLT_DBUS = 0xe7
DLT_DECT = 0xdd
DLT_DISPLAYPORT_AUX = 0x113
DLT_DOCSIS = 0x8f
DLT_DOCSIS31_XRA31 = 0x111
DLT_DVB_CI = 0xeb
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
@ -393,6 +412,7 @@ const (
DLT_ERF = 0xc5
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_ETHERNET_MPACKET = 0x112
DLT_FC_2 = 0xe0
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
DLT_FDDI = 0xa
@ -406,7 +426,6 @@ const (
DLT_GPRS_LLC = 0xa9
DLT_GSMTAP_ABIS = 0xda
DLT_GSMTAP_UM = 0xd9
DLT_HHDLC = 0x79
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
@ -429,6 +448,7 @@ const (
DLT_IPV4 = 0xe4
DLT_IPV6 = 0xe5
DLT_IP_OVER_FC = 0x7a
DLT_ISO_14443 = 0x108
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_ATM_CEMIC = 0xee
@ -461,8 +481,9 @@ const (
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LORATAP = 0x10e
DLT_LTALK = 0x72
DLT_MATCHING_MAX = 0x104
DLT_MATCHING_MAX = 0x113
DLT_MATCHING_MIN = 0x68
DLT_MFR = 0xb6
DLT_MOST = 0xd3
@ -478,14 +499,16 @@ const (
DLT_NFC_LLCP = 0xf5
DLT_NFLOG = 0xef
DLT_NG40 = 0xf4
DLT_NORDIC_BLE = 0x110
DLT_NULL = 0x0
DLT_OPENFLOW = 0x10b
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x79
DLT_PKTAP = 0x102
DLT_PPI = 0xc0
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0x10
DLT_PPP_BSDOS = 0xe
DLT_PPP_ETHER = 0x33
DLT_PPP_PPPD = 0xa6
DLT_PPP_SERIAL = 0x32
@ -496,19 +519,25 @@ const (
DLT_PRONET = 0x4
DLT_RAIF1 = 0xc6
DLT_RAW = 0xc
DLT_RDS = 0x109
DLT_REDBACK_SMARTEDGE = 0x20
DLT_RIO = 0x7c
DLT_RTAC_SERIAL = 0xfa
DLT_SCCP = 0x8e
DLT_SCTP = 0xf8
DLT_SDLC = 0x10c
DLT_SITA = 0xc4
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xf
DLT_SLIP_BSDOS = 0xd
DLT_STANAG_5066_D_PDU = 0xed
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TI_LLN_SNIFFER = 0x10d
DLT_TZSP = 0x80
DLT_USB = 0xba
DLT_USBPCAP = 0xf9
DLT_USB_DARWIN = 0x10a
DLT_USB_FREEBSD = 0xba
DLT_USB_LINUX = 0xbd
DLT_USB_LINUX_MMAPPED = 0xdc
DLT_USER0 = 0x93
@ -527,10 +556,14 @@ const (
DLT_USER7 = 0x9a
DLT_USER8 = 0x9b
DLT_USER9 = 0x9c
DLT_VSOCK = 0x10f
DLT_WATTSTOPPER_DLM = 0x107
DLT_WIHART = 0xdf
DLT_WIRESHARK_UPPER_PDU = 0xfc
DLT_X2E_SERIAL = 0xd5
DLT_X2E_XORAYA = 0xd6
DLT_ZWAVE_R1_R2 = 0x105
DLT_ZWAVE_R3 = 0x106
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@ -548,6 +581,7 @@ const (
ECHONL = 0x10
ECHOPRT = 0x20
EVFILT_AIO = -0x3
EVFILT_EMPTY = -0xd
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
EVFILT_PROC = -0x5
@ -555,11 +589,12 @@ const (
EVFILT_READ = -0x1
EVFILT_SENDFILE = -0xc
EVFILT_SIGNAL = -0x6
EVFILT_SYSCOUNT = 0xc
EVFILT_SYSCOUNT = 0xd
EVFILT_TIMER = -0x7
EVFILT_USER = -0xb
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EVNAMEMAP_NAME_SIZE = 0x40
EV_ADD = 0x1
EV_CLEAR = 0x20
EV_DELETE = 0x2
@ -576,6 +611,7 @@ const (
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
EXTA = 0x4b00
EXTATTR_MAXNAMELEN = 0xff
EXTATTR_NAMESPACE_EMPTY = 0x0
EXTATTR_NAMESPACE_SYSTEM = 0x2
EXTATTR_NAMESPACE_USER = 0x1
@ -617,6 +653,7 @@ const (
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFCAP_WOL_MAGIC = 0x2000
IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2
@ -633,6 +670,7 @@ const (
IFF_MONITOR = 0x40000
IFF_MULTICAST = 0x8000
IFF_NOARP = 0x80
IFF_NOGROUP = 0x800000
IFF_OACTIVE = 0x400
IFF_POINTOPOINT = 0x10
IFF_PPROMISC = 0x20000
@ -807,6 +845,7 @@ const (
IPV6_DSTOPTS = 0x32
IPV6_FLOWID = 0x43
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_LEN = 0x14
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FLOWTYPE = 0x44
IPV6_FRAGTTL = 0x78
@ -827,13 +866,13 @@ const (
IPV6_MAX_GROUP_SRC_FILTER = 0x200
IPV6_MAX_MEMBERSHIPS = 0xfff
IPV6_MAX_SOCK_SRC_FILTER = 0x80
IPV6_MIN_MEMBERSHIPS = 0x1f
IPV6_MMTU = 0x500
IPV6_MSFILTER = 0x4a
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_ORIGDSTADDR = 0x48
IPV6_PATHMTU = 0x2c
IPV6_PKTINFO = 0x2e
IPV6_PORTRANGE = 0xe
@ -845,6 +884,7 @@ const (
IPV6_RECVFLOWID = 0x46
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVORIGDSTADDR = 0x48
IPV6_RECVPATHMTU = 0x2b
IPV6_RECVPKTINFO = 0x24
IPV6_RECVRSSBUCKETID = 0x47
@ -905,10 +945,8 @@ const (
IP_MAX_MEMBERSHIPS = 0xfff
IP_MAX_SOCK_MUTE_FILTER = 0x80
IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MAX_SOURCE_FILTER = 0x400
IP_MF = 0x2000
IP_MINTTL = 0x42
IP_MIN_MEMBERSHIPS = 0x1f
IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
@ -918,6 +956,7 @@ const (
IP_OFFMASK = 0x1fff
IP_ONESBCAST = 0x17
IP_OPTIONS = 0x1
IP_ORIGDSTADDR = 0x1b
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
@ -926,6 +965,7 @@ const (
IP_RECVFLOWID = 0x5d
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
IP_RECVORIGDSTADDR = 0x1b
IP_RECVRETOPTS = 0x6
IP_RECVRSSBUCKETID = 0x5e
IP_RECVTOS = 0x44
@ -975,6 +1015,7 @@ const (
MAP_EXCL = 0x4000
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_GUARD = 0x2000
MAP_HASSEMAPHORE = 0x200
MAP_NOCORE = 0x20000
MAP_NOSYNC = 0x800
@ -986,6 +1027,15 @@ const (
MAP_RESERVED0100 = 0x100
MAP_SHARED = 0x1
MAP_STACK = 0x400
MCAST_BLOCK_SOURCE = 0x54
MCAST_EXCLUDE = 0x2
MCAST_INCLUDE = 0x1
MCAST_JOIN_GROUP = 0x50
MCAST_JOIN_SOURCE_GROUP = 0x52
MCAST_LEAVE_GROUP = 0x51
MCAST_LEAVE_SOURCE_GROUP = 0x53
MCAST_UNBLOCK_SOURCE = 0x55
MCAST_UNDEFINED = 0x0
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MNT_ACLS = 0x8000000
@ -1026,10 +1076,12 @@ const (
MNT_SUSPEND = 0x4
MNT_SYNCHRONOUS = 0x2
MNT_UNION = 0x20
MNT_UNTRUSTED = 0x800000000
MNT_UPDATE = 0x10000
MNT_UPDATEMASK = 0x2d8d0807e
MNT_UPDATEMASK = 0xad8d0807e
MNT_USER = 0x8000
MNT_VISFLAGMASK = 0x3fef0ffff
MNT_VERIFIED = 0x400000000
MNT_VISFLAGMASK = 0xffef0ffff
MNT_WAIT = 0x1
MSG_CMSG_CLOEXEC = 0x40000
MSG_COMPAT = 0x8000
@ -1058,6 +1110,7 @@ const (
NFDBITS = 0x20
NOFLSH = 0x80000000
NOKERNINFO = 0x2000000
NOTE_ABSTIME = 0x10
NOTE_ATTRIB = 0x8
NOTE_CHILD = 0x4
NOTE_CLOSE = 0x100
@ -1212,7 +1265,6 @@ const (
RTV_WEIGHT = 0x100
RT_ALL_FIBS = -0x1
RT_BLACKHOLE = 0x40
RT_CACHING_CONTEXT = 0x1
RT_DEFAULT_FIB = 0x0
RT_HAS_GW = 0x80
RT_HAS_HEADER = 0x10
@ -1222,15 +1274,17 @@ const (
RT_LLE_CACHE = 0x100
RT_MAY_LOOP = 0x8
RT_MAY_LOOP_BIT = 0x3
RT_NORTREF = 0x2
RT_REJECT = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
SCM_BINTIME = 0x4
SCM_CREDS = 0x3
SCM_MONOTONIC = 0x6
SCM_REALTIME = 0x5
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@ -1246,6 +1300,7 @@ const (
SIOCGETSGCNT = 0xc0147210
SIOCGETVIFCNT = 0xc014720f
SIOCGHIWAT = 0x40047301
SIOCGHWADDR = 0xc020693e
SIOCGI2C = 0xc020693d
SIOCGIFADDR = 0xc0206921
SIOCGIFBRDADDR = 0xc0206923
@ -1267,8 +1322,11 @@ const (
SIOCGIFPDSTADDR = 0xc0206948
SIOCGIFPHYS = 0xc0206935
SIOCGIFPSRCADDR = 0xc0206947
SIOCGIFRSSHASH = 0xc0186997
SIOCGIFRSSKEY = 0xc0946996
SIOCGIFSTATUS = 0xc331693b
SIOCGIFXMEDIA = 0xc028698b
SIOCGLANPCP = 0xc0206998
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGPRIVATE_0 = 0xc0206950
@ -1299,6 +1357,7 @@ const (
SIOCSIFPHYS = 0x80206936
SIOCSIFRVNET = 0xc020695b
SIOCSIFVNET = 0xc020695a
SIOCSLANPCP = 0x80206999
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSTUNFIB = 0x8020695f
@ -1317,6 +1376,7 @@ const (
SO_BINTIME = 0x2000
SO_BROADCAST = 0x20
SO_DEBUG = 0x1
SO_DOMAIN = 0x1019
SO_DONTROUTE = 0x10
SO_ERROR = 0x1007
SO_KEEPALIVE = 0x8
@ -1325,6 +1385,7 @@ const (
SO_LISTENINCQLEN = 0x1013
SO_LISTENQLEN = 0x1012
SO_LISTENQLIMIT = 0x1011
SO_MAX_PACING_RATE = 0x1018
SO_NOSIGPIPE = 0x800
SO_NO_DDP = 0x8000
SO_NO_OFFLOAD = 0x4000
@ -1337,11 +1398,19 @@ const (
SO_RCVTIMEO = 0x1006
SO_REUSEADDR = 0x4
SO_REUSEPORT = 0x200
SO_REUSEPORT_LB = 0x10000
SO_SETFIB = 0x1014
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
SO_TS_BINTIME = 0x1
SO_TS_CLOCK = 0x1017
SO_TS_CLOCK_MAX = 0x3
SO_TS_DEFAULT = 0x0
SO_TS_MONOTONIC = 0x3
SO_TS_REALTIME = 0x2
SO_TS_REALTIME_MICRO = 0x0
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015
@ -1385,10 +1454,45 @@ const (
TCOFLUSH = 0x2
TCOOFF = 0x1
TCOON = 0x2
TCP_BBR_ACK_COMP_ALG = 0x448
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
TCP_BBR_DRAIN_PG = 0x42e
TCP_BBR_EXTRA_GAIN = 0x449
TCP_BBR_IWINTSO = 0x42b
TCP_BBR_LOWGAIN_FD = 0x436
TCP_BBR_LOWGAIN_HALF = 0x435
TCP_BBR_LOWGAIN_THRESH = 0x434
TCP_BBR_MAX_RTO = 0x439
TCP_BBR_MIN_RTO = 0x438
TCP_BBR_ONE_RETRAN = 0x431
TCP_BBR_PACE_CROSS = 0x442
TCP_BBR_PACE_DEL_TAR = 0x43f
TCP_BBR_PACE_PER_SEC = 0x43e
TCP_BBR_PACE_SEG_MAX = 0x440
TCP_BBR_PACE_SEG_MIN = 0x441
TCP_BBR_PROBE_RTT_GAIN = 0x44d
TCP_BBR_PROBE_RTT_INT = 0x430
TCP_BBR_PROBE_RTT_LEN = 0x44e
TCP_BBR_RACK_RTT_USE = 0x44a
TCP_BBR_RECFORCE = 0x42c
TCP_BBR_REC_OVER_HPTS = 0x43a
TCP_BBR_RETRAN_WTSO = 0x44b
TCP_BBR_RWND_IS_APP = 0x42f
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
TCP_BBR_STARTUP_PG = 0x42d
TCP_BBR_UNLIMITED = 0x43b
TCP_BBR_USEDEL_RATE = 0x437
TCP_BBR_USE_LOWGAIN = 0x433
TCP_CA_NAME_MAX = 0x10
TCP_CCALGOOPT = 0x41
TCP_CONGESTION = 0x40
TCP_DATA_AFTER_CLOSE = 0x44c
TCP_DELACK = 0x48
TCP_FASTOPEN = 0x401
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
TCP_FASTOPEN_PSK_LEN = 0x10
TCP_FUNCTION_BLK = 0x2000
TCP_FUNCTION_NAME_LEN_MAX = 0x20
TCP_INFO = 0x20
@ -1396,6 +1500,12 @@ const (
TCP_KEEPIDLE = 0x100
TCP_KEEPINIT = 0x80
TCP_KEEPINTVL = 0x200
TCP_LOG = 0x22
TCP_LOGBUF = 0x23
TCP_LOGDUMP = 0x25
TCP_LOGDUMPID = 0x26
TCP_LOGID = 0x24
TCP_LOG_ID_LEN = 0x40
TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
@ -1411,8 +1521,30 @@ const (
TCP_NOPUSH = 0x4
TCP_PCAP_IN = 0x1000
TCP_PCAP_OUT = 0x800
TCP_RACK_EARLY_RECOV = 0x423
TCP_RACK_EARLY_SEG = 0x424
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
TCP_RACK_MIN_PACE = 0x445
TCP_RACK_MIN_PACE_SEG = 0x446
TCP_RACK_MIN_TO = 0x422
TCP_RACK_PACE_ALWAYS = 0x41f
TCP_RACK_PACE_MAX_SEG = 0x41e
TCP_RACK_PACE_REDUCE = 0x41d
TCP_RACK_PKT_DELAY = 0x428
TCP_RACK_PROP = 0x41b
TCP_RACK_PROP_RATE = 0x420
TCP_RACK_PRR_SENDALOT = 0x421
TCP_RACK_REORD_FADE = 0x426
TCP_RACK_REORD_THRESH = 0x425
TCP_RACK_SESS_CWV = 0x42a
TCP_RACK_TLP_INC_VAR = 0x429
TCP_RACK_TLP_REDUCE = 0x41c
TCP_RACK_TLP_THRESH = 0x427
TCP_RACK_TLP_USE = 0x447
TCP_VENDOR = 0x80000000
TCSAFLUSH = 0x2
TIMER_ABSTIME = 0x1
TIMER_RELTIME = 0x0
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
@ -1476,6 +1608,8 @@ const (
TIOCTIMESTAMP = 0x40087459
TIOCUCNTL = 0x80047466
TOSTOP = 0x400000
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VDISCARD = 0xf
VDSUSP = 0xb
VEOF = 0x0
@ -1487,6 +1621,8 @@ const (
VKILL = 0x5
VLNEXT = 0xe
VMIN = 0x10
VM_BCACHE_SIZE_MAX = 0x70e0000
VM_SWZONE_SIZE_MAX = 0x2280000
VQUIT = 0x9
VREPRINT = 0x6
VSTART = 0xc

View File

@ -355,6 +355,22 @@ const (
CTL_KERN = 0x1
CTL_MAXNAME = 0x18
CTL_NET = 0x4
DIOCGATTR = 0xc148648e
DIOCGDELETE = 0x80106488
DIOCGFLUSH = 0x20006487
DIOCGFRONTSTUFF = 0x40086486
DIOCGFWHEADS = 0x40046483
DIOCGFWSECTORS = 0x40046482
DIOCGIDENT = 0x41006489
DIOCGMEDIASIZE = 0x40086481
DIOCGPHYSPATH = 0x4400648d
DIOCGPROVIDERNAME = 0x4400648a
DIOCGSECTORSIZE = 0x40046480
DIOCGSTRIPEOFFSET = 0x4008648c
DIOCGSTRIPESIZE = 0x4008648b
DIOCSKERNELDUMP = 0x80506490
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
DIOCZONECMD = 0xc080648f
DLT_A429 = 0xb8
DLT_A653_ICM = 0xb9
DLT_AIRONET_HEADER = 0x78
@ -379,11 +395,14 @@ const (
DLT_CHAOS = 0x5
DLT_CHDLC = 0x68
DLT_CISCO_IOS = 0x76
DLT_CLASS_NETBSD_RAWAF = 0x2240000
DLT_C_HDLC = 0x68
DLT_C_HDLC_WITH_DIR = 0xcd
DLT_DBUS = 0xe7
DLT_DECT = 0xdd
DLT_DISPLAYPORT_AUX = 0x113
DLT_DOCSIS = 0x8f
DLT_DOCSIS31_XRA31 = 0x111
DLT_DVB_CI = 0xeb
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
@ -393,6 +412,7 @@ const (
DLT_ERF = 0xc5
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_ETHERNET_MPACKET = 0x112
DLT_FC_2 = 0xe0
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
DLT_FDDI = 0xa
@ -406,7 +426,6 @@ const (
DLT_GPRS_LLC = 0xa9
DLT_GSMTAP_ABIS = 0xda
DLT_GSMTAP_UM = 0xd9
DLT_HHDLC = 0x79
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
@ -429,6 +448,7 @@ const (
DLT_IPV4 = 0xe4
DLT_IPV6 = 0xe5
DLT_IP_OVER_FC = 0x7a
DLT_ISO_14443 = 0x108
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_ATM_CEMIC = 0xee
@ -461,8 +481,9 @@ const (
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LORATAP = 0x10e
DLT_LTALK = 0x72
DLT_MATCHING_MAX = 0x104
DLT_MATCHING_MAX = 0x113
DLT_MATCHING_MIN = 0x68
DLT_MFR = 0xb6
DLT_MOST = 0xd3
@ -478,14 +499,16 @@ const (
DLT_NFC_LLCP = 0xf5
DLT_NFLOG = 0xef
DLT_NG40 = 0xf4
DLT_NORDIC_BLE = 0x110
DLT_NULL = 0x0
DLT_OPENFLOW = 0x10b
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x79
DLT_PKTAP = 0x102
DLT_PPI = 0xc0
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0x10
DLT_PPP_BSDOS = 0xe
DLT_PPP_ETHER = 0x33
DLT_PPP_PPPD = 0xa6
DLT_PPP_SERIAL = 0x32
@ -496,19 +519,25 @@ const (
DLT_PRONET = 0x4
DLT_RAIF1 = 0xc6
DLT_RAW = 0xc
DLT_RDS = 0x109
DLT_REDBACK_SMARTEDGE = 0x20
DLT_RIO = 0x7c
DLT_RTAC_SERIAL = 0xfa
DLT_SCCP = 0x8e
DLT_SCTP = 0xf8
DLT_SDLC = 0x10c
DLT_SITA = 0xc4
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xf
DLT_SLIP_BSDOS = 0xd
DLT_STANAG_5066_D_PDU = 0xed
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TI_LLN_SNIFFER = 0x10d
DLT_TZSP = 0x80
DLT_USB = 0xba
DLT_USBPCAP = 0xf9
DLT_USB_DARWIN = 0x10a
DLT_USB_FREEBSD = 0xba
DLT_USB_LINUX = 0xbd
DLT_USB_LINUX_MMAPPED = 0xdc
DLT_USER0 = 0x93
@ -527,10 +556,14 @@ const (
DLT_USER7 = 0x9a
DLT_USER8 = 0x9b
DLT_USER9 = 0x9c
DLT_VSOCK = 0x10f
DLT_WATTSTOPPER_DLM = 0x107
DLT_WIHART = 0xdf
DLT_WIRESHARK_UPPER_PDU = 0xfc
DLT_X2E_SERIAL = 0xd5
DLT_X2E_XORAYA = 0xd6
DLT_ZWAVE_R1_R2 = 0x105
DLT_ZWAVE_R3 = 0x106
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@ -548,6 +581,7 @@ const (
ECHONL = 0x10
ECHOPRT = 0x20
EVFILT_AIO = -0x3
EVFILT_EMPTY = -0xd
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
EVFILT_PROC = -0x5
@ -555,11 +589,12 @@ const (
EVFILT_READ = -0x1
EVFILT_SENDFILE = -0xc
EVFILT_SIGNAL = -0x6
EVFILT_SYSCOUNT = 0xc
EVFILT_SYSCOUNT = 0xd
EVFILT_TIMER = -0x7
EVFILT_USER = -0xb
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EVNAMEMAP_NAME_SIZE = 0x40
EV_ADD = 0x1
EV_CLEAR = 0x20
EV_DELETE = 0x2
@ -576,6 +611,7 @@ const (
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
EXTA = 0x4b00
EXTATTR_MAXNAMELEN = 0xff
EXTATTR_NAMESPACE_EMPTY = 0x0
EXTATTR_NAMESPACE_SYSTEM = 0x2
EXTATTR_NAMESPACE_USER = 0x1
@ -617,6 +653,7 @@ const (
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFCAP_WOL_MAGIC = 0x2000
IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2
@ -633,6 +670,7 @@ const (
IFF_MONITOR = 0x40000
IFF_MULTICAST = 0x8000
IFF_NOARP = 0x80
IFF_NOGROUP = 0x800000
IFF_OACTIVE = 0x400
IFF_POINTOPOINT = 0x10
IFF_PPROMISC = 0x20000
@ -807,6 +845,7 @@ const (
IPV6_DSTOPTS = 0x32
IPV6_FLOWID = 0x43
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_LEN = 0x14
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FLOWTYPE = 0x44
IPV6_FRAGTTL = 0x78
@ -827,13 +866,13 @@ const (
IPV6_MAX_GROUP_SRC_FILTER = 0x200
IPV6_MAX_MEMBERSHIPS = 0xfff
IPV6_MAX_SOCK_SRC_FILTER = 0x80
IPV6_MIN_MEMBERSHIPS = 0x1f
IPV6_MMTU = 0x500
IPV6_MSFILTER = 0x4a
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_ORIGDSTADDR = 0x48
IPV6_PATHMTU = 0x2c
IPV6_PKTINFO = 0x2e
IPV6_PORTRANGE = 0xe
@ -845,6 +884,7 @@ const (
IPV6_RECVFLOWID = 0x46
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVORIGDSTADDR = 0x48
IPV6_RECVPATHMTU = 0x2b
IPV6_RECVPKTINFO = 0x24
IPV6_RECVRSSBUCKETID = 0x47
@ -905,10 +945,8 @@ const (
IP_MAX_MEMBERSHIPS = 0xfff
IP_MAX_SOCK_MUTE_FILTER = 0x80
IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MAX_SOURCE_FILTER = 0x400
IP_MF = 0x2000
IP_MINTTL = 0x42
IP_MIN_MEMBERSHIPS = 0x1f
IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
@ -918,6 +956,7 @@ const (
IP_OFFMASK = 0x1fff
IP_ONESBCAST = 0x17
IP_OPTIONS = 0x1
IP_ORIGDSTADDR = 0x1b
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
@ -926,6 +965,7 @@ const (
IP_RECVFLOWID = 0x5d
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
IP_RECVORIGDSTADDR = 0x1b
IP_RECVRETOPTS = 0x6
IP_RECVRSSBUCKETID = 0x5e
IP_RECVTOS = 0x44
@ -976,6 +1016,7 @@ const (
MAP_EXCL = 0x4000
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_GUARD = 0x2000
MAP_HASSEMAPHORE = 0x200
MAP_NOCORE = 0x20000
MAP_NOSYNC = 0x800
@ -987,6 +1028,15 @@ const (
MAP_RESERVED0100 = 0x100
MAP_SHARED = 0x1
MAP_STACK = 0x400
MCAST_BLOCK_SOURCE = 0x54
MCAST_EXCLUDE = 0x2
MCAST_INCLUDE = 0x1
MCAST_JOIN_GROUP = 0x50
MCAST_JOIN_SOURCE_GROUP = 0x52
MCAST_LEAVE_GROUP = 0x51
MCAST_LEAVE_SOURCE_GROUP = 0x53
MCAST_UNBLOCK_SOURCE = 0x55
MCAST_UNDEFINED = 0x0
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MNT_ACLS = 0x8000000
@ -1027,10 +1077,12 @@ const (
MNT_SUSPEND = 0x4
MNT_SYNCHRONOUS = 0x2
MNT_UNION = 0x20
MNT_UNTRUSTED = 0x800000000
MNT_UPDATE = 0x10000
MNT_UPDATEMASK = 0x2d8d0807e
MNT_UPDATEMASK = 0xad8d0807e
MNT_USER = 0x8000
MNT_VISFLAGMASK = 0x3fef0ffff
MNT_VERIFIED = 0x400000000
MNT_VISFLAGMASK = 0xffef0ffff
MNT_WAIT = 0x1
MSG_CMSG_CLOEXEC = 0x40000
MSG_COMPAT = 0x8000
@ -1059,6 +1111,7 @@ const (
NFDBITS = 0x40
NOFLSH = 0x80000000
NOKERNINFO = 0x2000000
NOTE_ABSTIME = 0x10
NOTE_ATTRIB = 0x8
NOTE_CHILD = 0x4
NOTE_CLOSE = 0x100
@ -1213,7 +1266,6 @@ const (
RTV_WEIGHT = 0x100
RT_ALL_FIBS = -0x1
RT_BLACKHOLE = 0x40
RT_CACHING_CONTEXT = 0x1
RT_DEFAULT_FIB = 0x0
RT_HAS_GW = 0x80
RT_HAS_HEADER = 0x10
@ -1223,15 +1275,17 @@ const (
RT_LLE_CACHE = 0x100
RT_MAY_LOOP = 0x8
RT_MAY_LOOP_BIT = 0x3
RT_NORTREF = 0x2
RT_REJECT = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
SCM_BINTIME = 0x4
SCM_CREDS = 0x3
SCM_MONOTONIC = 0x6
SCM_REALTIME = 0x5
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@ -1247,6 +1301,7 @@ const (
SIOCGETSGCNT = 0xc0207210
SIOCGETVIFCNT = 0xc028720f
SIOCGHIWAT = 0x40047301
SIOCGHWADDR = 0xc020693e
SIOCGI2C = 0xc020693d
SIOCGIFADDR = 0xc0206921
SIOCGIFBRDADDR = 0xc0206923
@ -1268,8 +1323,11 @@ const (
SIOCGIFPDSTADDR = 0xc0206948
SIOCGIFPHYS = 0xc0206935
SIOCGIFPSRCADDR = 0xc0206947
SIOCGIFRSSHASH = 0xc0186997
SIOCGIFRSSKEY = 0xc0946996
SIOCGIFSTATUS = 0xc331693b
SIOCGIFXMEDIA = 0xc030698b
SIOCGLANPCP = 0xc0206998
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGPRIVATE_0 = 0xc0206950
@ -1300,6 +1358,7 @@ const (
SIOCSIFPHYS = 0x80206936
SIOCSIFRVNET = 0xc020695b
SIOCSIFVNET = 0xc020695a
SIOCSLANPCP = 0x80206999
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSTUNFIB = 0x8020695f
@ -1318,6 +1377,7 @@ const (
SO_BINTIME = 0x2000
SO_BROADCAST = 0x20
SO_DEBUG = 0x1
SO_DOMAIN = 0x1019
SO_DONTROUTE = 0x10
SO_ERROR = 0x1007
SO_KEEPALIVE = 0x8
@ -1326,6 +1386,7 @@ const (
SO_LISTENINCQLEN = 0x1013
SO_LISTENQLEN = 0x1012
SO_LISTENQLIMIT = 0x1011
SO_MAX_PACING_RATE = 0x1018
SO_NOSIGPIPE = 0x800
SO_NO_DDP = 0x8000
SO_NO_OFFLOAD = 0x4000
@ -1338,11 +1399,19 @@ const (
SO_RCVTIMEO = 0x1006
SO_REUSEADDR = 0x4
SO_REUSEPORT = 0x200
SO_REUSEPORT_LB = 0x10000
SO_SETFIB = 0x1014
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
SO_TS_BINTIME = 0x1
SO_TS_CLOCK = 0x1017
SO_TS_CLOCK_MAX = 0x3
SO_TS_DEFAULT = 0x0
SO_TS_MONOTONIC = 0x3
SO_TS_REALTIME = 0x2
SO_TS_REALTIME_MICRO = 0x0
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015
@ -1386,10 +1455,45 @@ const (
TCOFLUSH = 0x2
TCOOFF = 0x1
TCOON = 0x2
TCP_BBR_ACK_COMP_ALG = 0x448
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
TCP_BBR_DRAIN_PG = 0x42e
TCP_BBR_EXTRA_GAIN = 0x449
TCP_BBR_IWINTSO = 0x42b
TCP_BBR_LOWGAIN_FD = 0x436
TCP_BBR_LOWGAIN_HALF = 0x435
TCP_BBR_LOWGAIN_THRESH = 0x434
TCP_BBR_MAX_RTO = 0x439
TCP_BBR_MIN_RTO = 0x438
TCP_BBR_ONE_RETRAN = 0x431
TCP_BBR_PACE_CROSS = 0x442
TCP_BBR_PACE_DEL_TAR = 0x43f
TCP_BBR_PACE_PER_SEC = 0x43e
TCP_BBR_PACE_SEG_MAX = 0x440
TCP_BBR_PACE_SEG_MIN = 0x441
TCP_BBR_PROBE_RTT_GAIN = 0x44d
TCP_BBR_PROBE_RTT_INT = 0x430
TCP_BBR_PROBE_RTT_LEN = 0x44e
TCP_BBR_RACK_RTT_USE = 0x44a
TCP_BBR_RECFORCE = 0x42c
TCP_BBR_REC_OVER_HPTS = 0x43a
TCP_BBR_RETRAN_WTSO = 0x44b
TCP_BBR_RWND_IS_APP = 0x42f
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
TCP_BBR_STARTUP_PG = 0x42d
TCP_BBR_UNLIMITED = 0x43b
TCP_BBR_USEDEL_RATE = 0x437
TCP_BBR_USE_LOWGAIN = 0x433
TCP_CA_NAME_MAX = 0x10
TCP_CCALGOOPT = 0x41
TCP_CONGESTION = 0x40
TCP_DATA_AFTER_CLOSE = 0x44c
TCP_DELACK = 0x48
TCP_FASTOPEN = 0x401
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
TCP_FASTOPEN_PSK_LEN = 0x10
TCP_FUNCTION_BLK = 0x2000
TCP_FUNCTION_NAME_LEN_MAX = 0x20
TCP_INFO = 0x20
@ -1397,6 +1501,12 @@ const (
TCP_KEEPIDLE = 0x100
TCP_KEEPINIT = 0x80
TCP_KEEPINTVL = 0x200
TCP_LOG = 0x22
TCP_LOGBUF = 0x23
TCP_LOGDUMP = 0x25
TCP_LOGDUMPID = 0x26
TCP_LOGID = 0x24
TCP_LOG_ID_LEN = 0x40
TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
@ -1412,8 +1522,30 @@ const (
TCP_NOPUSH = 0x4
TCP_PCAP_IN = 0x1000
TCP_PCAP_OUT = 0x800
TCP_RACK_EARLY_RECOV = 0x423
TCP_RACK_EARLY_SEG = 0x424
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
TCP_RACK_MIN_PACE = 0x445
TCP_RACK_MIN_PACE_SEG = 0x446
TCP_RACK_MIN_TO = 0x422
TCP_RACK_PACE_ALWAYS = 0x41f
TCP_RACK_PACE_MAX_SEG = 0x41e
TCP_RACK_PACE_REDUCE = 0x41d
TCP_RACK_PKT_DELAY = 0x428
TCP_RACK_PROP = 0x41b
TCP_RACK_PROP_RATE = 0x420
TCP_RACK_PRR_SENDALOT = 0x421
TCP_RACK_REORD_FADE = 0x426
TCP_RACK_REORD_THRESH = 0x425
TCP_RACK_SESS_CWV = 0x42a
TCP_RACK_TLP_INC_VAR = 0x429
TCP_RACK_TLP_REDUCE = 0x41c
TCP_RACK_TLP_THRESH = 0x427
TCP_RACK_TLP_USE = 0x447
TCP_VENDOR = 0x80000000
TCSAFLUSH = 0x2
TIMER_ABSTIME = 0x1
TIMER_RELTIME = 0x0
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
@ -1477,6 +1609,8 @@ const (
TIOCTIMESTAMP = 0x40107459
TIOCUCNTL = 0x80047466
TOSTOP = 0x400000
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VDISCARD = 0xf
VDSUSP = 0xb
VEOF = 0x0

View File

@ -355,6 +355,22 @@ const (
CTL_KERN = 0x1
CTL_MAXNAME = 0x18
CTL_NET = 0x4
DIOCGATTR = 0xc144648e
DIOCGDELETE = 0x80106488
DIOCGFLUSH = 0x20006487
DIOCGFRONTSTUFF = 0x40086486
DIOCGFWHEADS = 0x40046483
DIOCGFWSECTORS = 0x40046482
DIOCGIDENT = 0x41006489
DIOCGMEDIASIZE = 0x40086481
DIOCGPHYSPATH = 0x4400648d
DIOCGPROVIDERNAME = 0x4400648a
DIOCGSECTORSIZE = 0x40046480
DIOCGSTRIPEOFFSET = 0x4008648c
DIOCGSTRIPESIZE = 0x4008648b
DIOCSKERNELDUMP = 0x804c6490
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
DIOCZONECMD = 0xc06c648f
DLT_A429 = 0xb8
DLT_A653_ICM = 0xb9
DLT_AIRONET_HEADER = 0x78

View File

@ -355,6 +355,22 @@ const (
CTL_KERN = 0x1
CTL_MAXNAME = 0x18
CTL_NET = 0x4
DIOCGATTR = 0xc148648e
DIOCGDELETE = 0x80106488
DIOCGFLUSH = 0x20006487
DIOCGFRONTSTUFF = 0x40086486
DIOCGFWHEADS = 0x40046483
DIOCGFWSECTORS = 0x40046482
DIOCGIDENT = 0x41006489
DIOCGMEDIASIZE = 0x40086481
DIOCGPHYSPATH = 0x4400648d
DIOCGPROVIDERNAME = 0x4400648a
DIOCGSECTORSIZE = 0x40046480
DIOCGSTRIPEOFFSET = 0x4008648c
DIOCGSTRIPESIZE = 0x4008648b
DIOCSKERNELDUMP = 0x80506490
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
DIOCZONECMD = 0xc080648f
DLT_A429 = 0xb8
DLT_A653_ICM = 0xb9
DLT_AIRONET_HEADER = 0x78
@ -379,11 +395,14 @@ const (
DLT_CHAOS = 0x5
DLT_CHDLC = 0x68
DLT_CISCO_IOS = 0x76
DLT_CLASS_NETBSD_RAWAF = 0x2240000
DLT_C_HDLC = 0x68
DLT_C_HDLC_WITH_DIR = 0xcd
DLT_DBUS = 0xe7
DLT_DECT = 0xdd
DLT_DISPLAYPORT_AUX = 0x113
DLT_DOCSIS = 0x8f
DLT_DOCSIS31_XRA31 = 0x111
DLT_DVB_CI = 0xeb
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
@ -393,6 +412,7 @@ const (
DLT_ERF = 0xc5
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_ETHERNET_MPACKET = 0x112
DLT_FC_2 = 0xe0
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
DLT_FDDI = 0xa
@ -406,7 +426,6 @@ const (
DLT_GPRS_LLC = 0xa9
DLT_GSMTAP_ABIS = 0xda
DLT_GSMTAP_UM = 0xd9
DLT_HHDLC = 0x79
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
@ -429,6 +448,7 @@ const (
DLT_IPV4 = 0xe4
DLT_IPV6 = 0xe5
DLT_IP_OVER_FC = 0x7a
DLT_ISO_14443 = 0x108
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_ATM_CEMIC = 0xee
@ -461,8 +481,9 @@ const (
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LORATAP = 0x10e
DLT_LTALK = 0x72
DLT_MATCHING_MAX = 0x104
DLT_MATCHING_MAX = 0x113
DLT_MATCHING_MIN = 0x68
DLT_MFR = 0xb6
DLT_MOST = 0xd3
@ -478,14 +499,16 @@ const (
DLT_NFC_LLCP = 0xf5
DLT_NFLOG = 0xef
DLT_NG40 = 0xf4
DLT_NORDIC_BLE = 0x110
DLT_NULL = 0x0
DLT_OPENFLOW = 0x10b
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x79
DLT_PKTAP = 0x102
DLT_PPI = 0xc0
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0x10
DLT_PPP_BSDOS = 0xe
DLT_PPP_ETHER = 0x33
DLT_PPP_PPPD = 0xa6
DLT_PPP_SERIAL = 0x32
@ -496,19 +519,25 @@ const (
DLT_PRONET = 0x4
DLT_RAIF1 = 0xc6
DLT_RAW = 0xc
DLT_RDS = 0x109
DLT_REDBACK_SMARTEDGE = 0x20
DLT_RIO = 0x7c
DLT_RTAC_SERIAL = 0xfa
DLT_SCCP = 0x8e
DLT_SCTP = 0xf8
DLT_SDLC = 0x10c
DLT_SITA = 0xc4
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xf
DLT_SLIP_BSDOS = 0xd
DLT_STANAG_5066_D_PDU = 0xed
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TI_LLN_SNIFFER = 0x10d
DLT_TZSP = 0x80
DLT_USB = 0xba
DLT_USBPCAP = 0xf9
DLT_USB_DARWIN = 0x10a
DLT_USB_FREEBSD = 0xba
DLT_USB_LINUX = 0xbd
DLT_USB_LINUX_MMAPPED = 0xdc
DLT_USER0 = 0x93
@ -527,10 +556,14 @@ const (
DLT_USER7 = 0x9a
DLT_USER8 = 0x9b
DLT_USER9 = 0x9c
DLT_VSOCK = 0x10f
DLT_WATTSTOPPER_DLM = 0x107
DLT_WIHART = 0xdf
DLT_WIRESHARK_UPPER_PDU = 0xfc
DLT_X2E_SERIAL = 0xd5
DLT_X2E_XORAYA = 0xd6
DLT_ZWAVE_R1_R2 = 0x105
DLT_ZWAVE_R3 = 0x106
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@ -548,6 +581,7 @@ const (
ECHONL = 0x10
ECHOPRT = 0x20
EVFILT_AIO = -0x3
EVFILT_EMPTY = -0xd
EVFILT_FS = -0x9
EVFILT_LIO = -0xa
EVFILT_PROC = -0x5
@ -555,11 +589,12 @@ const (
EVFILT_READ = -0x1
EVFILT_SENDFILE = -0xc
EVFILT_SIGNAL = -0x6
EVFILT_SYSCOUNT = 0xc
EVFILT_SYSCOUNT = 0xd
EVFILT_TIMER = -0x7
EVFILT_USER = -0xb
EVFILT_VNODE = -0x4
EVFILT_WRITE = -0x2
EVNAMEMAP_NAME_SIZE = 0x40
EV_ADD = 0x1
EV_CLEAR = 0x20
EV_DELETE = 0x2
@ -576,6 +611,7 @@ const (
EV_RECEIPT = 0x40
EV_SYSFLAGS = 0xf000
EXTA = 0x4b00
EXTATTR_MAXNAMELEN = 0xff
EXTATTR_NAMESPACE_EMPTY = 0x0
EXTATTR_NAMESPACE_SYSTEM = 0x2
EXTATTR_NAMESPACE_USER = 0x1
@ -617,6 +653,7 @@ const (
IEXTEN = 0x400
IFAN_ARRIVAL = 0x0
IFAN_DEPARTURE = 0x1
IFCAP_WOL_MAGIC = 0x2000
IFF_ALLMULTI = 0x200
IFF_ALTPHYS = 0x4000
IFF_BROADCAST = 0x2
@ -633,6 +670,7 @@ const (
IFF_MONITOR = 0x40000
IFF_MULTICAST = 0x8000
IFF_NOARP = 0x80
IFF_NOGROUP = 0x800000
IFF_OACTIVE = 0x400
IFF_POINTOPOINT = 0x10
IFF_PPROMISC = 0x20000
@ -807,6 +845,7 @@ const (
IPV6_DSTOPTS = 0x32
IPV6_FLOWID = 0x43
IPV6_FLOWINFO_MASK = 0xffffff0f
IPV6_FLOWLABEL_LEN = 0x14
IPV6_FLOWLABEL_MASK = 0xffff0f00
IPV6_FLOWTYPE = 0x44
IPV6_FRAGTTL = 0x78
@ -827,13 +866,13 @@ const (
IPV6_MAX_GROUP_SRC_FILTER = 0x200
IPV6_MAX_MEMBERSHIPS = 0xfff
IPV6_MAX_SOCK_SRC_FILTER = 0x80
IPV6_MIN_MEMBERSHIPS = 0x1f
IPV6_MMTU = 0x500
IPV6_MSFILTER = 0x4a
IPV6_MULTICAST_HOPS = 0xa
IPV6_MULTICAST_IF = 0x9
IPV6_MULTICAST_LOOP = 0xb
IPV6_NEXTHOP = 0x30
IPV6_ORIGDSTADDR = 0x48
IPV6_PATHMTU = 0x2c
IPV6_PKTINFO = 0x2e
IPV6_PORTRANGE = 0xe
@ -845,6 +884,7 @@ const (
IPV6_RECVFLOWID = 0x46
IPV6_RECVHOPLIMIT = 0x25
IPV6_RECVHOPOPTS = 0x27
IPV6_RECVORIGDSTADDR = 0x48
IPV6_RECVPATHMTU = 0x2b
IPV6_RECVPKTINFO = 0x24
IPV6_RECVRSSBUCKETID = 0x47
@ -905,10 +945,8 @@ const (
IP_MAX_MEMBERSHIPS = 0xfff
IP_MAX_SOCK_MUTE_FILTER = 0x80
IP_MAX_SOCK_SRC_FILTER = 0x80
IP_MAX_SOURCE_FILTER = 0x400
IP_MF = 0x2000
IP_MINTTL = 0x42
IP_MIN_MEMBERSHIPS = 0x1f
IP_MSFILTER = 0x4a
IP_MSS = 0x240
IP_MULTICAST_IF = 0x9
@ -918,6 +956,7 @@ const (
IP_OFFMASK = 0x1fff
IP_ONESBCAST = 0x17
IP_OPTIONS = 0x1
IP_ORIGDSTADDR = 0x1b
IP_PORTRANGE = 0x13
IP_PORTRANGE_DEFAULT = 0x0
IP_PORTRANGE_HIGH = 0x1
@ -926,6 +965,7 @@ const (
IP_RECVFLOWID = 0x5d
IP_RECVIF = 0x14
IP_RECVOPTS = 0x5
IP_RECVORIGDSTADDR = 0x1b
IP_RECVRETOPTS = 0x6
IP_RECVRSSBUCKETID = 0x5e
IP_RECVTOS = 0x44
@ -976,6 +1016,7 @@ const (
MAP_EXCL = 0x4000
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_GUARD = 0x2000
MAP_HASSEMAPHORE = 0x200
MAP_NOCORE = 0x20000
MAP_NOSYNC = 0x800
@ -987,6 +1028,15 @@ const (
MAP_RESERVED0100 = 0x100
MAP_SHARED = 0x1
MAP_STACK = 0x400
MCAST_BLOCK_SOURCE = 0x54
MCAST_EXCLUDE = 0x2
MCAST_INCLUDE = 0x1
MCAST_JOIN_GROUP = 0x50
MCAST_JOIN_SOURCE_GROUP = 0x52
MCAST_LEAVE_GROUP = 0x51
MCAST_LEAVE_SOURCE_GROUP = 0x53
MCAST_UNBLOCK_SOURCE = 0x55
MCAST_UNDEFINED = 0x0
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MNT_ACLS = 0x8000000
@ -1027,10 +1077,12 @@ const (
MNT_SUSPEND = 0x4
MNT_SYNCHRONOUS = 0x2
MNT_UNION = 0x20
MNT_UNTRUSTED = 0x800000000
MNT_UPDATE = 0x10000
MNT_UPDATEMASK = 0x2d8d0807e
MNT_UPDATEMASK = 0xad8d0807e
MNT_USER = 0x8000
MNT_VISFLAGMASK = 0x3fef0ffff
MNT_VERIFIED = 0x400000000
MNT_VISFLAGMASK = 0xffef0ffff
MNT_WAIT = 0x1
MSG_CMSG_CLOEXEC = 0x40000
MSG_COMPAT = 0x8000
@ -1059,6 +1111,7 @@ const (
NFDBITS = 0x40
NOFLSH = 0x80000000
NOKERNINFO = 0x2000000
NOTE_ABSTIME = 0x10
NOTE_ATTRIB = 0x8
NOTE_CHILD = 0x4
NOTE_CLOSE = 0x100
@ -1213,7 +1266,6 @@ const (
RTV_WEIGHT = 0x100
RT_ALL_FIBS = -0x1
RT_BLACKHOLE = 0x40
RT_CACHING_CONTEXT = 0x1
RT_DEFAULT_FIB = 0x0
RT_HAS_GW = 0x80
RT_HAS_HEADER = 0x10
@ -1223,15 +1275,17 @@ const (
RT_LLE_CACHE = 0x100
RT_MAY_LOOP = 0x8
RT_MAY_LOOP_BIT = 0x3
RT_NORTREF = 0x2
RT_REJECT = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
SCM_BINTIME = 0x4
SCM_CREDS = 0x3
SCM_MONOTONIC = 0x6
SCM_REALTIME = 0x5
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
SCM_TIME_INFO = 0x7
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@ -1247,6 +1301,7 @@ const (
SIOCGETSGCNT = 0xc0207210
SIOCGETVIFCNT = 0xc028720f
SIOCGHIWAT = 0x40047301
SIOCGHWADDR = 0xc020693e
SIOCGI2C = 0xc020693d
SIOCGIFADDR = 0xc0206921
SIOCGIFBRDADDR = 0xc0206923
@ -1268,8 +1323,11 @@ const (
SIOCGIFPDSTADDR = 0xc0206948
SIOCGIFPHYS = 0xc0206935
SIOCGIFPSRCADDR = 0xc0206947
SIOCGIFRSSHASH = 0xc0186997
SIOCGIFRSSKEY = 0xc0946996
SIOCGIFSTATUS = 0xc331693b
SIOCGIFXMEDIA = 0xc030698b
SIOCGLANPCP = 0xc0206998
SIOCGLOWAT = 0x40047303
SIOCGPGRP = 0x40047309
SIOCGPRIVATE_0 = 0xc0206950
@ -1300,6 +1358,7 @@ const (
SIOCSIFPHYS = 0x80206936
SIOCSIFRVNET = 0xc020695b
SIOCSIFVNET = 0xc020695a
SIOCSLANPCP = 0x80206999
SIOCSLOWAT = 0x80047302
SIOCSPGRP = 0x80047308
SIOCSTUNFIB = 0x8020695f
@ -1318,6 +1377,7 @@ const (
SO_BINTIME = 0x2000
SO_BROADCAST = 0x20
SO_DEBUG = 0x1
SO_DOMAIN = 0x1019
SO_DONTROUTE = 0x10
SO_ERROR = 0x1007
SO_KEEPALIVE = 0x8
@ -1326,6 +1386,7 @@ const (
SO_LISTENINCQLEN = 0x1013
SO_LISTENQLEN = 0x1012
SO_LISTENQLIMIT = 0x1011
SO_MAX_PACING_RATE = 0x1018
SO_NOSIGPIPE = 0x800
SO_NO_DDP = 0x8000
SO_NO_OFFLOAD = 0x4000
@ -1338,11 +1399,19 @@ const (
SO_RCVTIMEO = 0x1006
SO_REUSEADDR = 0x4
SO_REUSEPORT = 0x200
SO_REUSEPORT_LB = 0x10000
SO_SETFIB = 0x1014
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_TIMESTAMP = 0x400
SO_TS_BINTIME = 0x1
SO_TS_CLOCK = 0x1017
SO_TS_CLOCK_MAX = 0x3
SO_TS_DEFAULT = 0x0
SO_TS_MONOTONIC = 0x3
SO_TS_REALTIME = 0x2
SO_TS_REALTIME_MICRO = 0x0
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_USER_COOKIE = 0x1015
@ -1386,10 +1455,45 @@ const (
TCOFLUSH = 0x2
TCOOFF = 0x1
TCOON = 0x2
TCP_BBR_ACK_COMP_ALG = 0x448
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
TCP_BBR_DRAIN_PG = 0x42e
TCP_BBR_EXTRA_GAIN = 0x449
TCP_BBR_IWINTSO = 0x42b
TCP_BBR_LOWGAIN_FD = 0x436
TCP_BBR_LOWGAIN_HALF = 0x435
TCP_BBR_LOWGAIN_THRESH = 0x434
TCP_BBR_MAX_RTO = 0x439
TCP_BBR_MIN_RTO = 0x438
TCP_BBR_ONE_RETRAN = 0x431
TCP_BBR_PACE_CROSS = 0x442
TCP_BBR_PACE_DEL_TAR = 0x43f
TCP_BBR_PACE_PER_SEC = 0x43e
TCP_BBR_PACE_SEG_MAX = 0x440
TCP_BBR_PACE_SEG_MIN = 0x441
TCP_BBR_PROBE_RTT_GAIN = 0x44d
TCP_BBR_PROBE_RTT_INT = 0x430
TCP_BBR_PROBE_RTT_LEN = 0x44e
TCP_BBR_RACK_RTT_USE = 0x44a
TCP_BBR_RECFORCE = 0x42c
TCP_BBR_REC_OVER_HPTS = 0x43a
TCP_BBR_RETRAN_WTSO = 0x44b
TCP_BBR_RWND_IS_APP = 0x42f
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
TCP_BBR_STARTUP_PG = 0x42d
TCP_BBR_UNLIMITED = 0x43b
TCP_BBR_USEDEL_RATE = 0x437
TCP_BBR_USE_LOWGAIN = 0x433
TCP_CA_NAME_MAX = 0x10
TCP_CCALGOOPT = 0x41
TCP_CONGESTION = 0x40
TCP_DATA_AFTER_CLOSE = 0x44c
TCP_DELACK = 0x48
TCP_FASTOPEN = 0x401
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
TCP_FASTOPEN_PSK_LEN = 0x10
TCP_FUNCTION_BLK = 0x2000
TCP_FUNCTION_NAME_LEN_MAX = 0x20
TCP_INFO = 0x20
@ -1397,6 +1501,12 @@ const (
TCP_KEEPIDLE = 0x100
TCP_KEEPINIT = 0x80
TCP_KEEPINTVL = 0x200
TCP_LOG = 0x22
TCP_LOGBUF = 0x23
TCP_LOGDUMP = 0x25
TCP_LOGDUMPID = 0x26
TCP_LOGID = 0x24
TCP_LOG_ID_LEN = 0x40
TCP_MAXBURST = 0x4
TCP_MAXHLEN = 0x3c
TCP_MAXOLEN = 0x28
@ -1412,8 +1522,30 @@ const (
TCP_NOPUSH = 0x4
TCP_PCAP_IN = 0x1000
TCP_PCAP_OUT = 0x800
TCP_RACK_EARLY_RECOV = 0x423
TCP_RACK_EARLY_SEG = 0x424
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
TCP_RACK_MIN_PACE = 0x445
TCP_RACK_MIN_PACE_SEG = 0x446
TCP_RACK_MIN_TO = 0x422
TCP_RACK_PACE_ALWAYS = 0x41f
TCP_RACK_PACE_MAX_SEG = 0x41e
TCP_RACK_PACE_REDUCE = 0x41d
TCP_RACK_PKT_DELAY = 0x428
TCP_RACK_PROP = 0x41b
TCP_RACK_PROP_RATE = 0x420
TCP_RACK_PRR_SENDALOT = 0x421
TCP_RACK_REORD_FADE = 0x426
TCP_RACK_REORD_THRESH = 0x425
TCP_RACK_SESS_CWV = 0x42a
TCP_RACK_TLP_INC_VAR = 0x429
TCP_RACK_TLP_REDUCE = 0x41c
TCP_RACK_TLP_THRESH = 0x427
TCP_RACK_TLP_USE = 0x447
TCP_VENDOR = 0x80000000
TCSAFLUSH = 0x2
TIMER_ABSTIME = 0x1
TIMER_RELTIME = 0x0
TIOCCBRK = 0x2000747a
TIOCCDTR = 0x20007478
TIOCCONS = 0x80047462
@ -1477,6 +1609,8 @@ const (
TIOCTIMESTAMP = 0x40107459
TIOCUCNTL = 0x80047466
TOSTOP = 0x400000
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VDISCARD = 0xf
VDSUSP = 0xb
VEOF = 0x0
@ -1488,6 +1622,7 @@ const (
VKILL = 0x5
VLNEXT = 0xe
VMIN = 0x10
VM_BCACHE_SIZE_MAX = 0x19000000
VQUIT = 0x9
VREPRINT = 0x6
VSTART = 0xc

2454
vendor/golang.org/x/sys/unix/zerrors_linux.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -214,22 +214,6 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimes(path string, timeval *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
@ -376,16 +360,6 @@ func pipe2(p *[2]_C_int, flags int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data int) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
@ -413,6 +387,32 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data int) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Access(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
@ -1352,7 +1352,7 @@ func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), uintptr(dev>>32), 0)
if e1 != 0 {
err = errnoErr(e1)
}

View File

@ -350,22 +350,6 @@ func Munlockall() (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 {
@ -403,6 +387,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data int) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {

View File

@ -1,4 +1,4 @@
// go run mksyscall.go -tags freebsd,arm64 -- syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go
// go run mksyscall.go -tags freebsd,arm64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build freebsd,arm64
@ -350,22 +350,6 @@ func Munlockall() (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 {
@ -403,6 +387,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data int) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {

87
vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go generated vendored Normal file
View File

@ -0,0 +1,87 @@
// go run mksyscall_solaris.go -illumos -tags illumos,amd64 syscall_illumos.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build illumos,amd64
package unix
import (
"unsafe"
)
//go:cgo_import_dynamic libc_readv readv "libc.so"
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
//go:cgo_import_dynamic libc_writev writev "libc.so"
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
//go:linkname procreadv libc_readv
//go:linkname procpreadv libc_preadv
//go:linkname procwritev libc_writev
//go:linkname procpwritev libc_pwritev
var (
procreadv,
procpreadv,
procwritev,
procpwritev syscallFunc
)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovs []Iovec) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procreadv)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovs []Iovec, off int64) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpreadv)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovs []Iovec) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwritev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovs []Iovec, off int64) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwritev)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}

1825
vendor/golang.org/x/sys/unix/zsyscall_linux.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -128,9 +128,9 @@ type Statfs_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [1024]int8
Mntonname [1024]int8
Fstypename [16]byte
Mntfromname [1024]byte
Mntonname [1024]byte
}
type statfs_freebsd11_t struct {
@ -153,9 +153,9 @@ type statfs_freebsd11_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [88]int8
Mntonname [88]int8
Fstypename [16]byte
Mntfromname [88]byte
Mntonname [88]byte
}
type Flock_t struct {
@ -375,15 +375,15 @@ type PtraceLwpInfoStruct struct {
}
type __Siginfo struct {
Signo int32
Errno int32
Code int32
Pid int32
Uid uint32
Status int32
Addr *byte
Value [4]byte
X_reason [32]byte
Signo int32
Errno int32
Code int32
Pid int32
Uid uint32
Status int32
Addr *byte
Value [4]byte
_ [32]byte
}
type Sigset_t struct {
@ -458,7 +458,7 @@ type ifMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Data ifData
}
@ -469,7 +469,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@ -536,7 +535,7 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Metric int32
}
@ -547,7 +546,7 @@ type IfmaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
}
type IfAnnounceMsghdr struct {
@ -564,7 +563,7 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
_ uint16
Flags int32
Addrs int32
Pid int32

View File

@ -123,9 +123,9 @@ type Statfs_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [1024]int8
Mntonname [1024]int8
Fstypename [16]byte
Mntfromname [1024]byte
Mntonname [1024]byte
}
type statfs_freebsd11_t struct {
@ -148,9 +148,9 @@ type statfs_freebsd11_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [88]int8
Mntonname [88]int8
Fstypename [16]byte
Mntfromname [88]byte
Mntonname [88]byte
}
type Flock_t struct {
@ -275,10 +275,8 @@ type IPv6Mreq struct {
type Msghdr struct {
Name *byte
Namelen uint32
_ [4]byte
Iov *Iovec
Iovlen int32
_ [4]byte
Control *byte
Controllen uint32
Flags int32
@ -463,7 +461,7 @@ type ifMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Data ifData
}
@ -474,7 +472,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@ -541,7 +538,7 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Metric int32
}
@ -552,7 +549,7 @@ type IfmaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
}
type IfAnnounceMsghdr struct {
@ -569,7 +566,7 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
_ uint16
Flags int32
Addrs int32
Pid int32
@ -623,7 +620,6 @@ type BpfZbuf struct {
type BpfProgram struct {
Len uint32
_ [4]byte
Insns *BpfInsn
}

View File

@ -1,4 +1,4 @@
// cgo -godefs types_freebsd.go | go run mkpost.go
// cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm64,freebsd
@ -123,9 +123,9 @@ type Statfs_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [1024]int8
Mntonname [1024]int8
Fstypename [16]byte
Mntfromname [1024]byte
Mntonname [1024]byte
}
type statfs_freebsd11_t struct {
@ -148,9 +148,9 @@ type statfs_freebsd11_t struct {
Owner uint32
Fsid Fsid
Charspare [80]int8
Fstypename [16]int8
Mntfromname [88]int8
Mntonname [88]int8
Fstypename [16]byte
Mntfromname [88]byte
Mntonname [88]byte
}
type Flock_t struct {
@ -275,10 +275,8 @@ type IPv6Mreq struct {
type Msghdr struct {
Name *byte
Namelen uint32
_ [4]byte
Iov *Iovec
Iovlen int32
_ [4]byte
Control *byte
Controllen uint32
Flags int32
@ -326,11 +324,9 @@ const (
PTRACE_CONT = 0x7
PTRACE_DETACH = 0xb
PTRACE_GETFPREGS = 0x23
PTRACE_GETFSBASE = 0x47
PTRACE_GETLWPLIST = 0xf
PTRACE_GETNUMLWPS = 0xe
PTRACE_GETREGS = 0x21
PTRACE_GETXSTATE = 0x45
PTRACE_IO = 0xc
PTRACE_KILL = 0x8
PTRACE_LWPEVENTS = 0x18
@ -373,15 +369,15 @@ type PtraceLwpInfoStruct struct {
}
type __Siginfo struct {
Signo int32
Errno int32
Code int32
Pid int32
Uid uint32
Status int32
Addr *byte
Value [8]byte
X_reason [40]byte
Signo int32
Errno int32
Code int32
Pid int32
Uid uint32
Status int32
Addr *byte
Value [8]byte
_ [40]byte
}
type Sigset_t struct {
@ -394,12 +390,14 @@ type Reg struct {
Sp uint64
Elr uint64
Spsr uint32
_ [4]byte
}
type FpReg struct {
Fp_q [512]uint8
Fp_sr uint32
Fp_cr uint32
Q [32][16]uint8
Sr uint32
Cr uint32
_ [8]byte
}
type PtraceIoDesc struct {
@ -441,7 +439,7 @@ type ifMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Data ifData
}
@ -452,7 +450,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@ -519,7 +516,7 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
Metric int32
}
@ -530,7 +527,7 @@ type IfmaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
_ uint16
}
type IfAnnounceMsghdr struct {
@ -547,7 +544,7 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
_ uint16
Flags int32
Addrs int32
Pid int32
@ -601,7 +598,6 @@ type BpfZbuf struct {
type BpfProgram struct {
Len uint32
_ [4]byte
Insns *BpfInsn
}

2293
vendor/golang.org/x/sys/unix/ztypes_linux.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

11
vendor/modules.txt vendored
View File

@ -253,8 +253,6 @@ github.com/skratchdot/open-golang/open
## explicit
# github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337
## explicit
# github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1
github.com/spacemonkeygo/errors
# github.com/spacemonkeygo/monkit/v3 v3.0.7-0.20200515175308-072401d8c752
github.com/spacemonkeygo/monkit/v3
github.com/spacemonkeygo/monkit/v3/monotime
@ -272,7 +270,7 @@ github.com/stretchr/testify/require
# github.com/t3rm1n4l/go-mega v0.0.0-20200117211730-79a813bb328d
## explicit
github.com/t3rm1n4l/go-mega
# github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b
# github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3
github.com/vivint/infectious
# github.com/xanzy/ssh-agent v0.2.1
## explicit
@ -381,7 +379,7 @@ golang.org/x/oauth2/jwt
## explicit
golang.org/x/sync/errgroup
golang.org/x/sync/semaphore
# golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
# golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
## explicit
golang.org/x/sys/cpu
golang.org/x/sys/unix
@ -465,7 +463,7 @@ google.golang.org/grpc/tap
# gopkg.in/yaml.v2 v2.2.8
## explicit
gopkg.in/yaml.v2
# storj.io/common v0.0.0-20200529121635-ef4a5bc8ec88
# storj.io/common v0.0.0-20200611114417-9a3d012fdb62
storj.io/common/encryption
storj.io/common/errs2
storj.io/common/fpath
@ -504,7 +502,7 @@ storj.io/drpc/drpcmux
storj.io/drpc/drpcsignal
storj.io/drpc/drpcstream
storj.io/drpc/drpcwire
# storj.io/uplink v1.0.7
# storj.io/uplink v1.1.1
## explicit
storj.io/uplink
storj.io/uplink/internal/expose
@ -512,7 +510,6 @@ storj.io/uplink/internal/telemetryclient
storj.io/uplink/private/ecclient
storj.io/uplink/private/eestream
storj.io/uplink/private/metainfo
storj.io/uplink/private/metainfo/kvmetainfo
storj.io/uplink/private/piecestore
storj.io/uplink/private/storage/segments
storj.io/uplink/private/storage/streams

231
vendor/storj.io/common/LICENSE generated vendored
View File

@ -1,202 +1,49 @@
Copyright (c) 2020 Storj Labs, Inc.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Definitions.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
Subject to the terms and conditions of this license, each copyright holder and
contributor hereby grants to those receiving rights under this license a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except for failure to satisfy the conditions of this license) patent license
to make, have made, use, offer to sell, sell, import, and otherwise transfer
this software, where such license applies only to those patent claims, already
acquired or hereafter acquired, licensable by such copyright holder or
contributor that are necessarily infringed by:
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
(a) their Contribution(s) (the licensed copyrights of copyright holders and
non-copyrightable additions of contributors, in source or binary form)
alone;
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
or
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
(b) combination of their Contribution(s) with the work of authorship to which
such Contribution(s) was added by such copyright holder or contributor, if,
at the time the Contribution is added, such addition causes such
combination to be necessarily infringed. The patent license shall not apply
to any other combinations which include the Contribution.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
Except as expressly stated above, no rights or licenses from any copyright
holder or contributor is granted under this license, whether expressly, by
implication, estoppel or otherwise.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
DISCLAIMER
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -15,6 +15,12 @@ import (
"storj.io/common/pb"
)
// revoker is supplied when checking a macaroon for validation.
type revoker interface {
// Check is intended to return a bool if any of the supplied tails are revoked.
Check(ctx context.Context, tails [][]byte) (bool, error)
}
var (
// Error is a general API Key error.
Error = errs.Class("api key error")
@ -99,7 +105,7 @@ func NewAPIKey(secret []byte) (*APIKey, error) {
// Check makes sure that the key authorizes the provided action given the root
// project secret and any possible revocations, returning an error if the action
// is not authorized. 'revoked' is a list of revoked heads.
func (a *APIKey) Check(ctx context.Context, secret []byte, action Action, revoked [][]byte) (err error) {
func (a *APIKey) Check(ctx context.Context, secret []byte, action Action, revoker revoker) (err error) {
defer mon.Task()(&ctx)(&err)
if !a.mac.Validate(secret) {
return ErrInvalid.New("macaroon unauthorized")
@ -122,10 +128,13 @@ func (a *APIKey) Check(ctx context.Context, secret []byte, action Action, revoke
}
}
head := a.mac.Head()
for _, revokedID := range revoked {
if bytes.Equal(revokedID, head) {
return ErrRevoked.New("macaroon head revoked")
if revoker != nil {
revoked, err := revoker.Check(ctx, a.mac.Tails(secret))
if err != nil {
return ErrRevoked.Wrap(err)
}
if revoked {
return ErrRevoked.New("contains revoked tail")
}
}

View File

@ -54,7 +54,7 @@ func (x TransferFailed_Error) String() string {
}
func (TransferFailed_Error) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{8, 0}
return fileDescriptor_8f0acbf2ce5fa631, []int{11, 0}
}
type ExitFailed_Reason int32
@ -82,9 +82,40 @@ func (x ExitFailed_Reason) String() string {
}
func (ExitFailed_Reason) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{14, 0}
return fileDescriptor_8f0acbf2ce5fa631, []int{17, 0}
}
type GracefulExitFeasibilityNodeRequest struct {
NodeId NodeID `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3,customtype=NodeID" json:"node_id"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GracefulExitFeasibilityNodeRequest) Reset() { *m = GracefulExitFeasibilityNodeRequest{} }
func (m *GracefulExitFeasibilityNodeRequest) String() string { return proto.CompactTextString(m) }
func (*GracefulExitFeasibilityNodeRequest) ProtoMessage() {}
func (*GracefulExitFeasibilityNodeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{0}
}
func (m *GracefulExitFeasibilityNodeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GracefulExitFeasibilityNodeRequest.Unmarshal(m, b)
}
func (m *GracefulExitFeasibilityNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GracefulExitFeasibilityNodeRequest.Marshal(b, m, deterministic)
}
func (m *GracefulExitFeasibilityNodeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GracefulExitFeasibilityNodeRequest.Merge(m, src)
}
func (m *GracefulExitFeasibilityNodeRequest) XXX_Size() int {
return xxx_messageInfo_GracefulExitFeasibilityNodeRequest.Size(m)
}
func (m *GracefulExitFeasibilityNodeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GracefulExitFeasibilityNodeRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GracefulExitFeasibilityNodeRequest proto.InternalMessageInfo
type GetNonExitingSatellitesRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@ -95,7 +126,7 @@ func (m *GetNonExitingSatellitesRequest) Reset() { *m = GetNonExitingSat
func (m *GetNonExitingSatellitesRequest) String() string { return proto.CompactTextString(m) }
func (*GetNonExitingSatellitesRequest) ProtoMessage() {}
func (*GetNonExitingSatellitesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{0}
return fileDescriptor_8f0acbf2ce5fa631, []int{1}
}
func (m *GetNonExitingSatellitesRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetNonExitingSatellitesRequest.Unmarshal(m, b)
@ -126,7 +157,7 @@ func (m *InitiateGracefulExitRequest) Reset() { *m = InitiateGracefulExi
func (m *InitiateGracefulExitRequest) String() string { return proto.CompactTextString(m) }
func (*InitiateGracefulExitRequest) ProtoMessage() {}
func (*InitiateGracefulExitRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{1}
return fileDescriptor_8f0acbf2ce5fa631, []int{2}
}
func (m *InitiateGracefulExitRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InitiateGracefulExitRequest.Unmarshal(m, b)
@ -160,7 +191,7 @@ func (m *NonExitingSatellite) Reset() { *m = NonExitingSatellite{} }
func (m *NonExitingSatellite) String() string { return proto.CompactTextString(m) }
func (*NonExitingSatellite) ProtoMessage() {}
func (*NonExitingSatellite) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{2}
return fileDescriptor_8f0acbf2ce5fa631, []int{3}
}
func (m *NonExitingSatellite) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NonExitingSatellite.Unmarshal(m, b)
@ -205,7 +236,7 @@ func (m *GetNonExitingSatellitesResponse) Reset() { *m = GetNonExitingSa
func (m *GetNonExitingSatellitesResponse) String() string { return proto.CompactTextString(m) }
func (*GetNonExitingSatellitesResponse) ProtoMessage() {}
func (*GetNonExitingSatellitesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{3}
return fileDescriptor_8f0acbf2ce5fa631, []int{4}
}
func (m *GetNonExitingSatellitesResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetNonExitingSatellitesResponse.Unmarshal(m, b)
@ -242,7 +273,7 @@ func (m *GetExitProgressRequest) Reset() { *m = GetExitProgressRequest{}
func (m *GetExitProgressRequest) String() string { return proto.CompactTextString(m) }
func (*GetExitProgressRequest) ProtoMessage() {}
func (*GetExitProgressRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{4}
return fileDescriptor_8f0acbf2ce5fa631, []int{5}
}
func (m *GetExitProgressRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetExitProgressRequest.Unmarshal(m, b)
@ -273,7 +304,7 @@ func (m *GetExitProgressResponse) Reset() { *m = GetExitProgressResponse
func (m *GetExitProgressResponse) String() string { return proto.CompactTextString(m) }
func (*GetExitProgressResponse) ProtoMessage() {}
func (*GetExitProgressResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{5}
return fileDescriptor_8f0acbf2ce5fa631, []int{6}
}
func (m *GetExitProgressResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetExitProgressResponse.Unmarshal(m, b)
@ -315,7 +346,7 @@ func (m *ExitProgress) Reset() { *m = ExitProgress{} }
func (m *ExitProgress) String() string { return proto.CompactTextString(m) }
func (*ExitProgress) ProtoMessage() {}
func (*ExitProgress) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{6}
return fileDescriptor_8f0acbf2ce5fa631, []int{7}
}
func (m *ExitProgress) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExitProgress.Unmarshal(m, b)
@ -363,6 +394,90 @@ func (m *ExitProgress) GetCompletionReceipt() []byte {
return nil
}
type GracefulExitFeasibilityRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GracefulExitFeasibilityRequest) Reset() { *m = GracefulExitFeasibilityRequest{} }
func (m *GracefulExitFeasibilityRequest) String() string { return proto.CompactTextString(m) }
func (*GracefulExitFeasibilityRequest) ProtoMessage() {}
func (*GracefulExitFeasibilityRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{8}
}
func (m *GracefulExitFeasibilityRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GracefulExitFeasibilityRequest.Unmarshal(m, b)
}
func (m *GracefulExitFeasibilityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GracefulExitFeasibilityRequest.Marshal(b, m, deterministic)
}
func (m *GracefulExitFeasibilityRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GracefulExitFeasibilityRequest.Merge(m, src)
}
func (m *GracefulExitFeasibilityRequest) XXX_Size() int {
return xxx_messageInfo_GracefulExitFeasibilityRequest.Size(m)
}
func (m *GracefulExitFeasibilityRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GracefulExitFeasibilityRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GracefulExitFeasibilityRequest proto.InternalMessageInfo
type GracefulExitFeasibilityResponse struct {
JoinedAt time.Time `protobuf:"bytes,1,opt,name=joined_at,json=joinedAt,proto3,stdtime" json:"joined_at"`
MonthsRequired int32 `protobuf:"varint,2,opt,name=months_required,json=monthsRequired,proto3" json:"months_required,omitempty"`
IsAllowed bool `protobuf:"varint,3,opt,name=is_allowed,json=isAllowed,proto3" json:"is_allowed,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GracefulExitFeasibilityResponse) Reset() { *m = GracefulExitFeasibilityResponse{} }
func (m *GracefulExitFeasibilityResponse) String() string { return proto.CompactTextString(m) }
func (*GracefulExitFeasibilityResponse) ProtoMessage() {}
func (*GracefulExitFeasibilityResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{9}
}
func (m *GracefulExitFeasibilityResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GracefulExitFeasibilityResponse.Unmarshal(m, b)
}
func (m *GracefulExitFeasibilityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GracefulExitFeasibilityResponse.Marshal(b, m, deterministic)
}
func (m *GracefulExitFeasibilityResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GracefulExitFeasibilityResponse.Merge(m, src)
}
func (m *GracefulExitFeasibilityResponse) XXX_Size() int {
return xxx_messageInfo_GracefulExitFeasibilityResponse.Size(m)
}
func (m *GracefulExitFeasibilityResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GracefulExitFeasibilityResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GracefulExitFeasibilityResponse proto.InternalMessageInfo
func (m *GracefulExitFeasibilityResponse) GetJoinedAt() time.Time {
if m != nil {
return m.JoinedAt
}
return time.Time{}
}
func (m *GracefulExitFeasibilityResponse) GetMonthsRequired() int32 {
if m != nil {
return m.MonthsRequired
}
return 0
}
func (m *GracefulExitFeasibilityResponse) GetIsAllowed() bool {
if m != nil {
return m.IsAllowed
}
return false
}
type TransferSucceeded struct {
OriginalOrderLimit *OrderLimit `protobuf:"bytes,1,opt,name=original_order_limit,json=originalOrderLimit,proto3" json:"original_order_limit,omitempty"`
OriginalPieceHash *PieceHash `protobuf:"bytes,2,opt,name=original_piece_hash,json=originalPieceHash,proto3" json:"original_piece_hash,omitempty"`
@ -377,7 +492,7 @@ func (m *TransferSucceeded) Reset() { *m = TransferSucceeded{} }
func (m *TransferSucceeded) String() string { return proto.CompactTextString(m) }
func (*TransferSucceeded) ProtoMessage() {}
func (*TransferSucceeded) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{7}
return fileDescriptor_8f0acbf2ce5fa631, []int{10}
}
func (m *TransferSucceeded) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferSucceeded.Unmarshal(m, b)
@ -430,7 +545,7 @@ func (m *TransferFailed) Reset() { *m = TransferFailed{} }
func (m *TransferFailed) String() string { return proto.CompactTextString(m) }
func (*TransferFailed) ProtoMessage() {}
func (*TransferFailed) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{8}
return fileDescriptor_8f0acbf2ce5fa631, []int{11}
}
func (m *TransferFailed) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferFailed.Unmarshal(m, b)
@ -471,7 +586,7 @@ func (m *StorageNodeMessage) Reset() { *m = StorageNodeMessage{} }
func (m *StorageNodeMessage) String() string { return proto.CompactTextString(m) }
func (*StorageNodeMessage) ProtoMessage() {}
func (*StorageNodeMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{9}
return fileDescriptor_8f0acbf2ce5fa631, []int{12}
}
func (m *StorageNodeMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StorageNodeMessage.Unmarshal(m, b)
@ -610,7 +725,7 @@ func (m *NotReady) Reset() { *m = NotReady{} }
func (m *NotReady) String() string { return proto.CompactTextString(m) }
func (*NotReady) ProtoMessage() {}
func (*NotReady) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{10}
return fileDescriptor_8f0acbf2ce5fa631, []int{13}
}
func (m *NotReady) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NotReady.Unmarshal(m, b)
@ -644,7 +759,7 @@ func (m *TransferPiece) Reset() { *m = TransferPiece{} }
func (m *TransferPiece) String() string { return proto.CompactTextString(m) }
func (*TransferPiece) ProtoMessage() {}
func (*TransferPiece) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{11}
return fileDescriptor_8f0acbf2ce5fa631, []int{14}
}
func (m *TransferPiece) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TransferPiece.Unmarshal(m, b)
@ -682,7 +797,7 @@ func (m *DeletePiece) Reset() { *m = DeletePiece{} }
func (m *DeletePiece) String() string { return proto.CompactTextString(m) }
func (*DeletePiece) ProtoMessage() {}
func (*DeletePiece) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{12}
return fileDescriptor_8f0acbf2ce5fa631, []int{15}
}
func (m *DeletePiece) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeletePiece.Unmarshal(m, b)
@ -720,7 +835,7 @@ func (m *ExitCompleted) Reset() { *m = ExitCompleted{} }
func (m *ExitCompleted) String() string { return proto.CompactTextString(m) }
func (*ExitCompleted) ProtoMessage() {}
func (*ExitCompleted) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{13}
return fileDescriptor_8f0acbf2ce5fa631, []int{16}
}
func (m *ExitCompleted) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExitCompleted.Unmarshal(m, b)
@ -773,7 +888,7 @@ func (m *ExitFailed) Reset() { *m = ExitFailed{} }
func (m *ExitFailed) String() string { return proto.CompactTextString(m) }
func (*ExitFailed) ProtoMessage() {}
func (*ExitFailed) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{14}
return fileDescriptor_8f0acbf2ce5fa631, []int{17}
}
func (m *ExitFailed) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ExitFailed.Unmarshal(m, b)
@ -831,7 +946,7 @@ func (m *SatelliteMessage) Reset() { *m = SatelliteMessage{} }
func (m *SatelliteMessage) String() string { return proto.CompactTextString(m) }
func (*SatelliteMessage) ProtoMessage() {}
func (*SatelliteMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_8f0acbf2ce5fa631, []int{15}
return fileDescriptor_8f0acbf2ce5fa631, []int{18}
}
func (m *SatelliteMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SatelliteMessage.Unmarshal(m, b)
@ -1053,6 +1168,7 @@ func _SatelliteMessage_OneofSizer(msg proto.Message) (n int) {
func init() {
proto.RegisterEnum("gracefulexit.TransferFailed_Error", TransferFailed_Error_name, TransferFailed_Error_value)
proto.RegisterEnum("gracefulexit.ExitFailed_Reason", ExitFailed_Reason_name, ExitFailed_Reason_value)
proto.RegisterType((*GracefulExitFeasibilityNodeRequest)(nil), "gracefulexit.GracefulExitFeasibilityNodeRequest")
proto.RegisterType((*GetNonExitingSatellitesRequest)(nil), "gracefulexit.GetNonExitingSatellitesRequest")
proto.RegisterType((*InitiateGracefulExitRequest)(nil), "gracefulexit.InitiateGracefulExitRequest")
proto.RegisterType((*NonExitingSatellite)(nil), "gracefulexit.NonExitingSatellite")
@ -1060,6 +1176,8 @@ func init() {
proto.RegisterType((*GetExitProgressRequest)(nil), "gracefulexit.GetExitProgressRequest")
proto.RegisterType((*GetExitProgressResponse)(nil), "gracefulexit.GetExitProgressResponse")
proto.RegisterType((*ExitProgress)(nil), "gracefulexit.ExitProgress")
proto.RegisterType((*GracefulExitFeasibilityRequest)(nil), "gracefulexit.GracefulExitFeasibilityRequest")
proto.RegisterType((*GracefulExitFeasibilityResponse)(nil), "gracefulexit.GracefulExitFeasibilityResponse")
proto.RegisterType((*TransferSucceeded)(nil), "gracefulexit.TransferSucceeded")
proto.RegisterType((*TransferFailed)(nil), "gracefulexit.TransferFailed")
proto.RegisterType((*StorageNodeMessage)(nil), "gracefulexit.StorageNodeMessage")
@ -1074,86 +1192,94 @@ func init() {
func init() { proto.RegisterFile("gracefulexit.proto", fileDescriptor_8f0acbf2ce5fa631) }
var fileDescriptor_8f0acbf2ce5fa631 = []byte{
// 1260 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x5d, 0x73, 0xdb, 0x54,
0x13, 0xb6, 0x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0x3b, 0x86, 0x1c, 0xf3, 0xce, 0x15, 0x8b, 0xfe, 0x2f, 0x47, 0xdc, 0x5e,
0xfc, 0x82, 0xb8, 0x1e, 0x77, 0x9e, 0x94, 0x19, 0xdf, 0x6c, 0xf0, 0x76, 0x9b, 0xdb, 0x9b, 0x9d,
0xd3, 0xd3, 0xc9, 0x40, 0xb3, 0xde, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x03, 0x63, 0xdd, 0xfc,
0x8f, 0x0e, 0x00, 0x00,
}
// --- DRPC BEGIN ---
@ -1167,6 +1293,8 @@ type DRPCNodeGracefulExitClient interface {
InitiateGracefulExit(ctx context.Context, in *InitiateGracefulExitRequest) (*ExitProgress, error)
// GetExitProgress returns graceful exit status on each satellite for a given storagenode.
GetExitProgress(ctx context.Context, in *GetExitProgressRequest) (*GetExitProgressResponse, error)
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityNodeRequest) (*GracefulExitFeasibilityResponse, error)
}
type drpcNodeGracefulExitClient struct {
@ -1206,6 +1334,15 @@ func (c *drpcNodeGracefulExitClient) GetExitProgress(ctx context.Context, in *Ge
return out, nil
}
func (c *drpcNodeGracefulExitClient) GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityNodeRequest) (*GracefulExitFeasibilityResponse, error) {
out := new(GracefulExitFeasibilityResponse)
err := c.cc.Invoke(ctx, "/gracefulexit.NodeGracefulExit/GracefulExitFeasibility", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCNodeGracefulExitServer interface {
// GetSatellitesList returns a list of satellites that the storagenode has not exited.
GetNonExitingSatellites(context.Context, *GetNonExitingSatellitesRequest) (*GetNonExitingSatellitesResponse, error)
@ -1213,11 +1350,13 @@ type DRPCNodeGracefulExitServer interface {
InitiateGracefulExit(context.Context, *InitiateGracefulExitRequest) (*ExitProgress, error)
// GetExitProgress returns graceful exit status on each satellite for a given storagenode.
GetExitProgress(context.Context, *GetExitProgressRequest) (*GetExitProgressResponse, error)
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(context.Context, *GracefulExitFeasibilityNodeRequest) (*GracefulExitFeasibilityResponse, error)
}
type DRPCNodeGracefulExitDescription struct{}
func (DRPCNodeGracefulExitDescription) NumMethods() int { return 3 }
func (DRPCNodeGracefulExitDescription) NumMethods() int { return 4 }
func (DRPCNodeGracefulExitDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
@ -1248,6 +1387,15 @@ func (DRPCNodeGracefulExitDescription) Method(n int) (string, drpc.Receiver, int
in1.(*GetExitProgressRequest),
)
}, DRPCNodeGracefulExitServer.GetExitProgress, true
case 3:
return "/gracefulexit.NodeGracefulExit/GracefulExitFeasibility",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCNodeGracefulExitServer).
GracefulExitFeasibility(
ctx,
in1.(*GracefulExitFeasibilityNodeRequest),
)
}, DRPCNodeGracefulExitServer.GracefulExitFeasibility, true
default:
return "", nil, nil, false
}
@ -1305,11 +1453,29 @@ func (x *drpcNodeGracefulExitGetExitProgressStream) SendAndClose(m *GetExitProgr
return x.CloseSend()
}
type DRPCNodeGracefulExit_GracefulExitFeasibilityStream interface {
drpc.Stream
SendAndClose(*GracefulExitFeasibilityResponse) error
}
type drpcNodeGracefulExitGracefulExitFeasibilityStream struct {
drpc.Stream
}
func (x *drpcNodeGracefulExitGracefulExitFeasibilityStream) SendAndClose(m *GracefulExitFeasibilityResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
type DRPCSatelliteGracefulExitClient interface {
DRPCConn() drpc.Conn
// Process is called by storage nodes to initiate the graceful exit, get pieces to transfer, and receive exit status.
Process(ctx context.Context) (DRPCSatelliteGracefulExit_ProcessClient, error)
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type drpcSatelliteGracefulExitClient struct {
@ -1353,14 +1519,25 @@ func (x *drpcSatelliteGracefulExitProcessClient) Recv() (*SatelliteMessage, erro
return m, nil
}
func (c *drpcSatelliteGracefulExitClient) GracefulExitFeasibility(ctx context.Context, in *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error) {
out := new(GracefulExitFeasibilityResponse)
err := c.cc.Invoke(ctx, "/gracefulexit.SatelliteGracefulExit/GracefulExitFeasibility", in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCSatelliteGracefulExitServer interface {
// Process is called by storage nodes to initiate the graceful exit, get pieces to transfer, and receive exit status.
Process(DRPCSatelliteGracefulExit_ProcessStream) error
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
GracefulExitFeasibility(context.Context, *GracefulExitFeasibilityRequest) (*GracefulExitFeasibilityResponse, error)
}
type DRPCSatelliteGracefulExitDescription struct{}
func (DRPCSatelliteGracefulExitDescription) NumMethods() int { return 1 }
func (DRPCSatelliteGracefulExitDescription) NumMethods() int { return 2 }
func (DRPCSatelliteGracefulExitDescription) Method(n int) (string, drpc.Receiver, interface{}, bool) {
switch n {
@ -1372,6 +1549,15 @@ func (DRPCSatelliteGracefulExitDescription) Method(n int) (string, drpc.Receiver
&drpcSatelliteGracefulExitProcessStream{in1.(drpc.Stream)},
)
}, DRPCSatelliteGracefulExitServer.Process, true
case 1:
return "/gracefulexit.SatelliteGracefulExit/GracefulExitFeasibility",
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCSatelliteGracefulExitServer).
GracefulExitFeasibility(
ctx,
in1.(*GracefulExitFeasibilityRequest),
)
}, DRPCSatelliteGracefulExitServer.GracefulExitFeasibility, true
default:
return "", nil, nil, false
}
@ -1403,4 +1589,20 @@ func (x *drpcSatelliteGracefulExitProcessStream) Recv() (*StorageNodeMessage, er
return m, nil
}
type DRPCSatelliteGracefulExit_GracefulExitFeasibilityStream interface {
drpc.Stream
SendAndClose(*GracefulExitFeasibilityResponse) error
}
type drpcSatelliteGracefulExitGracefulExitFeasibilityStream struct {
drpc.Stream
}
func (x *drpcSatelliteGracefulExitGracefulExitFeasibilityStream) SendAndClose(m *GracefulExitFeasibilityResponse) error {
if err := x.MsgSend(m); err != nil {
return err
}
return x.CloseSend()
}
// --- DRPC END ---

View File

@ -19,6 +19,12 @@ service NodeGracefulExit {
rpc InitiateGracefulExit(InitiateGracefulExitRequest) returns (ExitProgress);
// GetExitProgress returns graceful exit status on each satellite for a given storagenode.
rpc GetExitProgress(GetExitProgressRequest) returns (GetExitProgressResponse);
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
rpc GracefulExitFeasibility(GracefulExitFeasibilityNodeRequest) returns (GracefulExitFeasibilityResponse);
}
message GracefulExitFeasibilityNodeRequest {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
}
message GetNonExitingSatellitesRequest{}
@ -55,6 +61,16 @@ message ExitProgress {
service SatelliteGracefulExit {
// Process is called by storage nodes to initiate the graceful exit, get pieces to transfer, and receive exit status.
rpc Process(stream StorageNodeMessage) returns (stream SatelliteMessage);
// GracefulExitFeasibility returns node's join date and satellites config's amount of months required for graceful exit to be allowed.
rpc GracefulExitFeasibility(GracefulExitFeasibilityRequest) returns (GracefulExitFeasibilityResponse);
}
message GracefulExitFeasibilityRequest {}
message GracefulExitFeasibilityResponse {
google.protobuf.Timestamp joined_at = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
int32 months_required = 2;
bool is_allowed = 3;
}
message TransferSucceeded {

View File

@ -69,7 +69,7 @@ type GetHeldAmountResponse struct {
NodeId NodeID `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3,customtype=NodeID" json:"node_id"`
CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
Codes string `protobuf:"bytes,4,opt,name=codes,proto3" json:"codes,omitempty"`
UsageAtRest float32 `protobuf:"fixed32,5,opt,name=usage_at_rest,json=usageAtRest,proto3" json:"usage_at_rest,omitempty"`
UsageAtRest float64 `protobuf:"fixed64,5,opt,name=usage_at_rest,json=usageAtRest,proto3" json:"usage_at_rest,omitempty"`
UsageGet int64 `protobuf:"varint,6,opt,name=usage_get,json=usageGet,proto3" json:"usage_get,omitempty"`
UsagePut int64 `protobuf:"varint,7,opt,name=usage_put,json=usagePut,proto3" json:"usage_put,omitempty"`
UsageGetRepair int64 `protobuf:"varint,8,opt,name=usage_get_repair,json=usageGetRepair,proto3" json:"usage_get_repair,omitempty"`
@ -136,7 +136,7 @@ func (m *GetHeldAmountResponse) GetCodes() string {
return ""
}
func (m *GetHeldAmountResponse) GetUsageAtRest() float32 {
func (m *GetHeldAmountResponse) GetUsageAtRest() float64 {
if m != nil {
return m.UsageAtRest
}
@ -333,44 +333,44 @@ func init() {
func init() { proto.RegisterFile("heldamount.proto", fileDescriptor_5c5d9f6e3ee97993) }
var fileDescriptor_5c5d9f6e3ee97993 = []byte{
// 583 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcb, 0x6e, 0x13, 0x3f,
0x14, 0xc6, 0xff, 0xd3, 0x4b, 0x2e, 0x27, 0x97, 0xf6, 0x6f, 0x52, 0x30, 0x61, 0x91, 0x21, 0xa0,
0x32, 0xab, 0x44, 0x2a, 0x4b, 0xd8, 0xa4, 0x20, 0x95, 0x6e, 0x50, 0x18, 0x8a, 0x90, 0xd8, 0x44,
0x93, 0xf8, 0x30, 0x0c, 0xca, 0xc4, 0x66, 0x6c, 0x0b, 0xf5, 0x2d, 0x78, 0x1c, 0x1e, 0x81, 0x67,
0x60, 0x51, 0xde, 0x04, 0x21, 0xdb, 0xe3, 0x4c, 0x08, 0xa8, 0x08, 0xb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, 0x05, 0x97, 0xc8,
0x68, 0xcf, 0xfd, 0x65, 0xfe, 0x6e, 0x78, 0x91, 0x64, 0x8c, 0x1e, 0x39, 0xde, 0x9c, 0x87, 0xb7,
0xec, 0xf7, 0x3f, 0x59, 0x2e, 0xa7, 0xc9, 0xa5, 0x54, 0x7a, 0x2e, 0xcb, 0xbd, 0x1a, 0xbe, 0x82,
0x9b, 0xdb, 0x85, 0x72, 0x33, 0x1e, 0x41, 0x5d, 0x38, 0x8d, 0x06, 0xe1, 0x6e, 0xd4, 0x3a, 0xb9,
0x3b, 0xda, 0x58, 0xf3, 0xdf, 0x6e, 0x53, 0xec, 0x3b, 0x4e, 0x3e, 0x07, 0x00, 0x55, 0x9d, 0xbc,
0x00, 0x38, 0x43, 0x35, 0x4d, 0x2e, 0x5f, 0x2a, 0x3d, 0x27, 0xe1, 0x35, 0x46, 0x76, 0xaa, 0xfe,
0x9f, 0x9f, 0x22, 0xaf, 0xa1, 0xfb, 0xf3, 0xe0, 0x64, 0xbb, 0xe9, 0xd7, 0xb4, 0xfd, 0xe1, 0x75,
0x88, 0x33, 0x3e, 0xed, 0xbd, 0x21, 0x52, 0xf1, 0xe2, 0xfd, 0x28, 0xe3, 0xe3, 0x05, 0xcf, 0x73,
0xbe, 0x1a, 0x8b, 0xf9, 0xbc, 0x66, 0x97, 0xf4, 0xe1, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd5,
0xec, 0x68, 0xae, 0xeb, 0x04, 0x00, 0x00,
// 581 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcf, 0x6e, 0x13, 0x31,
0x10, 0xc6, 0x59, 0xda, 0xe6, 0xcf, 0xe4, 0x4f, 0x8b, 0x49, 0xc1, 0x84, 0x43, 0x96, 0x80, 0xca,
0x9e, 0x12, 0xa9, 0x1c, 0xe1, 0x92, 0x82, 0x54, 0x7a, 0x41, 0x61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0xae, 0x14, 0xbd, 0xe1,
0x20, 0x2b, 0x4e, 0x9d, 0x46, 0x08, 0xec, 0x9a, 0xcd, 0xa1, 0xc4, 0xd6, 0xec, 0xd9, 0x68, 0xfc,
0x13, 0x32, 0x7a, 0xd3, 0x69, 0xe6, 0x4c, 0xfa, 0xd0, 0x60, 0x99, 0x14, 0x5c, 0x22, 0xa3, 0x3d,
0xf7, 0x97, 0xf9, 0xbb, 0xe1, 0x45, 0x92, 0x31, 0x7a, 0xe8, 0x78, 0x73, 0x1e, 0xde, 0xb6, 0xdf,
0xff, 0x64, 0xb9, 0x9c, 0x26, 0x17, 0x52, 0xe9, 0xb9, 0x2c, 0xf7, 0x6a, 0xf8, 0x1a, 0x6e, 0x6d,
0x17, 0xca, 0xcd, 0x78, 0x0c, 0x75, 0xe1, 0x34, 0x1a, 0x84, 0x3b, 0x51, 0xeb, 0xf8, 0xde, 0x68,
0x63, 0xcd, 0xff, 0xb8, 0x4d, 0xb1, 0xef, 0x38, 0xfe, 0x12, 0x00, 0x54, 0x75, 0xf2, 0x12, 0xe0,
0x14, 0xd5, 0x34, 0xb9, 0x78, 0xa5, 0xf4, 0x9c, 0x84, 0x57, 0x18, 0xd9, 0xa9, 0xfa, 0x7f, 0x7f,
0x8a, 0xbc, 0x81, 0xee, 0xaf, 0x83, 0x93, 0xed, 0xa6, 0xdf, 0xd3, 0xf6, 0x87, 0x57, 0x21, 0xce,
0xf8, 0xa4, 0xf7, 0x96, 0x48, 0xc5, 0x8b, 0x0f, 0xa3, 0x8c, 0x8f, 0x17, 0x3c, 0xcf, 0xf9, 0x6a,
0x2c, 0xe6, 0xf3, 0x9a, 0x5d, 0xd2, 0x47, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x39, 0xbf, 0xc5,
0x06, 0xeb, 0x04, 0x00, 0x00,
}
// --- DRPC BEGIN ---

View File

@ -21,25 +21,25 @@ message GetHeldAmountRequest {
message GetHeldAmountResponse {
google.protobuf.Timestamp period = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
bytes node_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
string codes = 4;
float usage_at_rest = 5;
int64 usage_get = 6;
int64 usage_put = 7;
int64 usage_get_repair = 8;
int64 usage_put_repair = 9;
int64 usage_get_audit = 10;
int64 comp_at_rest = 11;
int64 comp_get = 12;
int64 comp_put = 13;
int64 comp_get_repair = 14;
int64 comp_put_repair = 15;
int64 comp_get_audit = 16;
int64 surge_percent = 17;
int64 held = 18;
int64 owed = 19;
int64 disposed = 20;
int64 paid = 21;
google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
string codes = 4;
double usage_at_rest = 5;
int64 usage_get = 6;
int64 usage_put = 7;
int64 usage_get_repair = 8;
int64 usage_put_repair = 9;
int64 usage_get_audit = 10;
int64 comp_at_rest = 11;
int64 comp_get = 12;
int64 comp_put = 13;
int64 comp_get_repair = 14;
int64 comp_put_repair = 15;
int64 comp_get_audit = 16;
int64 surge_percent = 17;
int64 held = 18;
int64 owed = 19;
int64 disposed = 20;
int64 paid = 21;
}
message GetAllPaystubsRequest {}

View File

@ -6,7 +6,6 @@ package tlsopts
import (
"crypto/tls"
"crypto/x509"
"strings"
"storj.io/common/identity"
"storj.io/common/peertls"
@ -23,12 +22,6 @@ func (opts *Options) ClientTLSConfig(id storj.NodeID) *tls.Config {
return opts.tlsConfig(false, verifyIdentity(id))
}
// ClientTLSConfigPrefix returns a TSLConfig for use as a client in handshaking with a peer.
// The peer node id is validated to match the given prefix.
func (opts *Options) ClientTLSConfigPrefix(idPrefix string) *tls.Config {
return opts.tlsConfig(false, verifyIdentityPrefix(idPrefix))
}
// UnverifiedClientTLSConfig returns a TLSConfig for use as a client in handshaking with
// an unknown peer.
func (opts *Options) UnverifiedClientTLSConfig() *tls.Config {
@ -91,19 +84,3 @@ func verifyIdentity(id storj.NodeID) peertls.PeerCertVerificationFunc {
return nil
}
}
func verifyIdentityPrefix(idPrefix string) peertls.PeerCertVerificationFunc {
return func(_ [][]byte, parsedChains [][]*x509.Certificate) (err error) {
defer mon.TaskNamed("verifyIdentityPrefix")(nil)(&err)
peer, err := identity.PeerIdentityFromChain(parsedChains[0])
if err != nil {
return err
}
if !strings.HasPrefix(peer.ID.String(), idPrefix) {
return Error.New("peer ID did not match requested ID prefix")
}
return nil
}
}

52
vendor/storj.io/common/rpc/dial.go generated vendored
View File

@ -7,12 +7,10 @@ import (
"context"
"crypto/tls"
"net"
"strings"
"sync"
"time"
"github.com/zeebo/errs"
"go.uber.org/zap"
"storj.io/common/memory"
"storj.io/common/netutil"
@ -150,56 +148,6 @@ func (d Dialer) DialNodeURL(ctx context.Context, nodeURL storj.NodeURL) (_ *Conn
return d.dial(ctx, nodeURL.Address, d.TLSOptions.ClientTLSConfig(nodeURL.ID))
}
// DialAddressInsecureBestEffort is like DialAddressInsecure but tries to dial a node securely if
// it can.
//
// nodeURL is like a storj.NodeURL but (a) requires an address and (b) does not require a
// full node id and will work with just a node prefix. The format is either:
// * node_host:node_port
// * node_id_prefix@node_host:node_port
// Examples:
// * 33.20.0.1:7777
// * [2001:db8:1f70::999:de8:7648:6e8]:7777
// * 12vha9oTFnerx@33.20.0.1:7777
// * 12vha9oTFnerx@[2001:db8:1f70::999:de8:7648:6e8]:7777
//
// DialAddressInsecureBestEffort:
// * will use a node id if provided in the nodeURL paramenter
// * will otherwise look up the node address in a known map of node address to node ids and use
// the remembered node id.
// * will otherwise dial insecurely
func (d Dialer) DialAddressInsecureBestEffort(ctx context.Context, nodeURL string) (_ *Conn, err error) {
defer mon.Task()(&ctx)(&err)
if d.TLSOptions == nil {
return nil, Error.New("tls options not set when required for this dial")
}
var nodeIDPrefix, nodeAddress string
parts := strings.Split(nodeURL, "@")
switch len(parts) {
default:
return nil, Error.New("malformed node url: %q", nodeURL)
case 1:
nodeAddress = parts[0]
case 2:
nodeIDPrefix, nodeAddress = parts[0], parts[1]
}
if len(nodeIDPrefix) > 0 {
return d.dial(ctx, nodeAddress, d.TLSOptions.ClientTLSConfigPrefix(nodeIDPrefix))
}
if nodeID, found := KnownNodeID(nodeAddress); found {
return d.dial(ctx, nodeAddress, d.TLSOptions.ClientTLSConfig(nodeID))
}
zap.L().Warn(`Unknown node id for address. Specify node id in the form "node_id@node_host:node_port" for added security`,
zap.String("Address", nodeAddress),
)
return d.dial(ctx, nodeAddress, d.TLSOptions.UnverifiedClientTLSConfig())
}
// DialAddressInsecure dials to the specified address and does not check the node id.
func (d Dialer) DialAddressInsecure(ctx context.Context, address string) (_ *Conn, err error) {
defer mon.Task()(&ctx)(&err)

1
vendor/storj.io/uplink/Jenkinsfile generated vendored
View File

@ -103,6 +103,7 @@ pipeline {
stage('Integration [storj/storj]') {
environment {
STORJ_POSTGRES_TEST = 'postgres://postgres@localhost/teststorj2?sslmode=disable'
STORJ_COCKROACH_TEST = 'omit'
}
steps {
sh 'psql -U postgres -c \'create database teststorj2;\''

60
vendor/storj.io/uplink/LICENSE generated vendored
View File

@ -1,19 +1,49 @@
Copyright (c) 2020 Storj Labs, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Subject to the terms and conditions of this license, each copyright holder and
contributor hereby grants to those receiving rights under this license a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except for failure to satisfy the conditions of this license) patent license
to make, have made, use, offer to sell, sell, import, and otherwise transfer
this software, where such license applies only to those patent claims, already
acquired or hereafter acquired, licensable by such copyright holder or
contributor that are necessarily infringed by:
(a) their Contribution(s) (the licensed copyrights of copyright holders and
non-copyrightable additions of contributors, in source or binary form)
alone;
or
(b) combination of their Contribution(s) with the work of authorship to which
such Contribution(s) was added by such copyright holder or contributor, if,
at the time the Contribution is added, such addition causes such
combination to be necessarily infringed. The patent license shall not apply
to any other combinations which include the Contribution.
Except as expressly stated above, no rights or licenses from any copyright
holder or contributor is granted under this license, whether expressly, by
implication, estoppel or otherwise.
DISCLAIMER
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Some files were not shown because too many files have changed in this diff Show More