diff --git a/vendor/git.autistici.org/ai3/go-common/clientutil/json.go b/vendor/git.autistici.org/ai3/go-common/clientutil/json.go new file mode 100644 index 0000000000000000000000000000000000000000..5fc1ab2e4ab75061c44e816c79a874c580c73a73 --- /dev/null +++ b/vendor/git.autistici.org/ai3/go-common/clientutil/json.go @@ -0,0 +1,45 @@ +package clientutil + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "net/http" +) + +// DoJSONHTTPRequest makes an HTTP POST request to the specified uri, +// with a JSON-encoded request body. It will attempt to decode the +// response body as JSON. +func DoJSONHTTPRequest(ctx context.Context, client *http.Client, uri string, req, resp interface{}) error { + data, err := json.Marshal(req) + if err != nil { + return err + } + + httpReq, err := http.NewRequest("POST", uri, bytes.NewReader(data)) + if err != nil { + return err + } + httpReq.Header.Set("Content-Type", "application/json") + httpReq = httpReq.WithContext(ctx) + + httpResp, err := RetryHTTPDo(client, httpReq, NewExponentialBackOff()) + if err != nil { + return err + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != 200 { + return fmt.Errorf("HTTP status %d", httpResp.StatusCode) + } + if httpResp.Header.Get("Content-Type") != "application/json" { + return errors.New("not a JSON response") + } + + if resp == nil { + return nil + } + return json.NewDecoder(httpResp.Body).Decode(resp) +} diff --git a/vendor/git.autistici.org/ai3/go-common/clientutil/retry.go b/vendor/git.autistici.org/ai3/go-common/clientutil/retry.go index ae5159f1cc0b053d4ae54d6c7c8d2b68834b7bda..3ca7b51a48289a18cd829947cbdbc400392ffc93 100644 --- a/vendor/git.autistici.org/ai3/go-common/clientutil/retry.go +++ b/vendor/git.autistici.org/ai3/go-common/clientutil/retry.go @@ -2,7 +2,6 @@ package clientutil import ( "errors" - "net" "net/http" "time" @@ -18,14 +17,37 @@ func NewExponentialBackOff() *backoff.ExponentialBackOff { return b } -// Retry operation op until it succeeds according to the backoff policy b. +// A temporary (retriable) error is something that has a Temporary method. +type tempError interface { + Temporary() bool +} + +type tempErrorWrapper struct { + error +} + +func (t tempErrorWrapper) Temporary() bool { return true } + +// TempError makes a temporary (retriable) error out of a normal error. +func TempError(err error) error { + return tempErrorWrapper{err} +} + +// Retry operation op until it succeeds according to the backoff +// policy b. +// +// Note that this function reverses the error semantics of +// backoff.Operation: all errors are permanent unless explicitly +// marked as temporary (i.e. they have a Temporary() method that +// returns true). This is to better align with the errors returned by +// the net package. func Retry(op backoff.Operation, b backoff.BackOff) error { innerOp := func() error { err := op() if err == nil { return err } - if netErr, ok := err.(net.Error); ok && netErr.Temporary() { + if tmpErr, ok := err.(tempError); ok && tmpErr.Temporary() { return err } return backoff.Permanent(err) @@ -33,12 +55,21 @@ func Retry(op backoff.Operation, b backoff.BackOff) error { return backoff.Retry(innerOp, b) } -var errHTTPBackOff = errors.New("http status 503") +var errHTTPBackOff = TempError(errors.New("temporary http error")) + +func isStatusTemporary(code int) bool { + switch code { + case http.StatusTooManyRequests, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout: + return true + default: + return false + } +} // RetryHTTPDo retries an HTTP request until it succeeds, according to // the backoff policy b. It will retry on temporary network errors and -// upon receiving specific throttling HTTP errors (currently just -// status code 503). +// upon receiving specific temporary HTTP errors. It will use the +// context associated with the HTTP request object. func RetryHTTPDo(client *http.Client, req *http.Request, b backoff.BackOff) (*http.Response, error) { var resp *http.Response op := func() error { @@ -49,13 +80,13 @@ func RetryHTTPDo(client *http.Client, req *http.Request, b backoff.BackOff) (*ht var err error resp, err = client.Do(req) - if err == nil && resp.StatusCode == 503 { + if err == nil && isStatusTemporary(resp.StatusCode) { resp.Body.Close() return errHTTPBackOff } return err } - err := Retry(op, b) + err := Retry(op, backoff.WithContext(b, req.Context())) return resp, err } diff --git a/vendor/git.autistici.org/ai3/go-common/clientutil/transport.go b/vendor/git.autistici.org/ai3/go-common/clientutil/transport.go index 3894ca121444af667d67c07d9e4c8292c9daee74..e4f98e3f60ccbf214ff10db1b2860bb6bb1d8ed0 100644 --- a/vendor/git.autistici.org/ai3/go-common/clientutil/transport.go +++ b/vendor/git.autistici.org/ai3/go-common/clientutil/transport.go @@ -125,6 +125,9 @@ func (b *balancer) dial(ctx context.Context, network, addr string) (net.Conn, er if err == nil { return conn, nil } else if err == context.Canceled { + // A timeout might be bad, set the error bit + // on the connection. + b.notify(addr, false) return nil, err } b.notify(addr, false) diff --git a/vendor/git.autistici.org/id/auth/README.md b/vendor/git.autistici.org/id/auth/README.md index 30016037af37b52b6cb09005af9e7b6b67c06692..3bd575245200f10eb31401c63af264d6f30c222a 100644 --- a/vendor/git.autistici.org/id/auth/README.md +++ b/vendor/git.autistici.org/id/auth/README.md @@ -1,113 +1,177 @@ -A/I Auth Server -=============== +auth-server +=========== -An authentication server with an LDAP backend and some advanced -features: +A low-level authentication server with pluggable backends and some +advanced features: -* OTP support +* two-factor authentication support (TOTP, U2F) * application-specific passwords * rate limiting and brute force protection -* user partitioning across multiple backends +* new device detection -The authentication server can be queried using an HTTP API. The -software includes a PAM module (pam_authclient) that can be used -to integrate system services. +Its purpose is to be the single point of authentication for all +authentication flows in a service. +# Deployment -# Configuration +The auth-server is fully stateless: it delegates state to other +backends such as Memcached for short-term storage, and +[usermetadb](https://git.autistici.org/id/usermetadb) for long-term +anonymized user activity data. For this reason, it is recommended to +install an auth-server on every host. + +It listens for authorization requests over a UNIX socket. UNIX +permissions should be used to control access to the socket if +necessary. Clients speak a custom simple line-based attribute/value +protocol, and can send multiple requests over the same connection. + +## Services + +A *service* in auth-server is a specific scope for an authentication +workflow, normally associated with a specific user-facing +service. Multiple services can be defined, each with its own +functionality and user backends. + +## User backends The authentication server data model is based on the concept of a *user account*. The server knows how to retrieve user accounts stored in LDAP, but it has to be told the specific details of how to find them and how to map the information there to what it needs. -The server's behavior can be configured with a Python file defining -some module-level variables: -* `LDAP_URI` is the LDAP connection string. -* `LDAP_BIND_DN` and `LDAP_BIND_PW` specify the bind credentials: they - should allow the server to read authentication-related attributes on - the user objects, and to search the user subtree. -* `LDAP_SERVICE_MAP` is a `{service: query}` dictionary that defines - how to query the LDAP database for user accounts, for each service. -* `LDAP_SCHEMA` is a dictionary that describes how to retrieve - authentication information from the LDAP object attributes. +# Configuration -## Query definition +The behavior of auth-server can be configured with a YAML file. +The YAML file should contain a dictionary with the following attributes: + +* `services` is a dictionary describing all known services and their + authentication parameters. See the *Service definition* section below +* `rate_limits` defines the global rate limiters and blacklists. See + the *Rate limiting* section below. +* `enabled_backends` is the list of user backends that should be + enabled (the available backends are *file* and *ldap*) +* `ldap_config` specifies the configuration for the LDAP backend -- + see the *LDAP Backend* section below +* `user_meta_server` holds the configuration for the user-meta-server + backend: + * `backend_url` is the URL of the service + * `tls_config` configures TLS for the client: + * `cert` is the path to the client certificate + * `key` is the path to the client private key + * `ca` is the path to the CA store to verify the server certificate + +## Rate limiting + +Rate limits and blacklists are global (available to all services), to +allow brute force protection to work across multiple services. The +top-level configuration attribute `rate_limits` is a dictionary of +named rate limiting configurations, that can be later referenced in +the service-specific `rate_limits` list. Each rate limiter definition +should specify the following attributes: + +* `limit` counts the number of events to allow over a period of time +* `period` defines the period of time +* `blacklist_for` adds the client to a blacklist if their request rate + goes above the specified threshold +* `on_failure` is a boolean value, when true the rate limiter will + only be applied to failed authentication requests +* `keys` is a list of strings specifying the request identifiers that + will make up the rate limiter key. The list can include one or both + of *ip* (referring to the remote client's IP) and *user* (username) + +## Service definition + +Each service definition is a dictionary with the following attributes: + +* `backends` is a list of user backend specifications, each one should + include a backend-specific configuration under an attribute named + after the backend itself: + * `file` is simply a path to a user list file, see the *File + backend* section below + * `ldap` configues the LDAP backend for this service +* `challenge_response` is a boolean parameter that, when true, enables + two-factor authentication for this service (it should be enabled + only for interactive services) +* `enforce_2fa` is a boolean flag that, when true, will disable + non-2FA logins for this service +* `enable_device_tracking` is a boolean flag that enables device + tracking for this service (assuming the client provides device + information) +* `rate_limits` is a list of names of global rate limiters to be + applied to this service. + +## File backend + +The *file* backend reads users and their credentials from a +YAML-encoded file. This file should contain a list of dictionaries, +each representing a user, with the following attributes: + +* `name` is the username +* `email` is the email associated with the user (optional) +* `password` stores the encrypted password +* `totp_secret` stores the *unencrypted* TOTP secret seed +* `groups` is a list of group names that the user belongs to + +The file backend only supports TOTP as a two-factor authentication +method, U2F support is currently missing. + +## LDAP Backend + +The *ldap* backend will look up user information in a LDAP database. + +### Query definition LDAP queries are meant to return a single user account object from the -database using a *search* operation. They are represented as -dictionaries, with the following fields: - -* `dn`: specifies the full DN of the object -* `base`: specifies a base DN for the search -* `filter`: specifies a filter to apply to the search - -The `dn` and `base` attributes are mutually exclusive. In fact, -queries can be of two types: - -* If you can know the specific DN of a user account object given its - username, specify the `dn` field. This will run a SCOPE_BASE query - for that specific DN. In this case, `filter` is optional. -* Specify `base` and `filter` together to identify a single object. - This will result in a SCOPE_SUBTREE search starting at `base`. In - this case the `filter` attribute is required. - -On every incoming request, the query fields are subject to string -substitution, using the standard Python syntax of the `%` operator, -with the following client-provided variables available: - -* `user`: username -* `service`: authentication service -* `shard`: user shard +database using a *search* operation. There's two parts to it: first +the right object needs to be located, then we need to map the object's +attributes to someting that the auth-server understands. -So, for example, a mail service could use the following query: +The LDAP query for a service is defined by the following standard LDAP +parameters: - { - 'base': 'ou=Accounts,dc=example,dc=com', - 'filter': 'mail=%(user)s' - } +* `search_base` specifies a base DN for the search +* `search_filter` specifies a filter to apply to the search +* `scope` specifies the scope of the LDAP search, must be one of + *base*, *one* or *sub* +* `attrs` is a dictionary mapping LDAP attributes to their auth-server + metadata counterparts, see *Schema definition* below. -or alternatively, if the database structure is simple enough: +The `search_filter` should contain somewhere the literal string `%s`, +which will be replaced with the username in the final LDAP query. - { - 'dn': 'mail=%(user)s,ou=Accounts,dc=example,dc=com' - } - - -## Schema definition +### Schema definition In order to retrieve authentication information from the LDAP object, the authentication server needs to know which attributes to use. To do so, we use a so-called *schema definition* (a map of symbolic names to LDAP attributes). The following attribute names are defined: -* `password`: attribute containing the encrypted password. Usually - (and by default) this is `userPassword`, a somewhat standard LDAP - attribute. Since this attribute is often also used for - authentication of the LDAP protocol itself, an eventual `{crypt}` - prefix is ignored. Passwords should be encrypted with the system - `crypt` method. -* `otp_secret`: this attribute should contain the hex-encoded TOTP - secret. -* `app_specific_password`: attribute (possibly defined more than once) - containing an encoded app-specific password. -* `shard`: if set, LDAP attribute containing a shard ID for user - partitioning. - -The LDAP backend module makes some assumptions on the structure of the -user database: the most important is that app-specific passwords are -attributes of the user object. App-specific passwords should be -encoded as colon-separated strings: +* `password` contains the encrypted password. Since this attribute is + often also used for authentication of the LDAP protocol itself, an + eventual `{crypt}` prefix is ignored. Passwords should be encrypted. +* `otp_secret` should contain the hex-encoded TOTP secret +* `app_specific_password` (possibly repeated) contains an encrypted + app-specific password - service:encrypted_password:comment +The default attribute mapping looks like this: -Again, the password should be encrypted with the system `crypt` -method. The comment is a free-form string set by the user to tell the -various credentials apart. + password: userPassword + totp_secret: totpSecret + app_specific_password: appSpecificPassword +Except for *userPassword*, the others are custom LDAP attributes and +are not part of any standard schema definition. You should create your +own. + +App-specific passwords should be encoded as colon-separated strings: + + service:encrypted_password:comment + +The password should be encrypted. The comment is a free-form string +set by the user to tell the various credentials apart. ## OTP implementation @@ -120,90 +184,3 @@ token revocation is a read-write, locked operation which is more difficult to perform on a LDAP backend. -# Usage - -## Client authentication - -Requests to the authentication server can themselves be authenticated, -and it may be a good idea to do so in a production environment. - -Authserv supports TLS-based authentication using a private CA: in -order to perform authentication queries, a client must present an X509 -certificate signed by a specific Certification Authority. - -This feature is enabled by passing the `--ca`, `--ssl-cert` and -`--ssl-key` options to the server. - -The PAM client has options to specify a client certificate. - - -## HTTP API - -The authentication server accepts HTTP POST requests at the -`/api/1/auth` URL. Requests should contain the following parameters -(with a Content-Type of `application/x-www-form-urlencoded`): - -* `service`: the service to authenticate for -* `username`: username -* `password`: password -* `otp_token`: a 6-digit TOTP token (optional) -* `source_ip`: the remote address of the client connection (optional) -* `shard`: server shard (optional) - -The response is a simple string, one of: - -* `OK`: the authentication request was successful -* `ERR_AUTHENTICATION_FAILURE`: the authentication request failed -* `ERR_OTP_REQUIRED`: an OTP token is required in order to - authenticate, but it was not provided in the request. - -If the client application receives an `ERR_OTP_REQUIRED` result, it -should prompt the user for an OTP token and retry the authentication -request (including the same username and password) with the -`otp_token` field set. The PAM module, for example, can ask the user -for the OTP token interactively, while web applications could display -an interstitial form. - - -## PAM - -A PAM module, `pam_authclient`, is provided to integrate system -services with the authentication server. It provides only the -*account* (a no-op) and *auth* operations. - -Example usage: - - auth required pam_authclient.so auth_server=127.0.0.1:1616 - -The module knows about the following options: - -* `auth_server=`*HOST:PORT* specifies the authentication server to talk - to. It's possible to specify more than one server, separated by - commas, in which case they will be tried in sequence in case of - failure. -* `ssl_crt=`*FILE* load the X509 client certificate from FILE (in PEM format). -* `ssl_key=`*FILE* load the X509 certificate key from FILE. -* `ca=`*FILE* should point at the X509 CA certificate, used to verify - the authenticity of the server connection: the server certificate - must be signed by this CA. -* `shard=`*ID* sets the *shard* parameter, which may be used by the - authentication server to limit authentication to a subset of users. - -The `service` parameter sent to the auth server will be the PAM service, -it is not possible to override this in the PAM configuration. - -## NGINX mail_http_auth support - -The authentication server can optionally offer an HTTP API compatible -with NGINX's `mail_http_auth` module. This is particularly useful in -combination with user partitioning, as the server can use the `shard` -attribute of the user to direct NGINX to the right backend. - -The module understands the following configuration variables: - -* `NGINX_AUTH_SERVICE` (default: `mail`) is the service that will be - used for authentication by this module. -* `NGINX_AUTH_PORT_MAP` is a dictionary that maps protocol names to - port numbers for the backend connection. The default is - `{"pop3": 110, "imap": 143}`. - diff --git a/vendor/git.autistici.org/id/auth/test-config.yml b/vendor/git.autistici.org/id/auth/test-config.yml deleted file mode 100644 index 25f0084210c210addf338ea5034cac33c6e06775..0000000000000000000000000000000000000000 --- a/vendor/git.autistici.org/id/auth/test-config.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -enabled_backends: - - file -services: - test: - backends: - - { file: test-users.yml } - interactive: - challenge_response: true - backends: - - { file: test-users.yml } diff --git a/vendor/git.autistici.org/id/auth/test-users.yml b/vendor/git.autistici.org/id/auth/test-users.yml deleted file mode 100644 index 5ad8ed5305adcfe98ce3a39ba60e52bc537bbf1c..0000000000000000000000000000000000000000 --- a/vendor/git.autistici.org/id/auth/test-users.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: testuser - email: testuser@example.com - password: "16384$8$1$c479e8eb722f1b071efea7826ccf9c20$96d63ebed0c64afb746026f56f71b2a1f8796c73141d2d6b1958d4ea26c60a0b" - groups: - - group1 - - group2 - -- name: 2fauser - email: 2fauser@example.com - password: "16384$8$1$c479e8eb722f1b071efea7826ccf9c20$96d63ebed0c64afb746026f56f71b2a1f8796c73141d2d6b1958d4ea26c60a0b" - totp_secret: "O32OBVS5BL5EAPB5" diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go deleted file mode 100644 index d3ff659bb36b7c7be61c62b90de11654de8a4002..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// mkpost processes the output of cgo -godefs to -// modify the generated types. It is used to clean up -// the sys API in an architecture specific manner. -// -// mkpost is run after cgo -godefs; see README.md. -package main - -import ( - "bytes" - "fmt" - "go/format" - "io/ioutil" - "log" - "os" - "regexp" -) - -func main() { - // Get the OS and architecture (using GOARCH_TARGET if it exists) - goos := os.Getenv("GOOS") - goarch := os.Getenv("GOARCH_TARGET") - if goarch == "" { - goarch = os.Getenv("GOARCH") - } - // Check that we are using the new build system if we should be. - if goos == "linux" && goarch != "sparc64" { - if os.Getenv("GOLANG_SYS_BUILD") != "docker" { - os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n") - os.Stderr.WriteString("See README.md\n") - os.Exit(1) - } - } - - b, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Fatal(err) - } - - // If we have empty Ptrace structs, we should delete them. Only s390x emits - // nonempty Ptrace structs. - ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) - b = ptraceRexexp.ReplaceAll(b, nil) - - // Replace the control_regs union with a blank identifier for now. - controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`) - b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64")) - - // Remove fields that are added by glibc - // Note that this is unstable as the identifers are private. - removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // We refuse to export private fields on s390x - if goarch == "s390x" && goos == "linux" { - // Remove cgo padding fields - removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - - // Remove padding, hidden, or unused fields - removeFieldsRegex = regexp.MustCompile(`X_\S+`) - b = removeFieldsRegex.ReplaceAll(b, []byte("_")) - } - - // Remove the first line of warning from cgo - b = b[bytes.IndexByte(b, '\n')+1:] - // Modify the command in the header to include: - // mkpost, our own warning, and a build tag. - replacement := fmt.Sprintf(`$1 | go run mkpost.go -// Code generated by the command above; see README.md. DO NOT EDIT. - -// +build %s,%s`, goarch, goos) - cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) - b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) - - // gofmt - b, err = format.Source(b) - if err != nil { - log.Fatal(err) - } - - os.Stdout.Write(b) -} diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go deleted file mode 100644 index 415124d4a1a7f9ae0f6c7bc3167bd7af466d31f2..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_darwin.go +++ /dev/null @@ -1,254 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define __DARWIN_UNIX03 0 -#define KERNEL -#define _DARWIN_USE_64_BIT_INODE -#include <dirent.h> -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#include <unistd.h> -#include <mach/mach.h> -#include <mach/message.h> -#include <sys/event.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/param.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/uio.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/if_var.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat64 - -type Statfs_t C.struct_statfs64 - -type Flock_t C.struct_flock - -type Fstore_t C.struct_fstore - -type Radvisory_t C.struct_radvisory - -type Fbootstraptransfer_t C.struct_fbootstraptransfer - -type Log2phys_t C.struct_log2phys - -type Fsid C.struct_fsid - -type Dirent C.struct_dirent - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet4Pktinfo C.struct_in_pktinfo - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfmaMsghdr2 C.struct_ifma_msghdr2 - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go deleted file mode 100644 index 80b27781d1e169bfb0c264cc15f3becb1a93e6fa..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_dragonfly.go +++ /dev/null @@ -1,249 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include <dirent.h> -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#include <stdio.h> -#include <unistd.h> -#include <sys/event.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/param.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go deleted file mode 100644 index 934fd7ace22dccb31045c48223f9d3a3ea8df9a8..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ /dev/null @@ -1,372 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include <dirent.h> -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#include <stdio.h> -#include <unistd.h> -#include <sys/capability.h> -#include <sys/event.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/param.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -// This structure is a duplicate of stat on FreeBSD 8-STABLE. -// See /usr/include/sys/stat.h. -struct stat8 { -#undef st_atimespec st_atim -#undef st_mtimespec st_mtim -#undef st_ctimespec st_ctim -#undef st_birthtimespec st_birthtim - __dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - __dev_t st_rdev; -#if __BSD_VISIBLE - struct timespec st_atimespec; - struct timespec st_mtimespec; - struct timespec st_ctimespec; -#else - time_t st_atime; - long __st_atimensec; - time_t st_mtime; - long __st_mtimensec; - time_t st_ctime; - long __st_ctimensec; -#endif - off_t st_size; - blkcnt_t st_blocks; - blksize_t st_blksize; - fflags_t st_flags; - __uint32_t st_gen; - __int32_t st_lspare; -#if __BSD_VISIBLE - struct timespec st_birthtimespec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); -#else - time_t st_birthtime; - long st_birthtimensec; - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); - unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); -#endif -}; - -// This structure is a duplicate of if_data on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_data8 { - u_char ifi_type; - u_char ifi_physical; - u_char ifi_addrlen; - u_char ifi_hdrlen; - u_char ifi_link_state; - u_char ifi_spare_char1; - u_char ifi_spare_char2; - u_char ifi_datalen; - u_long ifi_mtu; - u_long ifi_metric; - u_long ifi_baudrate; - u_long ifi_ipackets; - u_long ifi_ierrors; - u_long ifi_opackets; - u_long ifi_oerrors; - u_long ifi_collisions; - u_long ifi_ibytes; - u_long ifi_obytes; - u_long ifi_imcasts; - u_long ifi_omcasts; - u_long ifi_iqdrops; - u_long ifi_noproto; - u_long ifi_hwassist; -// FIXME: these are now unions, so maybe need to change definitions? -#undef ifi_epoch - time_t ifi_epoch; -#undef ifi_lastchange - struct timeval ifi_lastchange; -}; - -// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE. -// See /usr/include/net/if.h. -struct if_msghdr8 { - u_short ifm_msglen; - u_char ifm_version; - u_char ifm_type; - int ifm_addrs; - int ifm_flags; - u_short ifm_index; - struct if_data8 ifm_data; -}; -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat8 - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.struct_fsid - -// Advice to Fadvise - -const ( - FADV_NORMAL = C.POSIX_FADV_NORMAL - FADV_RANDOM = C.POSIX_FADV_RANDOM - FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL - FADV_WILLNEED = C.POSIX_FADV_WILLNEED - FADV_DONTNEED = C.POSIX_FADV_DONTNEED - FADV_NOREUSE = C.POSIX_FADV_NOREUSE -) - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPMreqn C.struct_ip_mreqn - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPMreqn = C.sizeof_struct_ip_mreqn - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - sizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfMsghdr = C.sizeof_struct_if_msghdr8 - sizeofIfData = C.sizeof_struct_if_data - SizeofIfData = C.sizeof_struct_if_data8 - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type ifMsghdr C.struct_if_msghdr - -type IfMsghdr C.struct_if_msghdr8 - -type ifData C.struct_if_data - -type IfData C.struct_if_data8 - -type IfaMsghdr C.struct_ifa_msghdr - -type IfmaMsghdr C.struct_ifma_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr - SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfZbuf C.struct_bpf_zbuf - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfZbufHeader C.struct_bpf_zbuf_header - -// Terminal handling - -type Termios C.struct_termios - -type Winsize C.struct_winsize - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// Capabilities - -type CapRights C.struct_cap_rights diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go deleted file mode 100644 index cb95c80aabcbe07ab48e9b4b755a286f597edba5..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ /dev/null @@ -1,239 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include <dirent.h> -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#include <stdio.h> -#include <unistd.h> -#include <sys/param.h> -#include <sys/types.h> -#include <sys/event.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/sysctl.h> -#include <sys/time.h> -#include <sys/uio.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) - -// Sysctl - -type Sysctlnode C.struct_sysctlnode diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go deleted file mode 100644 index 392da69bf0a121215740a6e457380af6cd998200..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ /dev/null @@ -1,251 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -#include <dirent.h> -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#include <stdio.h> -#include <unistd.h> -#include <sys/param.h> -#include <sys/types.h> -#include <sys/event.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/ptrace.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/uio.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Statfs_t C.struct_statfs - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -type Fsid C.fsid_t - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Ptrace requests - -const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL -) - -// Events (kqueue, kevent) - -type Kevent_t C.struct_kevent - -// Select - -type FdSet C.fd_set - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type IfAnnounceMsghdr C.struct_if_announcemsghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -type Mclpool C.struct_mclpool - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfHdr C.struct_bpf_hdr - -type BpfTimeval C.struct_bpf_timeval - -// Terminal handling - -type Termios C.struct_termios - -// fchmodat-like syscalls. - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW -) diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go deleted file mode 100644 index 6d7461401c2ef4ac7618260a7282671293bd49c0..0000000000000000000000000000000000000000 --- a/vendor/golang.org/x/sys/unix/types_solaris.go +++ /dev/null @@ -1,265 +0,0 @@ -// 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. - -// +build ignore - -/* -Input to cgo -godefs. See README.md -*/ - -// +godefs map struct_in_addr [4]byte /* in_addr */ -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package unix - -/* -#define KERNEL -// These defines ensure that builds done on newer versions of Solaris are -// backwards-compatible with older versions of Solaris and -// OpenSolaris-based derivatives. -#define __USE_SUNOS_SOCKETS__ // msghdr -#define __USE_LEGACY_PROTOTYPES__ // iovec -#include <dirent.h> -#include <fcntl.h> -#include <netdb.h> -#include <limits.h> -#include <signal.h> -#include <termios.h> -#include <termio.h> -#include <stdio.h> -#include <unistd.h> -#include <sys/mman.h> -#include <sys/mount.h> -#include <sys/param.h> -#include <sys/resource.h> -#include <sys/select.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/statvfs.h> -#include <sys/time.h> -#include <sys/times.h> -#include <sys/types.h> -#include <sys/utsname.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <net/bpf.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/icmp6.h> -#include <netinet/tcp.h> -#include <ustat.h> -#include <utime.h> - -enum { - sizeofPtr = sizeof(void*), -}; - -union sockaddr_all { - struct sockaddr s1; // this one gets used for fields - struct sockaddr_in s2; // these pad it out - struct sockaddr_in6 s3; - struct sockaddr_un s4; - struct sockaddr_dl s5; -}; - -struct sockaddr_any { - struct sockaddr addr; - char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; -}; - -*/ -import "C" - -// Machine characteristics; for internal use. - -const ( - sizeofPtr = C.sizeofPtr - sizeofShort = C.sizeof_short - sizeofInt = C.sizeof_int - sizeofLong = C.sizeof_long - sizeofLongLong = C.sizeof_longlong - PathMax = C.PATH_MAX - MaxHostNameLen = C.MAXHOSTNAMELEN -) - -// Basic types - -type ( - _C_short C.short - _C_int C.int - _C_long C.long - _C_long_long C.longlong -) - -// Time - -type Timespec C.struct_timespec - -type Timeval C.struct_timeval - -type Timeval32 C.struct_timeval32 - -type Tms C.struct_tms - -type Utimbuf C.struct_utimbuf - -// Processes - -type Rusage C.struct_rusage - -type Rlimit C.struct_rlimit - -type _Gid_t C.gid_t - -// Files - -const ( // Directory mode bits - S_IFMT = C.S_IFMT - S_IFIFO = C.S_IFIFO - S_IFCHR = C.S_IFCHR - S_IFDIR = C.S_IFDIR - S_IFBLK = C.S_IFBLK - S_IFREG = C.S_IFREG - S_IFLNK = C.S_IFLNK - S_IFSOCK = C.S_IFSOCK - S_ISUID = C.S_ISUID - S_ISGID = C.S_ISGID - S_ISVTX = C.S_ISVTX - S_IRUSR = C.S_IRUSR - S_IWUSR = C.S_IWUSR - S_IXUSR = C.S_IXUSR -) - -type Stat_t C.struct_stat - -type Flock_t C.struct_flock - -type Dirent C.struct_dirent - -// Filesystems - -type _Fsblkcnt_t C.fsblkcnt_t - -type Statvfs_t C.struct_statvfs - -// Sockets - -type RawSockaddrInet4 C.struct_sockaddr_in - -type RawSockaddrInet6 C.struct_sockaddr_in6 - -type RawSockaddrUnix C.struct_sockaddr_un - -type RawSockaddrDatalink C.struct_sockaddr_dl - -type RawSockaddr C.struct_sockaddr - -type RawSockaddrAny C.struct_sockaddr_any - -type _Socklen C.socklen_t - -type Linger C.struct_linger - -type Iovec C.struct_iovec - -type IPMreq C.struct_ip_mreq - -type IPv6Mreq C.struct_ipv6_mreq - -type Msghdr C.struct_msghdr - -type Cmsghdr C.struct_cmsghdr - -type Inet6Pktinfo C.struct_in6_pktinfo - -type IPv6MTUInfo C.struct_ip6_mtuinfo - -type ICMPv6Filter C.struct_icmp6_filter - -const ( - SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in - SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - SizeofSockaddrAny = C.sizeof_struct_sockaddr_any - SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un - SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl - SizeofLinger = C.sizeof_struct_linger - SizeofIPMreq = C.sizeof_struct_ip_mreq - SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - SizeofMsghdr = C.sizeof_struct_msghdr - SizeofCmsghdr = C.sizeof_struct_cmsghdr - SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo - SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -// Select - -type FdSet C.fd_set - -// Misc - -type Utsname C.struct_utsname - -type Ustat_t C.struct_ustat - -const ( - AT_FDCWD = C.AT_FDCWD - AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW - AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW - AT_REMOVEDIR = C.AT_REMOVEDIR - AT_EACCESS = C.AT_EACCESS -) - -// Routing and interface messages - -const ( - SizeofIfMsghdr = C.sizeof_struct_if_msghdr - SizeofIfData = C.sizeof_struct_if_data - SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr - SizeofRtMsghdr = C.sizeof_struct_rt_msghdr - SizeofRtMetrics = C.sizeof_struct_rt_metrics -) - -type IfMsghdr C.struct_if_msghdr - -type IfData C.struct_if_data - -type IfaMsghdr C.struct_ifa_msghdr - -type RtMsghdr C.struct_rt_msghdr - -type RtMetrics C.struct_rt_metrics - -// Berkeley packet filter - -const ( - SizeofBpfVersion = C.sizeof_struct_bpf_version - SizeofBpfStat = C.sizeof_struct_bpf_stat - SizeofBpfProgram = C.sizeof_struct_bpf_program - SizeofBpfInsn = C.sizeof_struct_bpf_insn - SizeofBpfHdr = C.sizeof_struct_bpf_hdr -) - -type BpfVersion C.struct_bpf_version - -type BpfStat C.struct_bpf_stat - -type BpfProgram C.struct_bpf_program - -type BpfInsn C.struct_bpf_insn - -type BpfTimeval C.struct_bpf_timeval - -type BpfHdr C.struct_bpf_hdr - -// Terminal handling - -type Termios C.struct_termios - -type Termio C.struct_termio - -type Winsize C.struct_winsize diff --git a/vendor/vendor.json b/vendor/vendor.json index 248c6cb957d05515cdf8df0ec071d3a4c7218557..c34fe43580e9545dc93e1dc1c3a2c8b79aed3d01 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -5,32 +5,32 @@ { "checksumSHA1": "raJx5BjBbVQG0ylGSjPpi+JvqjU=", "path": "git.autistici.org/ai3/go-common", - "revision": "245211ebe9f881b575461958274bada3b8e20b7b", - "revisionTime": "2017-11-23T18:34:19Z" + "revision": "c2c933578837d28b6f0e9b0b4b183d53ab28785e", + "revisionTime": "2017-12-11T08:01:45Z" }, { - "checksumSHA1": "7xURJYvjMNDtt88/yg9/YzI59kQ=", + "checksumSHA1": "2X2UMundICtpGTb8pTdBk7PCKss=", "path": "git.autistici.org/ai3/go-common/clientutil", - "revision": "245211ebe9f881b575461958274bada3b8e20b7b", - "revisionTime": "2017-11-23T18:34:19Z" + "revision": "c2c933578837d28b6f0e9b0b4b183d53ab28785e", + "revisionTime": "2017-12-11T08:01:45Z" }, { "checksumSHA1": "3bComZxAfgnoTG4UDlyFgLyeykc=", "path": "git.autistici.org/ai3/go-common/serverutil", - "revision": "96dc550223598dd5d984bb5fc222323ef239bed7", - "revisionTime": "2017-12-09T10:27:16Z" + "revision": "c2c933578837d28b6f0e9b0b4b183d53ab28785e", + "revisionTime": "2017-12-11T08:01:45Z" }, { - "checksumSHA1": "hJvRJwSx9aZUKF26o/gOmgUJSsE=", + "checksumSHA1": "Br4iXxLFs+Yp7doAZQUccQA/su4=", "path": "git.autistici.org/id/auth", - "revision": "3f8dd8687feddc1594655a2167e798d24ebaed1c", - "revisionTime": "2017-11-01T08:12:58Z" + "revision": "c856639da0e714f8b4c5b6b299a21a30113217df", + "revisionTime": "2017-12-10T11:12:33Z" }, { "checksumSHA1": "48njEQBB73cV6tTPBEOnzSVRjeA=", "path": "git.autistici.org/id/auth/client", - "revision": "3f8dd8687feddc1594655a2167e798d24ebaed1c", - "revisionTime": "2017-11-01T08:12:58Z" + "revision": "c856639da0e714f8b4c5b6b299a21a30113217df", + "revisionTime": "2017-12-10T11:12:33Z" }, { "checksumSHA1": "usT4LCSQItkFvFOQT7cBlkCuGaE=", @@ -228,8 +228,8 @@ { "checksumSHA1": "y/oIaxq2d3WPizRZfVjo8RCRYTU=", "path": "golang.org/x/crypto/ripemd160", - "revision": "9419663f5a44be8b34ca85f08abc5fe1be11f8a3", - "revisionTime": "2017-09-30T17:45:11Z" + "revision": "2509b142fb2b797aa7587dad548f113b2c0f20ce", + "revisionTime": "2017-10-23T14:45:55Z" }, { "checksumSHA1": "dr5+PfIRzXeN+l1VG+s0lea9qz8=", @@ -238,7 +238,7 @@ "revisionTime": "2016-09-14T00:11:54Z" }, { - "checksumSHA1": "dp+OSc8jJIOd6h1mXoAmD3GGAAs=", + "checksumSHA1": "SRtaMCef+ybCW9QotET1ZRe3hLo=", "path": "golang.org/x/sys/unix", "revision": "a5054c7c1385fd50d9394475365355a87a7873ec", "revisionTime": "2017-09-05T14:23:55Z"